OSDN Git Service

Merge tag 'v4.4.214' into 10
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / drivers / staging / vt6656 / rxtx.c
index 4cd98bb..f2885f7 100644 (file)
@@ -280,11 +280,9 @@ static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context,
                                                        PK_TYPE_11B, &buf->b);
 
        /* Get Duration and TimeStamp */
-       if (ieee80211_is_pspoll(hdr->frame_control)) {
-               __le16 dur = cpu_to_le16(priv->current_aid | BIT(14) | BIT(15));
-
-               buf->duration_a = dur;
-               buf->duration_b = dur;
+       if (ieee80211_is_nullfunc(hdr->frame_control)) {
+               buf->duration_a = hdr->duration_id;
+               buf->duration_b = hdr->duration_id;
        } else {
                buf->duration_a = vnt_get_duration_le(priv,
                                                tx_context->pkt_type, need_ack);
@@ -373,10 +371,8 @@ static u16 vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context,
                          tx_context->pkt_type, &buf->ab);
 
        /* Get Duration and TimeStampOff */
-       if (ieee80211_is_pspoll(hdr->frame_control)) {
-               __le16 dur = cpu_to_le16(priv->current_aid | BIT(14) | BIT(15));
-
-               buf->duration = dur;
+       if (ieee80211_is_nullfunc(hdr->frame_control)) {
+               buf->duration = hdr->duration_id;
        } else {
                buf->duration = vnt_get_duration_le(priv, tx_context->pkt_type,
                                                    need_ack);
@@ -815,10 +811,14 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb)
                if (info->band == NL80211_BAND_5GHZ) {
                        pkt_type = PK_TYPE_11A;
                } else {
-                       if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT)
-                               pkt_type = PK_TYPE_11GB;
-                       else
-                               pkt_type = PK_TYPE_11GA;
+                       if (tx_rate->flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
+                               if (priv->basic_rates & VNT_B_RATES)
+                                       pkt_type = PK_TYPE_11GB;
+                               else
+                                       pkt_type = PK_TYPE_11GA;
+                       } else {
+                               pkt_type = PK_TYPE_11A;
+                       }
                }
        } else {
                pkt_type = PK_TYPE_11B;