linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org
Subject: [PATCH v2 04/22] iwlwifi: mvm: Block 26-tone RU OFDMA transmissions
Date: Mon, 19 Aug 2019 17:34:49 +0300	[thread overview]
Message-ID: <20190819143507.6989-5-luca@coelho.fi> (raw)
In-Reply-To: <20190819143507.6989-1-luca@coelho.fi>

From: Ilan Peer <ilan.peer@intel.com>

In case that there are OBSS that do not know how to properly
interpret 26-tone RU OFDMA transmissions, instruct the FW not
to use such transmissions.

The check is currently only performed upon association.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 .../net/wireless/intel/iwlwifi/fw/api/mac.h   |  4 ++
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 54 +++++++++++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  3 ++
 3 files changed, 61 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h b/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
index 85c5e367cbf1..73fb0030c496 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac.h
@@ -500,6 +500,9 @@ struct iwl_he_pkt_ext {
  *	enabled AGG, i.e. both BACK and non-BACK frames in a single AGG
  * @STA_CTXT_HE_MU_EDCA_CW: indicates that there is an element of MU EDCA
  *	parameter set, i.e. the backoff counters for trig-based ACs
+ * @STA_CTXT_HE_RU_2MHZ_BLOCK: indicates that 26-tone RU OFDMA transmission are
+ *      not allowed (as there are OBSS that might classify such transmissions as
+ *      radar pulses).
  */
 enum iwl_he_sta_ctxt_flags {
 	STA_CTXT_HE_REF_BSSID_VALID		= BIT(4),
@@ -511,6 +514,7 @@ enum iwl_he_sta_ctxt_flags {
 	STA_CTXT_HE_CONST_TRIG_RND_ALLOC	= BIT(10),
 	STA_CTXT_HE_ACK_ENABLED			= BIT(11),
 	STA_CTXT_HE_MU_EDCA_CW			= BIT(12),
+	STA_CTXT_HE_RU_2MHZ_BLOCK		= BIT(14),
 };
 
 /**
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index b74bd58f3f45..438a8b5b90c2 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -2254,6 +2254,10 @@ static void iwl_mvm_cfg_he_sta(struct iwl_mvm *mvm,
 
 	flags = 0;
 
+	/* Block 26-tone RU OFDMA transmissions */
+	if (mvmvif->he_ru_2mhz_block)
+		flags |= STA_CTXT_HE_RU_2MHZ_BLOCK;
+
 	/* HTC flags */
 	if (sta->he_cap.he_cap_elem.mac_cap_info[0] &
 	    IEEE80211_HE_MAC_CAP0_HTC_HE)
@@ -3205,6 +3209,51 @@ iwl_mvm_tdls_check_trigger(struct iwl_mvm *mvm,
 				peer_addr, action);
 }
 
+struct iwl_mvm_he_obss_narrow_bw_ru_data {
+	bool tolerated;
+};
+
+static void iwl_mvm_check_he_obss_narrow_bw_ru_iter(struct wiphy *wiphy,
+						    struct cfg80211_bss *bss,
+						    void *_data)
+{
+	struct iwl_mvm_he_obss_narrow_bw_ru_data *data = _data;
+	const struct element *elem;
+
+	elem = cfg80211_find_elem(WLAN_EID_EXT_CAPABILITY, bss->ies->data,
+				  bss->ies->len);
+
+	if (!elem || elem->datalen < 10 ||
+	    !(elem->data[10] &
+	      WLAN_EXT_CAPA10_OBSS_NARROW_BW_RU_TOLERANCE_SUPPORT)) {
+		data->tolerated = false;
+	}
+}
+
+static void iwl_mvm_check_he_obss_narrow_bw_ru(struct ieee80211_hw *hw,
+					       struct ieee80211_vif *vif)
+{
+	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+	struct iwl_mvm_he_obss_narrow_bw_ru_data iter_data = {
+		.tolerated = true,
+	};
+
+	if (!(vif->bss_conf.chandef.chan->flags & IEEE80211_CHAN_RADAR)) {
+		mvmvif->he_ru_2mhz_block = false;
+		return;
+	}
+
+	cfg80211_bss_iter(hw->wiphy, &vif->bss_conf.chandef,
+			  iwl_mvm_check_he_obss_narrow_bw_ru_iter,
+			  &iter_data);
+
+	/*
+	 * If there is at least one AP on radar channel that cannot
+	 * tolerate 26-tone RU UL OFDMA transmissions using HE TB PPDU.
+	 */
+	mvmvif->he_ru_2mhz_block = !iter_data.tolerated;
+}
+
 static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 				 struct ieee80211_vif *vif,
 				 struct ieee80211_sta *sta,
@@ -3306,6 +3355,11 @@ static int iwl_mvm_mac_sta_state(struct ieee80211_hw *hw,
 				iwl_mvm_cfg_he_sta(mvm, vif, mvm_sta->sta_id);
 		} else if (vif->type == NL80211_IFTYPE_STATION) {
 			vif->bss_conf.he_support = sta->he_cap.has_he;
+
+			mvmvif->he_ru_2mhz_block = false;
+			if (sta->he_cap.has_he)
+				iwl_mvm_check_he_obss_narrow_bw_ru(hw, vif);
+
 			iwl_mvm_mac_ctxt_changed(mvm, vif, false, NULL);
 		}
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index a263cc629d75..a14701c8933b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -504,6 +504,9 @@ struct iwl_mvm_vif {
 
 	/* we can only have 2 GTK + 2 IGTK active at a time */
 	struct ieee80211_key_conf *ap_early_keys[4];
+
+	/* 26-tone RU OFDMA transmissions should be blocked */
+	bool he_ru_2mhz_block;
 };
 
 static inline struct iwl_mvm_vif *
-- 
2.23.0.rc1


  parent reply	other threads:[~2019-08-19 14:35 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-19 14:34 [PATCH v2 00/22] iwlwifi: updates intended for v5.4 2019-08-17-2 Luca Coelho
2019-08-19 14:34 ` [PATCH v2 01/22] iwlwifi: bump FW API to 49 for 22000 series Luca Coelho
2019-08-19 14:34 ` [PATCH v2 02/22] iwlwifi: Send DQA enable command only if TVL is on Luca Coelho
2019-08-19 14:34 ` [PATCH v2 03/22] iwlwifi: mvm: remove redundant condition in iwl_mvm_set_hw_rfkill_state Luca Coelho
2019-08-19 14:34 ` Luca Coelho [this message]
2019-08-19 14:34 ` [PATCH v2 05/22] iwlwifi: mvm: remove unnecessary forward declarations Luca Coelho
2019-08-19 14:34 ` [PATCH v2 06/22] iwlwifi: dbg: move monitor recording functionality from header file Luca Coelho
2019-08-19 14:34 ` [PATCH v2 07/22] iwlwifi: dbg: move debug recording stop from trans to op mode Luca Coelho
2019-08-19 14:34 ` [PATCH v2 08/22] iwlwifi: dbg: support debug recording suspend resume command Luca Coelho
2019-08-19 14:34 ` [PATCH v2 09/22] iwlwifi: add ldbg config cmd debug print Luca Coelho
2019-08-19 14:55   ` Kalle Valo
2019-08-19 16:48     ` Luca Coelho
2019-08-19 14:34 ` [PATCH v2 10/22] iwlwifi: mvm: fix scan config command size Luca Coelho
2019-08-19 14:34 ` [PATCH v2 11/22] iwlwifi: mvm: add the skb length to a print Luca Coelho
2019-08-19 14:34 ` [PATCH v2 12/22] iwlwifi: mvm: start to remove the code for d0i3 Luca Coelho
2019-08-19 14:34 ` [PATCH v2 13/22] iwlwifi: remove all the d0i3 references Luca Coelho
2019-08-19 14:34 ` [PATCH v2 14/22] iwlwifi: mvm: remove the tx defer for d0i3 Luca Coelho
2019-08-19 14:35 ` [PATCH v2 15/22] iwlwifi: mvm: remove the d0i3 entry/exit flow Luca Coelho
2019-08-19 14:35 ` [PATCH v2 16/22] iwlwifi: mvm: iwl_mvm_wowlan_config_key_params is for wowlan only Luca Coelho
2019-08-19 14:35 ` [PATCH v2 17/22] iwlwifi: mvm: remove d0i3_ap_sta_id Luca Coelho
2019-08-19 14:35 ` [PATCH v2 18/22] iwlwifi: mvm: remove iwl_mvm_update_d0i3_power_mode Luca Coelho
2019-08-19 14:35 ` [PATCH v2 19/22] iwlwifi: mvm: remove last leftovers of d0i3 Luca Coelho
2019-08-19 14:35 ` [PATCH v2 20/22] iwlwifi: remove CMD_HIGH_PRIO Luca Coelho
2019-08-19 14:35 ` [PATCH v2 21/22] iwlwifi: trans: remove suspending flag Luca Coelho
2019-08-19 14:35 ` [PATCH v2 22/22] iwlwifi: remove the code under IWLWIFI_PCIE_RTPM Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190819143507.6989-5-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).