From dc104007172ae3f71fe16526361a207e52b4a8be Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 2 Nov 2020 13:17:45 +0530 Subject: [PATCH] qcacld-3.0: Don't fallback to 11ac if peer doesn't support MCS 10&11 In 2.4 Ghz, if peer is advertising MCS10/11 in 11ax and doesn't support LDPC coding then STA downgrades to 11ac but if AP doesn't advetise MCS 10&11 and LDPC bit is not supported, then STA treats LDPC as optional in 11ax and would not downgrade to 11ac from 11ax. Change-Id: I80b4c6615469c21020ed8d671c2d9ec94bd600b4 CRs-Fixed: 2810347 --- core/mac/src/pe/lim/lim_prop_exts_utils.c | 5 +++++ core/mac/src/pe/lim/lim_utils.c | 3 ++- core/mac/src/pe/lim/lim_utils.h | 10 ++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) 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 fcb8e31baa14..c422d840f987 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -346,9 +346,14 @@ static inline bool lim_extract_adaptive_11r_cap(uint8_t *ie, uint16_t ie_len) static void lim_check_peer_ldpc_and_update(struct pe_session *session, tSirProbeRespBeacon *beacon_struct) { + /* + * In 2.4G if AP supports HE till MCS 0-9 we can associate + * with HE mode instead downgrading to 11ac + */ if (session->he_capable && WLAN_REG_IS_24GHZ_CH_FREQ(session->curr_op_freq) && beacon_struct->he_cap.present && + lim_check_he_80_mcs11_supp(session, &beacon_struct->he_cap) && !beacon_struct->he_cap.ldpc_coding) { session->he_capable = false; pe_err("LDPC check failed for HE operation"); diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index b9ce0f394bf4..03d6499a6366 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6759,11 +6759,12 @@ static bool lim_check_is_bss_greater_than_4_nss_supp(struct pe_session *session, return false; } -static bool lim_check_he_80_mcs11_supp(struct pe_session *session, +bool lim_check_he_80_mcs11_supp(struct pe_session *session, tDot11fIEhe_cap *he_cap) { uint16_t rx_mcs_map; uint16_t tx_mcs_map; + rx_mcs_map = he_cap->rx_he_mcs_map_lt_80; tx_mcs_map = he_cap->tx_he_mcs_map_lt_80; if ((session->nss == NSS_1x1_MODE) && diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h index 8a751e808c93..24fa999ea436 100644 --- a/core/mac/src/pe/lim/lim_utils.h +++ b/core/mac/src/pe/lim/lim_utils.h @@ -1197,6 +1197,16 @@ void lim_log_he_bss_color(struct mac_context *mac, */ void lim_log_he_cap(struct mac_context *mac, tDot11fIEhe_cap *he_cap); +/** + * lim_check_he_80_mcs11_supp() - Check whether MCS 0-11 rates are supported + * @session: pointer to PE session + * @he_cap: pointer to HE capabilities + * + * Return: true if MCS 0-11 rates are supported + */ +bool lim_check_he_80_mcs11_supp(struct pe_session *session, + tDot11fIEhe_cap *he_cap); + /** * lim_update_stads_he_caps() - Copy HE capability into STA DPH hash table entry * @mac_ctx: pointer to mac context