diff mbox series

[08/17] wifi: iwlwifi: mvm: set ul_mu_data_disable when needed

Message ID 20240729201718.fef270d2995b.I328237837df30e1cb98764987eaaf8e8993e058c@changeid (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series wifi: iwlwifi: updates - 29-07-24 | expand

Commit Message

Miri Korenblit July 29, 2024, 5:20 p.m. UTC
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

The firmware needs to know what we had in the HE CAP, propagate that
setting to the firmware through the LINK command.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h |  8 +++++---
 drivers/net/wireless/intel/iwlwifi/mvm/link.c       | 11 +++++++++++
 2 files changed, 16 insertions(+), 3 deletions(-)

Comments

Ben Greear July 29, 2024, 5:31 p.m. UTC | #1
On 7/29/24 10:20, Miri Korenblit wrote:
> From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> 
> The firmware needs to know what we had in the HE CAP, propagate that
> setting to the firmware through the LINK command.

Hello Emmanuel,

Does this happen to fix a firmware crash?  I hit a FW crash when doing
be200 upload test to an mtk7996 testbed AP, and possibly it would
trigger this...

Thanks,
Ben
Emmanuel Grumbach July 29, 2024, 5:35 p.m. UTC | #2
Hi Ben,

On Mon, 2024-07-29 at 10:31 -0700, Ben Greear wrote:
> On 7/29/24 10:20, Miri Korenblit wrote:
> > From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> > 
> > The firmware needs to know what we had in the HE CAP, propagate that
> > setting to the firmware through the LINK command.
> 
> Hello Emmanuel,
> 
> Does this happen to fix a firmware crash?  I hit a FW crash when doing
> be200 upload test to an mtk7996 testbed AP, and possibly it would
> trigger this...
> 

While I always recommend to use our latest code, I don't see how this could fix a firmware crash,
especially since the firmware doesn't support this yet. The API is declared, but the implementation
is not in place yet.
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
index b9ed42faa63e..56b880e68870 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/mac-cfg.h
@@ -472,7 +472,9 @@  enum iwl_link_ctx_flags {
  * @bssid_index: index of the associated VAP
  * @bss_color: 11ax AP ID that is used in the HE SIG-A to mark inter BSS frame
  * @spec_link_id: link_id as the AP knows it
- * @reserved2: alignment
+ * @ul_mu_data_disable: OM Control UL MU Data Disable RX Support (bit 44) in
+ *	HE MAC Capabilities information field as defined in figure 9-897 in
+ *	IEEE802.11REVme-D5.0
  * @ibss_bssid_addr: bssid for ibss
  * @reserved_for_ibss_bssid_addr: reserved
  * @reserved3: reserved for future use
@@ -515,11 +517,11 @@  struct iwl_link_config_cmd {
 	u8 bssid_index;
 	u8 bss_color;
 	u8 spec_link_id;
-	u8 reserved2;
+	u8 ul_mu_data_disable;
 	u8 ibss_bssid_addr[6];
 	__le16 reserved_for_ibss_bssid_addr;
 	__le32 reserved3[8];
-} __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1, _VER_2, _VER_3 */
+} __packed; /* LINK_CONTEXT_CONFIG_CMD_API_S_VER_1, _VER_2, _VER_3, _VER_4 */
 
 /* Currently FW supports link ids in the range 0-3 and can have
  * at most two active links for each vif.
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/link.c b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
index a9929aa49913..3a6e0a90a3ef 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/link.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/link.c
@@ -293,6 +293,17 @@  int iwl_mvm_link_changed(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			(link_conf->uora_ocw_range >> 3) & 0x7;
 	}
 
+	/* ap_sta may be NULL if we're disconnecting */
+	if (changes & LINK_CONTEXT_MODIFY_HE_PARAMS && mvmvif->ap_sta) {
+		struct ieee80211_link_sta *link_sta =
+			link_sta_dereference_check(mvmvif->ap_sta, link_id);
+
+		if (!WARN_ON(!link_sta) && link_sta->he_cap.has_he &&
+		    link_sta->he_cap.he_cap_elem.mac_cap_info[5] &
+		    IEEE80211_HE_MAC_CAP5_OM_CTRL_UL_MU_DATA_DIS_RX)
+			cmd.ul_mu_data_disable = 1;
+	}
+
 	/* TODO  how to set ndp_fdbk_buff_th_exp? */
 
 	if (iwl_mvm_set_fw_mu_edca_params(mvm, mvmvif->link[link_id],