From 95988e54f78d4c141bc3f3718f1f762417286c7e Mon Sep 17 00:00:00 2001 From: Jianmin Zhu Date: Thu, 1 Jul 2021 17:06:56 +0800 Subject: [PATCH] qcacld-3.0: Fix connected AP wrong encryption method After DUT STA connected 40M AP, if AP switch to 20M, DUT need update probe rsp IE of current AP and send to upper layer, but ht info tlv length in IE is changed by mistake for wrong ht info struct type is used, then android can't parse ht info and following RSN IE, can't get encryption method correctly. Change-Id: I84eab86514601f1efb1fda792148e611c290925d CRs-Fixed: 2977335 --- core/sme/src/csr/csr_api_roam.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 910d53bb4878..59ba5a57dfbc 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -81,6 +81,7 @@ #include "wlan_roam_debug.h" #include "wlan_cm_roam_public_struct.h" #include "wlan_mlme_twt_api.h" +#include "wlan_cmn_ieee80211.h" #define RSN_AUTH_KEY_MGMT_SAE WLAN_RSN_SEL(WLAN_AKM_SAE) #define MAX_PWR_FCC_CHAN_12 8 @@ -11649,7 +11650,8 @@ csr_roam_chk_lnk_swt_ch_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr) struct switch_channel_ind *pSwitchChnInd; struct csr_roam_info *roam_info; tSirMacDsParamSetIE *ds_params_ie; - tDot11fIEHTInfo *ht_info_ie; + struct wlan_ie_htinfo *ht_info_ie; + /* in case of STA, the SWITCH_CHANNEL originates from its AP */ sme_debug("eWNI_SME_SWITCH_CHL_IND from SME"); @@ -11694,15 +11696,16 @@ csr_roam_chk_lnk_swt_ch_ind(struct mac_context *mac_ctx, tSirSmeRsp *msg_ptr) wlan_reg_freq_to_chan(mac_ctx->pdev, pSwitchChnInd->freq); - ht_info_ie = (tDot11fIEHTInfo *)wlan_get_ie_ptr_from_eid( - DOT11F_EID_HTINFO, - (uint8_t *)session->pConnectBssDesc->ieFields, - ie_len); + ht_info_ie = + (struct wlan_ie_htinfo *)wlan_get_ie_ptr_from_eid + (DOT11F_EID_HTINFO, + (uint8_t *)session->pConnectBssDesc->ieFields, + ie_len); if (ht_info_ie) { - ht_info_ie->primaryChannel = + ht_info_ie->hi_ie.hi_ctrlchannel = wlan_reg_freq_to_chan(mac_ctx->pdev, pSwitchChnInd->freq); - ht_info_ie->secondaryChannelOffset = + ht_info_ie->hi_ie.hi_extchoff = pSwitchChnInd->chan_params.sec_ch_offset; } }