Blame SOURCES/0088-Revert-iwlwifi-mvm-include-configured-sniffer-AID-in.patch

deb259
From 17ca0052ed9bc2267a6bf80c5e539299f59db930 Mon Sep 17 00:00:00 2001
deb259
From: Eugene Syromiatnikov <esyr@redhat.com>
deb259
Date: Fri, 6 Sep 2019 02:09:49 +0200
deb259
Subject: [PATCH 4/7] Revert "iwlwifi: mvm: include configured sniffer AID in
deb259
 radiotap"
deb259
deb259
This reverts commit 9bf13bee2d74a3b7bc0a59b1af7ad5f0a37f2176.
deb259
---
deb259
 drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c  | 44 +----------------------
deb259
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c |  2 --
deb259
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h      |  4 ---
deb259
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c     | 39 +++-----------------
deb259
 4 files changed, 5 insertions(+), 84 deletions(-)
deb259
deb259
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c
deb259
===================================================================
deb259
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c	2019-09-06 02:17:21.739438249 +0200
deb259
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c	2019-09-06 02:17:21.908436074 +0200
deb259
@@ -1781,33 +1781,11 @@
deb259
 	return ret ?: count;
deb259
 }
deb259
 
deb259
-struct iwl_mvm_sniffer_apply {
deb259
-	struct iwl_mvm *mvm;
deb259
-	u16 aid;
deb259
-};
deb259
-
deb259
-static bool iwl_mvm_sniffer_apply(struct iwl_notif_wait_data *notif_data,
deb259
-				  struct iwl_rx_packet *pkt, void *data)
deb259
-{
deb259
-	struct iwl_mvm_sniffer_apply *apply = data;
deb259
-
deb259
-	apply->mvm->cur_aid = cpu_to_le16(apply->aid);
deb259
-
deb259
-	return true;
deb259
-}
deb259
-
deb259
 static ssize_t
deb259
 iwl_dbgfs_he_sniffer_params_write(struct iwl_mvm *mvm, char *buf,
deb259
-				  size_t count, loff_t *ppos)
deb259
+			size_t count, loff_t *ppos)
deb259
 {
deb259
-	struct iwl_notification_wait wait;
deb259
 	struct iwl_he_monitor_cmd he_mon_cmd = {};
deb259
-	struct iwl_mvm_sniffer_apply apply = {
deb259
-		.mvm = mvm,
deb259
-	};
deb259
-	u16 wait_cmds[] = {
deb259
-		iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD, DATA_PATH_GROUP, 0),
deb259
-	};
deb259
 	u32 aid;
deb259
 	int ret;
deb259
 
deb259
@@ -1823,30 +1801,10 @@
deb259
 
deb259
 	he_mon_cmd.aid = cpu_to_le16(aid);
deb259
 
deb259
-	apply.aid = aid;
deb259
-
deb259
 	mutex_lock(&mvm->mutex);
deb259
-
deb259
-	/*
deb259
-	 * Use the notification waiter to get our function triggered
deb259
-	 * in sequence with other RX. This ensures that frames we get
deb259
-	 * on the RX queue _before_ the new configuration is applied
deb259
-	 * still have mvm->cur_aid pointing to the old AID, and that
deb259
-	 * frames on the RX queue _after_ the firmware processed the
deb259
-	 * new configuration (and sent the response, synchronously)
deb259
-	 * get mvm->cur_aid correctly set to the new AID.
deb259
-	 */
deb259
-	iwl_init_notification_wait(&mvm->notif_wait, &wait,
deb259
-				   wait_cmds, ARRAY_SIZE(wait_cmds),
deb259
-				   iwl_mvm_sniffer_apply, &apply);
deb259
-
deb259
 	ret = iwl_mvm_send_cmd_pdu(mvm, iwl_cmd_id(HE_AIR_SNIFFER_CONFIG_CMD,
deb259
 						   DATA_PATH_GROUP, 0), 0,
deb259
 				   sizeof(he_mon_cmd), &he_mon_cmd);
deb259
-
deb259
-	/* no need to really wait, we already did anyway */
deb259
-	iwl_remove_notification(&mvm->notif_wait, &wait);
deb259
-
deb259
 	mutex_unlock(&mvm->mutex);
deb259
 
deb259
 	return ret ?: count;
deb259
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
deb259
===================================================================
deb259
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c	2019-09-06 02:01:40.850551976 +0200
deb259
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c	2019-09-06 02:17:21.908436074 +0200
deb259
@@ -1046,8 +1046,6 @@
deb259
 
deb259
 	iwl_mvm_stop_device(mvm);
deb259
 
