All of lore.kernel.org
 help / color / mirror / Atom feed
* [ath9k-devel] [PATCH 1/3] ath10k: Strip the QoS header only for QoS data frames
@ 2013-05-08  5:40 Sujith Manoharan
  2013-05-08  5:40 ` [ath9k-devel] [PATCH 2/3] ath10k: FW API update for version .629 Sujith Manoharan
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sujith Manoharan @ 2013-05-08  5:40 UTC (permalink / raw)
  To: ath9k-devel

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

Also, use ieee80211_hdrlen() to simplify things.

Signed-off-by: Sujith Manoharan <c_manoha@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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-09  4:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08  5:40 [ath9k-devel] [PATCH 1/3] ath10k: Strip the QoS header only for QoS data frames Sujith Manoharan
2013-05-08  5:40 ` [ath9k-devel] [PATCH 2/3] ath10k: FW API update for version .629 Sujith Manoharan
2013-05-08  6:19   ` Michal Kazior
2013-05-08  6:47     ` Sujith Manoharan
2013-05-08  5:40 ` [ath9k-devel] [PATCH 3/3] ath10k: Set the default TX encapsulation type Sujith Manoharan
2013-05-09  4:26   ` Kalle Valo
2013-05-09  4:24 ` [ath9k-devel] [PATCH 1/3] ath10k: Strip the QoS header only for QoS data frames Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.