diff --git a/core/mac/src/pe/lim/lim_assoc_utils.c b/core/mac/src/pe/lim/lim_assoc_utils.c index 2093bc0942..7a8aa3167a 100644 --- a/core/mac/src/pe/lim/lim_assoc_utils.c +++ b/core/mac/src/pe/lim/lim_assoc_utils.c @@ -3722,15 +3722,10 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp vht_caps, pe_session); } - pe_debug("vhtCapable %d ch_width %d", pAddBssParams->vhtCapable, - pAddBssParams->ch_width); - if (lim_is_session_he_capable(pe_session) && (pAssocRsp->he_cap.present)) { lim_add_bss_he_cap(pAddBssParams, pAssocRsp); lim_add_bss_he_cfg(pAddBssParams, pe_session); - lim_update_he_6gop_assoc_resp(pAddBssParams, &pAssocRsp->he_op, - pe_session); } /* * Populate the STA-related parameters here @@ -3948,6 +3943,9 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp NULL, pAssocRsp); lim_update_he_stbc_capable(&pAddBssParams->staContext); + lim_update_he_6gop_assoc_resp(pAddBssParams, + &pAssocRsp->he_op, + pe_session); } } pAddBssParams->staContext.smesessionId = @@ -4049,6 +4047,8 @@ QDF_STATUS lim_sta_send_add_bss(struct mac_context *mac, tpSirAssocRsp pAssocRsp if (lim_is_fils_connection(pe_session)) pAddBssParams->no_ptk_4_way = true; + pe_debug("vhtCapable %d ch_width %d", pAddBssParams->vhtCapable, + pAddBssParams->staContext.ch_width); retCode = wma_send_peer_assoc_req(pAddBssParams); if (QDF_IS_STATUS_ERROR(retCode)) { diff --git a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c index abd977b71a..8dbb38e7e7 100644 --- a/core/mac/src/pe/lim/lim_process_assoc_req_frame.c +++ b/core/mac/src/pe/lim/lim_process_assoc_req_frame.c @@ -1704,6 +1704,7 @@ static bool lim_update_sta_ds(struct mac_context *mac_ctx, tpSirMacMgmtHdr hdr, ((sta_ds->supportedRates.vhtRxMCSMap & MCSMAPMASK2x2) == MCSMAPMASK2x2) ? 1 : 2; } + lim_update_stads_he_6ghz_op(session, sta_ds); /* Add STA context at MAC HW (BMU, RHP & TFP) */ sta_ds->qosMode = false; diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 9172789163..493d7d304b 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6737,6 +6737,7 @@ void lim_update_he_6gop_assoc_resp(struct bss_params *pAddBssParams, if (pAddBssParams->ch_width == CH_WIDTH_160MHZ) pAddBssParams->ch_width = pe_session->ch_width; + pAddBssParams->staContext.ch_width = pAddBssParams->ch_width; } void lim_update_stads_he_caps(tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp, @@ -6754,6 +6755,33 @@ void lim_update_stads_he_caps(tpDphHashNode sta_ds, tpSirAssocRsp assoc_rsp, } +void lim_update_stads_he_6ghz_op(struct pe_session *session, + tpDphHashNode sta_ds) +{ + tDot11fIEhe_cap *peer_he = &sta_ds->he_config; + enum phy_ch_width ch_width; + + if (!session->he_6ghz_band) + return; + + if (!peer_he->present) { + pe_debug("HE cap not present in peer"); + return; + } + + if (peer_he->chan_width_3) + ch_width = CH_WIDTH_80P80MHZ; + else if (peer_he->chan_width_2) + ch_width = CH_WIDTH_160MHZ; + else if (peer_he->chan_width_1) + ch_width = CH_WIDTH_80MHZ; + else + ch_width = CH_WIDTH_20MHZ; + if (ch_width > session->ch_width) + ch_width = session->ch_width; + sta_ds->ch_width = ch_width; +} + void lim_update_usr_he_cap(struct mac_context *mac_ctx, struct pe_session *session) { struct add_ie_params *add_ie = &session->add_ie_params; diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 39dde9f60f..fb61ecdd84 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1255,6 +1255,17 @@ QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx, struct pe_session *session_entry, uint8_t nss); +/** + * lim_update_stads_he_6ghz_op() - Update sta ds channel info + * @session: pe session + * @sta_ds: pointer to sta ds struct + + * Update sta_ds channel width. + * + * Return: void + */ +void lim_update_stads_he_6ghz_op(struct pe_session *session, + tpDphHashNode sta_ds); #else static inline void lim_add_he_cap(tpAddStaParams add_sta_params, tpSirAssocReq assoc_req) @@ -1401,6 +1412,11 @@ QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx, return QDF_STATUS_SUCCESS; } +static inline void +lim_update_stads_he_6ghz_op(struct pe_session *session, + tpDphHashNode sta_ds) +{ +} #endif /** diff --git a/core/sme/src/csr/csr_api_scan.c b/core/sme/src/csr/csr_api_scan.c index 68cbd21478..a548c0188e 100644 --- a/core/sme/src/csr/csr_api_scan.c +++ b/core/sme/src/csr/csr_api_scan.c @@ -2421,7 +2421,8 @@ static QDF_STATUS csr_fill_bss_from_scan_entry(struct mac_context *mac_ctx, bss_desc->beaconInterval = scan_entry->bcn_int; bss_desc->capabilityInfo = scan_entry->cap_info.value; - if (WLAN_REG_IS_5GHZ_CH_FREQ(scan_entry->channel.chan_freq)) + if (WLAN_REG_IS_5GHZ_CH_FREQ(scan_entry->channel.chan_freq) || + WLAN_REG_IS_6GHZ_CHAN_FREQ(scan_entry->channel.chan_freq)) bss_desc->nwType = eSIR_11A_NW_TYPE; else if (scan_entry->phy_mode == WLAN_PHYMODE_11B) bss_desc->nwType = eSIR_11B_NW_TYPE;