Pārlūkot izejas kodu

qcacld-3.0: Fix IOT connect failure issue with WEP AP

WEP AP advertises HT40 capability unexpected, DUT needs to use 20Mhz
channel bandwidth to connect to AP.
Add override "cbmode" to 20Mhz for dot11mode A/B/G.

Change-Id: Ic73ff7ca721ff2f10327b1d8d500b8d0ef384de1
CRs-Fixed: 3043993
Liangwei Dong 3 gadi atpakaļ
vecāks
revīzija
840b97841b

+ 11 - 1
core/mac/src/include/parser_api.h

@@ -1132,9 +1132,19 @@ void populate_dot11f_assoc_rsp_rates(struct mac_context *mac,
 
 int find_ie_location(struct mac_context *mac, tpSirRSNie pRsnIe, uint8_t EID);
 
+/**
+ * wlan_get_cb_mode() - Get channel bonding mode from beacon
+ * @mac: Global mac context
+ * @ch_freq: channel frequency
+ * @ie_struct: beacon ie struct
+ * @pe_session: pointer to PE session
+ *
+ * Return: ePhyChanBondState
+ */
 ePhyChanBondState wlan_get_cb_mode(struct mac_context *mac,
 				   qdf_freq_t ch_freq,
-				   tDot11fBeaconIEs *ie_struct);
+				   tDot11fBeaconIEs *ie_struct,
+				   struct pe_session *pe_session);
 
 void lim_log_vht_cap(struct mac_context *mac, tDot11fIEVHTCaps *pDot11f);
 

+ 9 - 10
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2859,20 +2859,18 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
 
 	session->enable_session_twt_support =
 					lim_enable_twt(mac_ctx, ie_struct);
-
-	cb_mode = wlan_get_cb_mode(mac_ctx, session->curr_op_freq, ie_struct);
-	if (WLAN_REG_IS_24GHZ_CH_FREQ(bss_desc->chan_freq) &&
-	    session->force_24ghz_in_ht20) {
-		cb_mode = PHY_SINGLE_CHANNEL_CENTERED;
-		pe_debug("force_24ghz_in_ht20 is set so set cbmode to 0");
-	}
-
 	status = lim_fill_dot11_mode(mac_ctx, session, ie_struct);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		status = QDF_STATUS_E_FAILURE;
 		goto send;
 	}
-
+	cb_mode = wlan_get_cb_mode(mac_ctx, session->curr_op_freq, ie_struct,
+				   session);
+	if (WLAN_REG_IS_24GHZ_CH_FREQ(bss_desc->chan_freq) &&
+	    session->force_24ghz_in_ht20) {
+		cb_mode = PHY_SINGLE_CHANNEL_CENTERED;
+		pe_debug("force_24ghz_in_ht20 is set so set cbmode to 0");
+	}
 	status = wlan_get_rate_set(mac_ctx, ie_struct, session);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		pe_err("Get rate failed vdev id %d", session->vdev_id);
@@ -4312,7 +4310,8 @@ static void lim_handle_reassoc_req(struct cm_vdev_join_req *req)
 	session_entry->lim_reassoc_chan_freq = req->entry->channel.chan_freq;
 	cb_mode = wlan_get_cb_mode(mac_ctx,
 				  session_entry->lim_reassoc_chan_freq,
-				  ie_struct);
+				  ie_struct,
+				  session_entry);
 	session_entry->reAssocHtSupportedChannelWidthSet = cb_mode ? 1 : 0;
 	session_entry->reAssocHtRecommendedTxWidthSet =
 		session_entry->reAssocHtSupportedChannelWidthSet;

+ 7 - 1
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -1093,7 +1093,8 @@ populate_dot11f_ht_caps(struct mac_context *mac,
 
 ePhyChanBondState wlan_get_cb_mode(struct mac_context *mac,
 				   qdf_freq_t ch_freq,
-				   tDot11fBeaconIEs *ie_struct)
+				   tDot11fBeaconIEs *ie_struct,
+				   struct pe_session *pe_session)
 {
 	ePhyChanBondState cb_mode = PHY_SINGLE_CHANNEL_CENTERED;
 	uint32_t sec_ch_freq = 0;
@@ -1111,6 +1112,11 @@ ePhyChanBondState wlan_get_cb_mode(struct mac_context *mac,
 	if (self_cb_mode == WNI_CFG_CHANNEL_BONDING_MODE_DISABLE)
 		return PHY_SINGLE_CHANNEL_CENTERED;
 
+	if (pe_session->dot11mode == MLME_DOT11_MODE_11A ||
+	    pe_session->dot11mode == MLME_DOT11_MODE_11G ||
+	    pe_session->dot11mode == MLME_DOT11_MODE_11B)
+		return PHY_SINGLE_CHANNEL_CENTERED;
+
 	if (!(ie_struct->HTCaps.present && (eHT_CHANNEL_WIDTH_40MHZ ==
 		ie_struct->HTCaps.supportedChannelWidthSet))) {
 		return PHY_SINGLE_CHANNEL_CENTERED;