diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index fe4e3a8f36..33f2867eb9 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -1146,6 +1146,18 @@ QDF_STATUS populate_dot11f_he_caps(struct mac_context *, struct pe_session *, tDot11fIEhe_cap *); QDF_STATUS populate_dot11f_he_operation(struct mac_context *, struct pe_session *, tDot11fIEhe_op *); +/** + * populate_dot11f_he_6ghz_cap() - pouldate HE 6GHz caps IE + * @mac_ctx: Global MAC context + * @session: PE session + * @he_6g_cap: pointer to HE 6GHz IE + * + * Populdate the HE 6GHz IE based on the session. + */ +QDF_STATUS +populate_dot11f_he_6ghz_cap(struct mac_context *mac_ctx, + struct pe_session *session, + tDot11fIEhe_6ghz_band_cap *he_6g_cap); #ifdef WLAN_FEATURE_11AX_BSS_COLOR QDF_STATUS populate_dot11f_he_bss_color_change(struct mac_context *mac_ctx, struct pe_session *session, @@ -1172,6 +1184,14 @@ static inline QDF_STATUS populate_dot11f_he_operation(struct mac_context *mac_ct return QDF_STATUS_SUCCESS; } +static inline QDF_STATUS +populate_dot11f_he_6ghz_cap(struct mac_context *mac_ctx, + struct pe_session *session, + tDot11fIEhe_6ghz_band_cap *he_6g_cap) +{ + return QDF_STATUS_SUCCESS; +} + static inline QDF_STATUS populate_dot11f_he_bss_color_change( struct mac_context *mac_ctx, struct pe_session *session, diff --git a/core/mac/src/pe/include/lim_session.h b/core/mac/src/pe/include/lim_session.h index fd2749ab84..525210d165 100644 --- a/core/mac/src/pe/include/lim_session.h +++ b/core/mac/src/pe/include/lim_session.h @@ -540,6 +540,7 @@ struct pe_session { tDot11fIEhe_cap he_config; tDot11fIEhe_op he_op; uint32_t he_sta_obsspd; + bool he_6ghz_band; #ifdef WLAN_FEATURE_11AX_BSS_COLOR tDot11fIEbss_color_change he_bss_color_change; struct bss_color_info bss_color_info[MAX_BSS_COLOR_VALUE]; 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 e38a06fd8a..388019c5aa 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 @@ -655,6 +655,11 @@ __lim_handle_sme_start_bss_request(struct mac_context *mac_ctx, uint32_t *msg_bu if (IS_DOT11_MODE_HE(session->dot11mode)) { lim_update_session_he_capable(mac_ctx, session); lim_copy_bss_he_cap(session, sme_start_bss_req); + } else if (wlan_reg_is_6ghz_chan_freq(session->curr_op_freq)) { + pe_err("Invalid oper_ch_freq %d for dot11mode %d", + session->curr_op_freq, session->dot11mode); + ret_code = eSIR_SME_INVALID_PARAMETERS; + goto free; } session->txLdpcIniFeatureEnabled = 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 f441645f58..e289b6103a 100644 --- a/core/mac/src/pe/lim/lim_send_management_frames.c +++ b/core/mac/src/pe/lim/lim_send_management_frames.c @@ -1203,6 +1203,8 @@ lim_send_assoc_rsp_mgmt_frame(struct mac_context *mac_ctx, &frm.he_cap); populate_dot11f_he_operation(mac_ctx, pe_session, &frm.he_op); + populate_dot11f_he_6ghz_cap(mac_ctx, pe_session, + &frm.he_6ghz_band_cap); } #ifdef WLAN_FEATURE_11W if (eSIR_MAC_TRY_AGAIN_LATER == status_code) { diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 89157d3c19..ce668a87c3 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7106,13 +7106,34 @@ void lim_log_he_op(struct mac_context *mac, tDot11fIEhe_op *he_ops) pe_debug("he basic mcs nss: 0x%04x", *((uint16_t *)he_ops->basic_mcs_nss)); - if (he_ops->vht_oper_present) + if (!he_ops->vht_oper_present) pe_debug("VHT Info not present in HE Operation"); else pe_debug("VHT Info: chan_width: %d, center_freq0: %d, center_freq1: %d", - he_ops->vht_oper.info.chan_width, - he_ops->vht_oper.info.center_freq_seg0, - he_ops->vht_oper.info.center_freq_seg1); + he_ops->vht_oper.info.chan_width, + he_ops->vht_oper.info.center_freq_seg0, + he_ops->vht_oper.info.center_freq_seg1); + + if (!he_ops->oper_info_6g_present) + pe_err("6G op_info not present in HE Operation"); + else + pe_err("6G_oper_info: chan_width: %d, center_freq0: %d, center_freq1: %d dup_bcon %d, min_rate %d", + he_ops->oper_info_6g.info.ch_width, + he_ops->oper_info_6g.info.center_freq_seg0, + he_ops->oper_info_6g.info.center_freq_seg1, + he_ops->oper_info_6g.info.dup_bcon, + he_ops->oper_info_6g.info.min_rate); +} + +void lim_log_he_6g_cap(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *he_6g_cap) +{ + pe_debug("min_mpdu_space: %0d, max_mpdu_len_exp: %0x, max_mpdu_len %0x, smps %0x, rd %0x rx_ant_ptn %d tx_ant_ptn %d", + he_6g_cap->min_mpdu_start_spacing, + he_6g_cap->max_ampdu_len_exp, he_6g_cap->max_mpdu_len, + he_6g_cap->sm_pow_save, he_6g_cap->rd_responder, + he_6g_cap->rx_ant_pattern_consistency, + he_6g_cap->tx_ant_pattern_consistency); } #ifdef WLAN_FEATURE_11AX_BSS_COLOR @@ -7154,6 +7175,11 @@ 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) { session->he_capable = true; + if (wlan_reg_is_6ghz_chan_freq(session->curr_op_freq)) { + session->htCapability = 0; + session->vhtCapability = 0; + session->he_6ghz_band = 1; + } pe_debug("he_capable: %d", session->he_capable); } diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 3b2499a9c4..11b6e83468 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1002,6 +1002,18 @@ void lim_copy_bss_he_cap(struct pe_session *session, void lim_copy_join_req_he_cap(struct pe_session *session, struct join_req *sme_join_req); +/** + * lim_log_he_6g_cap() - Print HE 6G cap IE + * @mac: pointer to MAC context + * @he_6g_cap: pointer to HE 6G cap IE + * + * Print HE 6G caps stored as dot11f structure + * + * Return: None + */ +void lim_log_he_6g_cap(struct mac_context *mac, + tDot11fIEhe_6ghz_band_cap *he_6g_cap); + /** * lim_log_he_op() - Print HE Operation * @mac: pointer to MAC context diff --git a/core/mac/src/pe/sch/sch_beacon_gen.c b/core/mac/src/pe/sch/sch_beacon_gen.c index 15b5641723..1ecb86a406 100644 --- a/core/mac/src/pe/sch/sch_beacon_gen.c +++ b/core/mac/src/pe/sch/sch_beacon_gen.c @@ -472,6 +472,8 @@ sch_set_fixed_beacon_fields(struct mac_context *mac_ctx, struct pe_session *sess &bcn_2->he_cap); populate_dot11f_he_operation(mac_ctx, session, &bcn_2->he_op); + populate_dot11f_he_6ghz_cap(mac_ctx, session, + &bcn_2->he_6ghz_band_cap); populate_dot11f_he_bss_color_change(mac_ctx, session, &bcn_2->bss_color_change); } 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 31563cd04d..887bc2ca4e 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 @@ -914,6 +914,11 @@ populate_dot11f_vht_caps(struct mac_context *mac, nCfgValue = 0; /* With VHT it suffices if we just examine HT */ if (pe_session) { + if (!pe_session->vhtCapability) { + pDot11f->present = 0; + return QDF_STATUS_SUCCESS; + } + if (pe_session->ht_config.ht_rx_ldpc) pDot11f->ldpcCodingCap = pe_session->vht_config.ldpc_coding; @@ -1074,6 +1079,9 @@ populate_dot11f_vht_operation(struct mac_context *mac, struct pe_session *pe_session, tDot11fIEVHTOperation *pDot11f) { + if (!pe_session || !pe_session->vhtCapability) + return QDF_STATUS_SUCCESS; + pDot11f->present = 1; if (pe_session->ch_width > CH_WIDTH_40MHZ) { @@ -5987,28 +5995,82 @@ populate_dot11f_he_operation(struct mac_context *mac_ctx, { qdf_mem_copy(he_op, &session->he_op, sizeof(*he_op)); - he_op->vht_oper_present = 1; he_op->present = 1; - if (session->ch_width > CH_WIDTH_40MHZ) { - he_op->vht_oper.info.chan_width = 1; - he_op->vht_oper.info.center_freq_seg0 = - session->ch_center_freq_seg0; - if (session->ch_width == CH_WIDTH_80P80MHZ || - session->ch_width == CH_WIDTH_160MHZ) - he_op->vht_oper.info.center_freq_seg1 = - session->ch_center_freq_seg1; - else + if (!session->he_6ghz_band) { + he_op->vht_oper_present = 1; + if (session->ch_width > CH_WIDTH_40MHZ) { + he_op->vht_oper.info.chan_width = 1; + he_op->vht_oper.info.center_freq_seg0 = + session->ch_center_freq_seg0; + if (session->ch_width == CH_WIDTH_80P80MHZ || + session->ch_width == CH_WIDTH_160MHZ) + he_op->vht_oper.info.center_freq_seg1 = + session->ch_center_freq_seg1; + else + he_op->vht_oper.info.center_freq_seg1 = 0; + } else { + he_op->vht_oper.info.chan_width = 0; + he_op->vht_oper.info.center_freq_seg0 = 0; he_op->vht_oper.info.center_freq_seg1 = 0; + } } else { - he_op->vht_oper.info.chan_width = 0; - he_op->vht_oper.info.center_freq_seg0 = 0; - he_op->vht_oper.info.center_freq_seg1 = 0; + he_op->oper_info_6g_present = 1; + if (session->ch_width > CH_WIDTH_40MHZ) { + he_op->oper_info_6g.info.ch_width = 1; + he_op->oper_info_6g.info.center_freq_seg0 = + session->ch_center_freq_seg0; + if (session->ch_width == CH_WIDTH_80P80MHZ || + session->ch_width == CH_WIDTH_160MHZ) + he_op->oper_info_6g.info.center_freq_seg1 = + session->ch_center_freq_seg1; + else + he_op->oper_info_6g.info.center_freq_seg1 = 0; + } else { + he_op->oper_info_6g.info.ch_width = 0; + he_op->oper_info_6g.info.center_freq_seg0 = 0; + he_op->oper_info_6g.info.center_freq_seg1 = 0; + } + he_op->oper_info_6g.info.primary_ch = + wlan_reg_freq_to_chan(mac_ctx->pdev, + session->curr_op_freq); + he_op->oper_info_6g.info.dup_bcon = 0; + he_op->oper_info_6g.info.min_rate = 0; } lim_log_he_op(mac_ctx, he_op); return QDF_STATUS_SUCCESS; } +QDF_STATUS +populate_dot11f_he_6ghz_cap(struct mac_context *mac_ctx, + struct pe_session *session, + tDot11fIEhe_6ghz_band_cap *he_6g_cap) +{ + struct mlme_ht_capabilities_info *ht_cap_info; + struct mlme_vht_capabilities_info *vht_cap_info; + + if (!session || !session->he_6ghz_band) + return QDF_STATUS_SUCCESS; + + ht_cap_info = &mac_ctx->mlme_cfg->ht_caps.ht_cap_info; + vht_cap_info = &mac_ctx->mlme_cfg->vht_caps.vht_cap_info; + + he_6g_cap->present = 1; + he_6g_cap->min_mpdu_start_spacing = + mac_ctx->mlme_cfg->ht_caps.ampdu_params.mpdu_density; + he_6g_cap->max_ampdu_len_exp = + session->vht_config.max_ampdu_lenexp; + he_6g_cap->max_mpdu_len = vht_cap_info->ampdu_len; + he_6g_cap->sm_pow_save = ht_cap_info->mimo_power_save; + he_6g_cap->rd_responder = 0; + he_6g_cap->rx_ant_pattern_consistency = 0; + he_6g_cap->tx_ant_pattern_consistency = 0; + + lim_log_he_6g_cap(mac_ctx, he_6g_cap); + + return QDF_STATUS_SUCCESS; +} + #ifdef WLAN_FEATURE_11AX_BSS_COLOR /** * populate_dot11f_he_bss_color_change() - pouldate HE BSS color change IE