diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index f48aac5c416f..4a99241f7304 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -148,6 +148,7 @@ typedef struct sSirProbeRespBeacon { tDot11fIEVHTCaps VHTCaps; tDot11fIEVHTOperation VHTOperation; tDot11fIEVHTExtBssLoad VHTExtBssLoad; + tDot11fIEExtCap ext_cap; tDot11fIEOperatingMode OperatingMode; uint8_t WiderBWChanSwitchAnnPresent; tDot11fIEWiderBWChanSwitchAnn WiderBWChanSwitchAnn; diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index 483c9bd77768..779070b6ed12 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -475,6 +475,7 @@ typedef struct sPESession /* Added to Support BT-AMP */ struct obss_scanparam obss_ht40_scanparam; /* Supported NSS is intersection of self and peer NSS */ bool supported_nss_1x1; + bool is_ext_caps_present; } tPESession, *tpPESession; /*------------------------------------------------------------------------- diff --git a/core/mac/src/pe/lim/lim_prop_exts_utils.c b/core/mac/src/pe/lim/lim_prop_exts_utils.c index 8961a2c9b411..869706e327f1 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -215,6 +215,9 @@ lim_extract_ap_capability(tpAniSirGlobal mac_ctx, uint8_t *p_ie, if (beacon_struct->countryInfoPresent) session->country_info_present = true; } + /* Check if Extended caps are present in probe resp or not */ + if (beacon_struct->ext_cap.present) + session->is_ext_caps_present = true; qdf_mem_free(beacon_struct); return; } /****** end lim_extract_ap_capability() ******/ diff --git a/core/mac/src/pe/lim/lim_send_management_frames.c b/core/mac/src/pe/lim/lim_send_management_frames.c index 683a5201b211..ef138b90b7d6 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1623,7 +1623,7 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, qdf_mem_set((uint8_t *) frm, sizeof(tDot11fAssocRequest), 0); - if (add_ie_len) { + if (add_ie_len && pe_session->is_ext_caps_present) { qdf_mem_set((uint8_t *) &extr_ext_cap, sizeof(tDot11fIEExtCap), 0); sir_status = lim_strip_extcap_update_struct(mac_ctx, @@ -1651,7 +1651,8 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, } } } else { - lim_log(mac_ctx, LOG1, FL("No additional IE for Assoc Req")); + lim_log(mac_ctx, LOG1, + FL("No addn IE or peer dosen't support addnIE for Assoc Req")); extr_ext_flag = false; } @@ -1800,7 +1801,9 @@ lim_send_assoc_req_mgmt_frame(tpAniSirGlobal mac_ctx, &frm->vendor2_ie.VHTCaps); vht_enabled = true; } - populate_dot11f_ext_cap(mac_ctx, vht_enabled, &frm->ExtCap, pe_session); + if (pe_session->is_ext_caps_present) + populate_dot11f_ext_cap(mac_ctx, vht_enabled, + &frm->ExtCap, pe_session); if (pe_session->pLimJoinReq->is11Rconnection) { tSirBssDescription *bssdescr; 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 517ab64d249d..8063d79d0c31 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 @@ -3647,6 +3647,11 @@ sir_parse_beacon_ie(tpAniSirGlobal pMac, &pBies->vendor2_ie.VHTOperation, sizeof(tDot11fIEVHTOperation)); } + if (pBies->ExtCap.present) { + pBeaconStruct->ext_cap.present = 1; + qdf_mem_copy(&pBeaconStruct->ext_cap, &pBies->ExtCap, + sizeof(tDot11fIEExtCap)); + } qdf_mem_free(pBies); return eSIR_SUCCESS; } /* End sir_parse_beacon_ie. */