Blame SOURCES/0042-Revert-iwlwifi-mvm-add-L-SIG-length-to-radiotap.patch

deb259
From 5c2adb768dcc1275a47d35b61bffe8abdf225f9c Mon Sep 17 00:00:00 2001
deb259
From: Eugene Syromiatnikov <esyr@redhat.com>
deb259
Date: Thu, 5 Sep 2019 18:45:21 +0200
deb259
Subject: [PATCH 13/43] Revert "iwlwifi: mvm: add L-SIG length to radiotap"
deb259
deb259
This reverts commit 6721039d5b8adfd57291c54e96eaa9f54da23753.
deb259
---
deb259
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 96 ++++++++++-----------------
deb259
 1 file changed, 36 insertions(+), 60 deletions(-)
deb259
deb259
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
deb259
===================================================================
deb259
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c	2019-09-06 01:25:42.536329818 +0200
deb259
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c	2019-09-06 01:25:42.700327726 +0200
deb259
@@ -904,7 +904,6 @@
deb259
 }
deb259
 
deb259
 struct iwl_mvm_rx_phy_data {
deb259
-	enum iwl_rx_phy_info_type info_type;
deb259
 	__le32 d0, d1, d2, d3;
deb259
 	__le16 d4;
deb259
 };
deb259
@@ -1040,13 +1039,19 @@
deb259
 				       struct ieee80211_rx_status *rx_status,
deb259
 				       u32 rate_n_flags, int queue)
