diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index 34878bb271..a4165a8561 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -5330,6 +5330,7 @@ struct ppet_hdr { #define HE_CH_WIDTH_COMBINE(b0, b1, b2, b3, b4, b5, b6) \ ((uint8_t)(b0) | ((b1) << 1) | ((b2) << 2) | ((b3) << 3) | \ ((b4) << 4) | ((b5) << 5) | ((b6) << 6)) +#define HE_CH_WIDTH_CLR_BIT(ch_wd, bit) (((ch_wd) >> (bit)) & ~1) /* * MCS values are interpreted as in IEEE 11ax-D1.4 spec onwards diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 7b7973d3a8..ee7f90caaf 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -69,6 +69,7 @@ #include #include #include +#include "wlan_mlme_ucfg_api.h" /** ------------------------------------------------------------- \fn lim_delete_dialogue_token_list @@ -7370,6 +7371,33 @@ void lim_set_he_caps(struct mac_context *mac, struct pe_session *session, } } +static void lim_intersect_he_ch_width_2g(struct mac_context *mac, + struct he_capability_info *he_cap) +{ + struct wlan_objmgr_psoc *psoc; + uint32_t cbm_24ghz; + QDF_STATUS ret; + + psoc = mac->psoc; + if (!psoc) + return; + + ret = ucfg_mlme_get_channel_bonding_24ghz(psoc, &cbm_24ghz); + if (QDF_IS_STATUS_ERROR(ret)) + return; + + pe_debug("channel bonding mode 2.4GHz %d", cbm_24ghz); + + if (!cbm_24ghz) { + /* B0: 40Mhz channel width in the 2.4GHz band */ + he_cap->chan_width = HE_CH_WIDTH_CLR_BIT(he_cap->chan_width, 0); + he_cap->he_ppdu_20_in_40Mhz_2G = 0; + } + + pe_debug("HE cap: chan_width: 0x%07x he_ppdu_20_in_40Mhz_2G %d", + he_cap->chan_width, he_cap->he_ppdu_20_in_40Mhz_2G); +} + QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, struct pe_session *session, enum QDF_OPMODE device_mode, @@ -7409,6 +7437,8 @@ QDF_STATUS lim_send_he_caps_ie(struct mac_context *mac_ctx, pe_err("Unable send HE Cap IE for 5GHZ band, status: %d", status_5g); + lim_intersect_he_ch_width_2g(mac_ctx, he_cap); + status_2g = lim_send_ie(mac_ctx, vdev_id, DOT11F_EID_HE_CAP, CDS_BAND_2GHZ, &he_caps[2], he_caps[1] + 1);