diff mbox series

[v2,2/2] wifi: mwifiex: Fix HT40 bandwidth issue.

Message ID 20250205012843.758714-2-jeff.chen_1@nxp.com
State New
Headers show
Series [v2,1/2] wifi: mwifiex: Resolve the failure in downloading calibration data. | expand

Commit Message

Jeff Chen Feb. 5, 2025, 1:28 a.m. UTC
This patch addresses an issue where, despite the AP supporting 40MHz
bandwidth, the connection was limited to 20MHz. Without this fix,
even if the access point supports 40MHz, the bandwidth after
connection remains at 20MHz. This issue is not a regression.

Signed-off-by: Jeff Chen <jeff.chen_1@nxp.com>
---
 drivers/net/wireless/marvell/mwifiex/11n.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

Francesco Dolcini March 6, 2025, 10:37 a.m. UTC | #1
Hello Jeff,

On Wed, Feb 05, 2025 at 09:28:43AM +0800, Jeff Chen wrote:
> This patch addresses an issue where, despite the AP supporting 40MHz
> bandwidth, the connection was limited to 20MHz. Without this fix,
> even if the access point supports 40MHz, the bandwidth after
> connection remains at 20MHz. This issue is not a regression.

As you know this patch came after us (Toradex) reported some issue
connecting to 2.4GHz network using IW416.

However according to this commit message this actual fix is not related
to the issue in which it was not possible to connect at all, but it's
just an improvement. Can you confirm this?

Can you please also answer the last comment I had in the previous version of
this patch, see https://lore.kernel.org/all/Z44vj59nWIiswq7s@gaggiata.pivistrello.it/
?

Reported here again for you convenience:

  setting `radio_type |= (CHAN_BW_40MHZ << 2)` seems the only real change on this
  patch, correct? Anything else is cosmetic, correct?
  
  would doing just this change be equivalent, right?
  
  	SET_SECONDARYCHAN(chan_list->chan_scan_param[0].
  			  radio_type | (CHAN_BW_40MHZ << 2),
  			  (bss_desc->bcn_ht_oper->ht_param &
  			  IEEE80211_HT_PARAM_CHA_SEC_OFFSET));


Thanks,
Francesco
diff mbox series

Patch

diff --git a/drivers/net/wireless/marvell/mwifiex/11n.c b/drivers/net/wireless/marvell/mwifiex/11n.c
index 66f0f5377ac1..4ae0b4aaa09a 100644
--- a/drivers/net/wireless/marvell/mwifiex/11n.c
+++ b/drivers/net/wireless/marvell/mwifiex/11n.c
@@ -308,7 +308,7 @@  mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
 	int ret_len = 0;
 	struct ieee80211_supported_band *sband;
 	struct ieee_types_header *hdr;
-	u8 radio_type;
+	u8 radio_type, secch_offset;
 
 	if (!buffer || !*buffer)
 		return ret_len;
@@ -401,13 +401,15 @@  mwifiex_cmd_append_11n_tlv(struct mwifiex_private *priv,
 		chan_list->chan_scan_param[0].radio_type =
 			mwifiex_band_to_radio_type((u8) bss_desc->bss_band);
 
-		if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 &&
-		    bss_desc->bcn_ht_oper->ht_param &
-		    IEEE80211_HT_PARAM_CHAN_WIDTH_ANY)
-			SET_SECONDARYCHAN(chan_list->chan_scan_param[0].
-					  radio_type,
-					  (bss_desc->bcn_ht_oper->ht_param &
-					  IEEE80211_HT_PARAM_CHA_SEC_OFFSET));
+		if (sband->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
+			if (bss_desc->bcn_ht_oper->ht_param & IEEE80211_HT_PARAM_CHAN_WIDTH_ANY) {
+				chan_list->chan_scan_param[0].radio_type |= (CHAN_BW_40MHZ << 2);
+				secch_offset = bss_desc->bcn_ht_oper->ht_param &
+				IEEE80211_HT_PARAM_CHA_SEC_OFFSET;
+				SET_SECONDARYCHAN(chan_list->chan_scan_param[0].radio_type,
+						  secch_offset);
+			}
+		}
 
 		*buffer += struct_size(chan_list, chan_scan_param, 1);
 		ret_len += struct_size(chan_list, chan_scan_param, 1);