deb259
 {
deb259
-	switch (phy_data->info_type) {
deb259
+	enum iwl_rx_phy_info_type info_type;
deb259
+
deb259
+	info_type = le32_get_bits(phy_data->d1, IWL_RX_PHY_DATA1_INFO_TYPE_MASK);
deb259
+
deb259
+	switch (info_type) {
deb259
 	case IWL_RX_PHY_INFO_TYPE_NONE:
deb259
 	case IWL_RX_PHY_INFO_TYPE_CCK:
deb259
 	case IWL_RX_PHY_INFO_TYPE_OFDM_LGCY:
deb259
+		return;
deb259
 	case IWL_RX_PHY_INFO_TYPE_HT:
deb259
 	case IWL_RX_PHY_INFO_TYPE_VHT_SU:
deb259
 	case IWL_RX_PHY_INFO_TYPE_VHT_MU:
deb259
+		/* TODO: we have LSIG-LEN, where do we put it? */
deb259
 		return;
deb259
 	case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT:
deb259
 		he->data1 |= cpu_to_le16(IEEE80211_RADIOTAP_HE_DATA1_SPTL_REUSE_KNOWN |
deb259
@@ -1110,7 +1115,7 @@
deb259
 		break;
deb259
 	}
deb259
 
deb259
-	switch (phy_data->info_type) {
deb259
+	switch (info_type) {
deb259
 	case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT:
deb259
 		he_mu->flags1 |=
deb259
 			le16_encode_bits(le16_get_bits(phy_data->d4,
deb259
@@ -1154,7 +1159,7 @@
deb259
 }
deb259
 
deb259
 static void iwl_mvm_rx_he(struct iwl_mvm *mvm, struct sk_buff *skb,
deb259
-			  struct iwl_mvm_rx_phy_data *phy_data,
deb259
+			  struct iwl_rx_mpdu_desc *desc,
deb259
 			  u32 rate_n_flags, u16 phy_info, int queue)
deb259
 {
deb259
 	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
deb259
@@ -1179,13 +1184,33 @@
deb259
 				      IEEE80211_RADIOTAP_HE_MU_FLAGS2_BW_FROM_SIG_A_BW_KNOWN),
deb259
 	};
deb259
 	unsigned int radiotap_len = 0;
deb259
+	struct iwl_mvm_rx_phy_data phy_data = {
deb259
+		.d4 = desc->phy_data4,
deb259
+	};
deb259
+	enum iwl_rx_phy_info_type info_type = IWL_RX_PHY_INFO_TYPE_NONE;
deb259
+
deb259
+	if (mvm->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22560) {
deb259
+		phy_data.d0 = desc->v3.phy_data0;
deb259
+		phy_data.d1 = desc->v3.phy_data1;
deb259
+		phy_data.d2 = desc->v3.phy_data2;
deb259
+		phy_data.d3 = desc->v3.phy_data3;
deb259
+	} else {
deb259
+		phy_data.d0 = desc->v1.phy_data0;
deb259
+		phy_data.d1 = desc->v1.phy_data1;
deb259
+		phy_data.d2 = desc->v1.phy_data2;
deb259
+		phy_data.d3 = desc->v1.phy_data3;
deb259
+	}
deb259
+
deb259
+	if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD)
deb259
+		info_type = le32_get_bits(phy_data.d1,
deb259
+					  IWL_RX_PHY_DATA1_INFO_TYPE_MASK);
deb259
 
deb259
 	he = skb_put_data(skb, &known, sizeof(known));
deb259
 	radiotap_len += sizeof(known);
deb259
 	rx_status->flag |= RX_FLAG_RADIOTAP_HE;
deb259
 
deb259
-	if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_MU ||
deb259
-	    phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_MU_EXT) {
deb259
+	if (info_type == IWL_RX_PHY_INFO_TYPE_HE_MU ||
deb259
+	    info_type == IWL_RX_PHY_INFO_TYPE_HE_MU_EXT) {
deb259
 		he_mu = skb_put_data(skb, &mu_known, sizeof(mu_known));
deb259
 		radiotap_len += sizeof(mu_known);
deb259
 		rx_status->flag |= RX_FLAG_RADIOTAP_HE_MU;
deb259
@@ -1194,18 +1219,18 @@
deb259
 	/* temporarily hide the radiotap data */
deb259
 	__skb_pull(skb, radiotap_len);
deb259
 
deb259
-	if (phy_data->info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) {
deb259
+	if (info_type == IWL_RX_PHY_INFO_TYPE_HE_SU) {
deb259
 		/* report the AMPDU-EOF bit on single frames */
deb259
 		if (!queue && !(phy_info & IWL_RX_MPDU_PHY_AMPDU)) {
deb259
 			rx_status->flag |= RX_FLAG_AMPDU_DETAILS;
deb259
 			rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN;
deb259
-			if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF))
deb259
+			if (phy_data.d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF))
deb259
 				rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT;
deb259
 		}
deb259
 	}
deb259
 
deb259
 	if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD)
deb259
-		iwl_mvm_decode_he_phy_data(mvm, phy_data, he, he_mu, rx_status,
deb259
+		iwl_mvm_decode_he_phy_data(mvm, &phy_data, he, he_mu, rx_status,
deb259
 					   rate_n_flags, queue);
deb259
 
deb259
 	/* update aggregation data for monitor sake on default queue */
deb259
@@ -1218,7 +1243,7 @@
deb259
 		    (he_type == RATE_MCS_HE_TYPE_MU ||
deb259
 		     he_type == RATE_MCS_HE_TYPE_SU)) {
deb259
 			rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT_KNOWN;
deb259
-			if (phy_data->d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF))
deb259
+			if (phy_data.d0 & cpu_to_le32(IWL_RX_PHY_DATA0_HE_DELIM_EOF))
deb259
 				rx_status->flag |= RX_FLAG_AMPDU_EOF_BIT;
deb259
 		}
deb259
 	}
deb259
@@ -1305,33 +1330,6 @@
deb259
 				      IEEE80211_RADIOTAP_HE_DATA5_LTF_SIZE);
deb259
 }
deb259
 