deb259
-	mvm->cur_aid = 0;
deb259
-
deb259
 	mvm->scan_status = 0;
deb259
 	mvm->ps_disabled = false;
deb259
 	mvm->calibrating = false;
deb259
Index: src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
deb259
===================================================================
deb259
--- src.orig/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h	2019-09-06 02:17:21.740438236 +0200
deb259
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h	2019-09-06 02:17:21.910436048 +0200
deb259
@@ -1132,10 +1132,6 @@
deb259
 
deb259
 	/* does a monitor vif exist (only one can exist hence bool) */
deb259
 	bool monitor_on;
deb259
-
deb259
-	/* sniffer data to include in radiotap */
deb259
-	__le16 cur_aid;
deb259
-
deb259
 #ifdef CONFIG_ACPI
deb259
 	struct iwl_mvm_sar_profile sar_profiles[ACPI_SAR_PROFILE_NUM];
deb259
 	struct iwl_mvm_geo_profile geo_profiles[ACPI_NUM_GEO_PROFILES];
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 02:17:21.577440335 +0200
deb259
+++ src/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c	2019-09-06 02:17:21.910436048 +0200
deb259
@@ -208,40 +208,11 @@
deb259
 	return 0;
deb259
 }
deb259
 
deb259
-static void iwl_mvm_add_rtap_sniffer_config(struct iwl_mvm *mvm,
deb259
-					    struct sk_buff *skb)
deb259
-{
deb259
-	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
deb259
-	struct ieee80211_vendor_radiotap *radiotap;
deb259
-	int size = sizeof(*radiotap) + sizeof(__le16);
deb259
-
deb259
-	if (!mvm->cur_aid)
deb259
-		return;
deb259
-
deb259
-	radiotap = skb_put(skb, size);
deb259
-	radiotap->align = 1;
deb259
-	/* Intel OUI */
deb259
-	radiotap->oui[0] = 0xf6;
deb259
-	radiotap->oui[1] = 0x54;
deb259
-	radiotap->oui[2] = 0x25;
deb259
-	/* radiotap sniffer config sub-namespace */
deb259
-	radiotap->subns = 1;
deb259
-	radiotap->present = 0x1;
deb259
-	radiotap->len = size - sizeof(*radiotap);
deb259
-	radiotap->pad = 0;
deb259
-
deb259
-	/* fill the data now */
deb259
-	memcpy(radiotap->data, &mvm->cur_aid, sizeof(mvm->cur_aid));
deb259
-
deb259
-	rx_status->flag |= RX_FLAG_RADIOTAP_VENDOR_DATA;
deb259
-}
deb259
-
deb259
 /* iwl_mvm_pass_packet_to_mac80211 - passes the packet for mac80211 */
deb259
 static void iwl_mvm_pass_packet_to_mac80211(struct iwl_mvm *mvm,
deb259
 					    struct napi_struct *napi,
deb259
 					    struct sk_buff *skb, int queue,
deb259
-					    struct ieee80211_sta *sta,
deb259
-					    bool csi)
deb259
+					    struct ieee80211_sta *sta)
deb259
 {
deb259
 	struct ieee80211_rx_status *rx_status = IEEE80211_SKB_RXCB(skb);
deb259
 
deb259
@@ -510,7 +481,7 @@
deb259
 		while ((skb = __skb_dequeue(skb_list))) {
deb259
 			iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb,
deb259
 							reorder_buf->queue,
deb259
-							sta, false);
deb259
+							sta);
deb259
 			reorder_buf->num_stored--;
deb259
 		}
deb259
 	}
deb259
@@ -916,7 +887,6 @@
deb259
 	struct ieee80211_sta *sta = NULL;
deb259
 	struct sk_buff *skb;
deb259
 	u8 crypt_len = 0;
deb259
-	bool csi = false;
deb259
 
deb259
 	if (unlikely(test_bit(IWL_MVM_STATUS_IN_HW_RESTART, &mvm->status)))
deb259
 		return;
deb259
@@ -1171,8 +1141,7 @@
deb259
 	}
deb259
 
deb259
 	if (!iwl_mvm_reorder(mvm, napi, queue, sta, skb, desc))
deb259
-		iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue,
deb259
-						sta, csi);
deb259
+		iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta);
deb259
 out:
deb259
 	rcu_read_unlock();
deb259
 }
deb259
@@ -1305,7 +1274,7 @@
deb259
 		rx_status->rate_idx = rate;
deb259
 	}
deb259
 
deb259
-	iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta, false);
deb259
+	iwl_mvm_pass_packet_to_mac80211(mvm, napi, skb, queue, sta);
deb259
 out:
deb259
 	rcu_read_unlock();
deb259
 }