diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c index f26f64f735..5586c62273 100644 --- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c +++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c @@ -4964,6 +4964,17 @@ static void lim_process_sme_channel_change_request(struct mac_context *mac_ctx, ch_change_req->nw_type, ch_change_req->dot11mode); + if (IS_DOT11_MODE_HE(ch_change_req->dot11mode) && + lim_is_session_he_capable(session_entry)) { + lim_update_session_he_capable_chan_switch + (mac_ctx, session_entry, target_freq); + } else if (wlan_reg_is_6ghz_chan_freq(target_freq)) { + pe_debug("Invalid target_freq %d for dot11mode %d cur HE %d", + target_freq, ch_change_req->dot11mode, + lim_is_session_he_capable(session_entry)); + return; + } + /* Store the New Channel Params in session_entry */ session_entry->ch_width = ch_change_req->ch_width; session_entry->ch_center_freq_seg0 = diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index b4abe282a1..63d138290f 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7195,6 +7195,28 @@ void lim_update_session_he_capable(struct mac_context *mac, struct pe_session *s pe_debug("he_capable: %d", session->he_capable); } +void lim_update_session_he_capable_chan_switch(struct mac_context *mac, + struct pe_session *session, + uint32_t new_chan_freq) +{ + session->he_capable = true; + if (wlan_reg_is_6ghz_chan_freq(session->curr_op_freq) && + !wlan_reg_is_6ghz_chan_freq(new_chan_freq)) { + session->htCapability = 1; + session->vhtCapability = 1; + session->he_6ghz_band = 0; + } else if (!wlan_reg_is_6ghz_chan_freq(session->curr_op_freq) && + wlan_reg_is_6ghz_chan_freq(new_chan_freq)) { + session->htCapability = 0; + session->vhtCapability = 0; + session->he_6ghz_band = 1; + } + + pe_debug("he_capable: %d ht %d vht %d 6ghz_band %d new freq %d", + session->he_capable, session->htCapability, + session->vhtCapability, session->he_6ghz_band, new_chan_freq); +} + void lim_set_he_caps(struct mac_context *mac, struct pe_session *session, uint8_t *ie_start, uint32_t num_bytes) { diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 46e6f685da..d56ff1cc47 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1279,6 +1279,20 @@ void lim_update_stads_he_capable(tpDphHashNode sta_ds, tpSirAssocReq assoc_req); */ void lim_update_session_he_capable(struct mac_context *mac, struct pe_session *session); +/** + * lim_update_session_he_capable_chan_switch(): Update he_capable in PE session + * @mac: pointer to MAC context + * @session: pointer to PE session + * @new_chan_freq: new channel frequency Mhz + * + * Update session he capable during AP channel switching + * + * Return: None + */ +void lim_update_session_he_capable_chan_switch(struct mac_context *mac, + struct pe_session *session, + uint32_t new_chan_freq); + /** * lim_set_he_caps() - update HE caps to be sent to FW as part of scan IE * @mac: pointer to MAC @@ -1474,6 +1488,13 @@ static inline void lim_update_session_he_capable(struct mac_context *mac, { } +static inline +void lim_update_session_he_capable_chan_switch(struct mac_context *mac, + struct pe_session *session, + uint32_t new_chan_freq) +{ +} + static inline void lim_set_he_caps(struct mac_context *mac, struct pe_session *session, uint8_t *ie_start, uint32_t num_bytes) {