deb259
-static void iwl_mvm_decode_lsig(struct sk_buff *skb,
deb259
-				struct iwl_mvm_rx_phy_data *phy_data)
deb259
-{
deb259
-	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
deb259
-	struct ieee80211_radiotap_lsig *lsig;
deb259
-
deb259
-	switch (phy_data->info_type) {
deb259
-	case IWL_RX_PHY_INFO_TYPE_HT:
deb259
-	case IWL_RX_PHY_INFO_TYPE_VHT_SU:
deb259
-	case IWL_RX_PHY_INFO_TYPE_VHT_MU:
deb259
-	case IWL_RX_PHY_INFO_TYPE_HE_TB_EXT:
deb259
-	case IWL_RX_PHY_INFO_TYPE_HE_SU:
deb259
-	case IWL_RX_PHY_INFO_TYPE_HE_MU:
deb259
-	case IWL_RX_PHY_INFO_TYPE_HE_MU_EXT:
deb259
-	case IWL_RX_PHY_INFO_TYPE_HE_TB:
deb259
-		lsig = skb_put(skb, sizeof(*lsig));
deb259
-		lsig->data1 = cpu_to_le16(IEEE80211_RADIOTAP_LSIG_DATA1_LENGTH_KNOWN);
deb259
-		lsig->data2 = le16_encode_bits(le32_get_bits(phy_data->d1,
deb259
-							     IWL_RX_PHY_DATA1_LSIG_LEN_MASK),
deb259
-					       IEEE80211_RADIOTAP_LSIG_DATA2_LENGTH);
deb259
-		rx_status->flag |= RX_FLAG_RADIOTAP_LSIG;
deb259
-		break;
deb259
-	default:
deb259
-		break;
deb259
-	}
deb259
-}
deb259
-
deb259
 void iwl_mvm_rx_mpdu_mq(struct iwl_mvm *mvm, struct napi_struct *napi,
deb259
 			struct iwl_rx_cmd_buffer *rxb, int queue)
deb259
 {
deb259
@@ -1346,10 +1344,6 @@
deb259
 	struct sk_buff *skb;
deb259
 	u8 crypt_len = 0, channel, energy_a, energy_b;
deb259
 	size_t desc_size;
deb259
-	struct iwl_mvm_rx_phy_data phy_data = {
deb259
-		.d4 = desc->phy_data4,
deb259
-		.info_type = IWL_RX_PHY_INFO_TYPE_NONE,
deb259
-	};
deb259
 	bool csi = false;
deb259
 
deb259
 	if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)))
deb259
@@ -1362,11 +1356,6 @@
deb259
 		energy_a = desc->v3.energy_a;
deb259
 		energy_b = desc->v3.energy_b;
deb259
 		desc_size = sizeof(*desc);
deb259
-
deb259
-		phy_data.d0 = desc->v3.phy_data0;
deb259
-		phy_data.d1 = desc->v3.phy_data1;
deb259
-		phy_data.d2 = desc->v3.phy_data2;
deb259
-		phy_data.d3 = desc->v3.phy_data3;
deb259
 	} else {
deb259
 		rate_n_flags = le32_to_cpu(desc->v1.rate_n_flags);
deb259
 		channel = desc->v1.channel;
deb259
@@ -1374,18 +1363,8 @@
deb259
 		energy_a = desc->v1.energy_a;
deb259
 		energy_b = desc->v1.energy_b;
deb259
 		desc_size = IWL_RX_DESC_SIZE_V1;
deb259
-
deb259
-		phy_data.d0 = desc->v1.phy_data0;
deb259
-		phy_data.d1 = desc->v1.phy_data1;
deb259
-		phy_data.d2 = desc->v1.phy_data2;
deb259
-		phy_data.d3 = desc->v1.phy_data3;
deb259
 	}
deb259
 
deb259
-	if (phy_info & IWL_RX_MPDU_PHY_TSF_OVERLOAD)
deb259
-		phy_data.info_type =
deb259
-			le32_get_bits(phy_data.d1,
deb259
-				      IWL_RX_PHY_DATA1_INFO_TYPE_MASK);
deb259
-
deb259
 	hdr = (void *)(pkt->data + desc_size);
deb259
 	/* Dont use dev_alloc_skb(), we'll have enough headroom once
deb259
 	 * ieee80211_hdr pulled.
deb259
@@ -1424,10 +1403,7 @@
deb259
 	}
deb259
 
deb259
 	if (rate_n_flags & RATE_MCS_HE_MSK)
deb259
-		iwl_mvm_rx_he(mvm, skb, &phy_data, rate_n_flags,
deb259
-			      phy_info, queue);
deb259
-
deb259
-	iwl_mvm_decode_lsig(skb, &phy_data);
deb259
+		iwl_mvm_rx_he(mvm, skb, desc, rate_n_flags, phy_info, queue);
deb259
 
deb259
 	rx_status = IEEE80211_SKB_RXCB(skb);
deb259