rtl8xxxu: Set sequence number correctly for 40 byte TX descriptors
authorJes Sorensen <Jes.Sorensen@redhat.com>
Mon, 29 Feb 2016 22:05:32 +0000 (17:05 -0500)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 10 Mar 2016 13:29:16 +0000 (15:29 +0200)
SEQ changed location in the 40 byte TX descriptor. Set it correctly.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.c
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h

index dd9addf7badfaf020af41aca4b70cfa93568343c..968eac70163d5c652feed93d71e6dfa6acf0f58e 100644 (file)
@@ -6943,6 +6943,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
        struct ieee80211_rate *tx_rate = ieee80211_get_tx_rate(hw, tx_info);
        struct rtl8xxxu_priv *priv = hw->priv;
        struct rtl8723au_tx_desc *tx_desc;
+       struct rtl8723bu_tx_desc *tx_desc40;
        struct rtl8xxxu_tx_urb *tx_urb;
        struct ieee80211_sta *sta = NULL;
        struct ieee80211_vif *vif = tx_info->control.vif;
@@ -6953,7 +6954,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
        u16 rate_flag = tx_info->control.rates[0].flags;
        int tx_desc_size = priv->fops->tx_desc_size;
        int ret;
-       bool txdesc40, ampdu_enable;
+       bool usedesc40, ampdu_enable;
 
        if (skb_headroom(skb) < tx_desc_size) {
                dev_warn(dev,
@@ -6981,7 +6982,7 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
        if (ieee80211_is_action(hdr->frame_control))
                rtl8xxxu_dump_action(dev, hdr);
 
-       txdesc40 = (tx_desc_size == 40);
+       usedesc40 = (tx_desc_size == 40);
        tx_info->rate_driver_data[0] = hw;
 
        if (control && control->sta)
@@ -7017,9 +7018,6 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
                }
        }
 
-       seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
-       tx_desc->txdw3 = cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT);
-
        if (rate_flag & IEEE80211_TX_RC_MCS)
                rate = tx_info->control.rates[0].idx + DESC_RATE_MCS0;
        else
@@ -7043,16 +7041,26 @@ static void rtl8xxxu_tx(struct ieee80211_hw *hw,
                }
        }
 
-       if (!txdesc40) {
+       seq_number = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
+       if (!usedesc40) {
+               tx_desc->txdw3 =
+                       cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT_8723A);
+
                if (ampdu_enable)
                        tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723A);
                else
                        tx_desc->txdw1 |= cpu_to_le32(TXDESC_AGG_BREAK_8723A);
        } else {
+               tx_desc40 = (struct rtl8723bu_tx_desc *)tx_desc;
+
+               tx_desc40->txdw9 =
+                       cpu_to_le32((u32)seq_number << TXDESC_SEQ_SHIFT_8723B);
+
                if (ampdu_enable)
-                       tx_desc->txdw2 |= cpu_to_le32(TXDESC_AGG_ENABLE_8723B);
+                       tx_desc40->txdw2 |=
+                               cpu_to_le32(TXDESC_AGG_ENABLE_8723B);
                else
-                       tx_desc->txdw2 |= cpu_to_le32(TXDESC_AGG_BREAK_8723B);
+                       tx_desc40->txdw2 |= cpu_to_le32(TXDESC_AGG_BREAK_8723B);
        };
 
        if (ieee80211_is_data_qos(hdr->frame_control))
index 6ba12ab9ba4e0176fd22aa0f2e8154b8a9a256e0..8f95896f4dedbabe88a4975f4209ff472682a410 100644 (file)
@@ -467,8 +467,8 @@ struct rtl8723bu_tx_desc {
 #define TXDESC_GID_8723B               BIT(24)
 
 /* Word 3 */
-#define TXDESC_SEQ_SHIFT               16
-#define TXDESC_SEQ_MASK                        0x0fff0000
+#define TXDESC_SEQ_SHIFT_8723A         16
+#define TXDESC_SEQ_MASK_8723A          0x0fff0000
 
 /* Word 4 */
 #define TXDESC_QOS                     BIT(6)
@@ -498,6 +498,10 @@ struct rtl8723bu_tx_desc {
 /* Word 6 */
 #define TXDESC_MAX_AGG_SHIFT           11
 
+/* Word 9 */
+#define TXDESC_SEQ_SHIFT_8723B         12
+#define TXDESC_SEQ_MASK_8723B          0x00fff000
+
 struct phy_rx_agc_info {
 #ifdef __LITTLE_ENDIAN
        u8      gain:7, trsw:1;