From 8d9acc2cd39027eeb2d76ea61355f6bda895aa4c Mon Sep 17 00:00:00 2001 From: Surya Prakash Sivaraj Date: Thu, 7 Dec 2023 15:37:33 +0530 Subject: [PATCH] qcacld-3.0: Check ch_width for dot11f vht and he caps Currently as STA, when populating channel width set, only max BW advertised by target are considered. However issue is that due to regulatory limitations, the max BW advertised may not be the real operating BW used by our device. Under such conditions, there'll be conflicts between AP's view of our capablities and the real ones host configured to target. Therefore when populating supported channel width set for VHT and HE capabilities, take current session's channel width into account so so that capabilities advertised could correctly reflect current running configurations. Change-Id: Ib072c3e4d36d5c3fbd5504d94a936175d1a92db0 CRs-Fixed: 3047338 --- .../src/sys/legacy/src/utils/src/parser_api.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index f0d4e3219bc3..821e01da2fd4 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -1195,8 +1195,12 @@ populate_dot11f_vht_caps(struct mac_context *mac, return QDF_STATUS_SUCCESS; } - if (wlan_reg_is_24ghz_ch_freq(pe_session->curr_op_freq)) + if (wlan_reg_is_24ghz_ch_freq(pe_session->curr_op_freq)) { pDot11f->supportedChannelWidthSet = 0; + } else { + if (pe_session->ch_width <= CH_WIDTH_80MHZ) + pDot11f->supportedChannelWidthSet = 0; + } if (pe_session->ht_config.ht_rx_ldpc) pDot11f->ldpcCodingCap = @@ -6404,6 +6408,16 @@ QDF_STATUS populate_dot11f_he_caps(struct mac_context *mac_ctx, struct pe_sessio } populate_dot11f_twt_he_cap(mac_ctx, session, he_cap); + if (wlan_reg_is_5ghz_ch_freq(session->curr_op_freq) || + wlan_reg_is_6ghz_chan_freq(session->curr_op_freq)) { + if (session->ch_width <= CH_WIDTH_80MHZ) { + he_cap->chan_width_2 = 0; + he_cap->chan_width_3 = 0; + } else if (session->ch_width == CH_WIDTH_160MHZ) { + he_cap->chan_width_3 = 0; + } + } + return QDF_STATUS_SUCCESS; }