From: Sujith Manoharan <c_man...@qca.qualcomm.com>

Also, use ieee80211_hdrlen() to simplify things.

Signed-off-by: Sujith Manoharan <c_man...@qca.qualcomm.com>
---
 drivers/net/wireless/ath/ath10k/mac.c | 50 +++++++----------------------------
 1 file changed, 9 insertions(+), 41 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c 
b/drivers/net/wireless/ath/ath10k/mac.c
index 930a092..59e9874 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -1176,56 +1176,24 @@ static void ath10k_reg_notifier(struct wiphy *wiphy,
 /* TX handlers */
 /***************/
 
+/*
+ * Frames sent to the FW have to be in "Native Wifi" format.
+ * Strip the QoS field from the 802.11 header.
+ */
 static void ath10k_tx_h_qos_workaround(struct ieee80211_hw *hw,
                                       struct ieee80211_tx_control *control,
                                       struct sk_buff *skb)
 {
        struct ieee80211_hdr *hdr = (void *)skb->data;
-       struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
-       struct ath10k_vif *arvif;
        u8 *qos_ctl;
 
-       /* This is FW issue. It injects QoS Control to frames when WMM is
-        * active (as far as FW is concerned). We either strip out _our_ QoS
-        * Control so FW can append it on its own or we upgrade a Data frame to
-        * a QoS Data frame */
-
-       if (!ieee80211_is_data(hdr->frame_control))
-               return;
-
-       if (!info->control.vif)
+       if (!ieee80211_is_data_qos(hdr->frame_control))
                return;
 
-       arvif = ath10k_vif_to_arvif(info->control.vif);
-
-       switch (arvif->vdev_type) {
-       case WMI_VDEV_TYPE_STA:
-       case WMI_VDEV_TYPE_IBSS:
-               if (!info->control.vif->bss_conf.qos)
-                       return;
-               break;
-       case WMI_VDEV_TYPE_AP:
-               if (!control->sta)
-                       return;
-
-               if (!control->sta->wme)
-                       return;
-               break;
-       default:
-               return;
-       }
-
-       if (!ieee80211_is_data_qos(hdr->frame_control)) {
-               hdr->frame_control = __cpu_to_le16(
-                               __le16_to_cpu(hdr->frame_control) |
-                               IEEE80211_STYPE_QOS_DATA);
-       } else {
-               qos_ctl = ieee80211_get_qos_ctl(hdr);
-               memmove(qos_ctl, qos_ctl + IEEE80211_QOS_CTL_LEN,
-                       skb->len -
-                       (qos_ctl + IEEE80211_QOS_CTL_LEN - skb->data));
-               skb_trim(skb, skb->len - IEEE80211_QOS_CTL_LEN);
-       }
+       qos_ctl = ieee80211_get_qos_ctl(hdr);
+       memmove(qos_ctl, qos_ctl + IEEE80211_QOS_CTL_LEN,
+               skb->len - ieee80211_hdrlen(hdr->frame_control));
+       skb_trim(skb, skb->len - IEEE80211_QOS_CTL_LEN);
 }
 
 static void ath10k_tx_h_update_wep_key(struct sk_buff *skb)
-- 
1.8.2.2

_______________________________________________
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Reply via email to