From 9f8722726c67dd4d365837dba62efaa575fe0cfb Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Thu, 10 Sep 2020 18:12:02 +0530 Subject: [PATCH] qcacld-3.0: Don't connect in 11ax if peer ldpc is disabled Don't connect in HE mode if the AP operating in 2.4 GHz does not support LDPC coding. Also, some peers which operate on 2.4 ghz and don't support LDPC coding, might satisfy the condtions which is used to force enable ldpc coding bit. If this bit is set, the peer doesn't support ldpc, it might fail to connect. To fix this, force enable ldpc coding only when peer is operating in 5/6 Ghz along with the already existing conditions. Change-Id: I4b424833bbf845de17acc0907e1098c0a01b3ee5 CRs-Fixed: 2760506 --- core/mac/src/pe/lim/lim_prop_exts_utils.c | 26 +++++++++++++++++++++++ core/mac/src/pe/lim/lim_utils.c | 5 +++-- 2 files changed, 29 insertions(+), 2 deletions(-) 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 356d6fca3c94..d3e16bb70ed8 100644 --- a/core/mac/src/pe/lim/lim_prop_exts_utils.c +++ b/core/mac/src/pe/lim/lim_prop_exts_utils.c @@ -320,6 +320,31 @@ static inline bool lim_extract_adaptive_11r_cap(uint8_t *ie, uint16_t ie_len) } #endif +#ifdef WLAN_FEATURE_11AX +static void lim_check_peer_ldpc_and_update(struct pe_session *session, + tSirProbeRespBeacon *beacon_struct) +{ + if (session->he_capable && + WLAN_REG_IS_24GHZ_CH_FREQ(session->curr_op_freq) && + beacon_struct->he_cap.present && + !beacon_struct->he_cap.ldpc_coding) { + session->he_capable = false; + pe_err("LDPC check failed for HE operation"); + if (session->vhtCapability) { + session->dot11mode = MLME_DOT11_MODE_11AC; + pe_debug("Update dot11mode to 11ac"); + } else { + session->dot11mode = MLME_DOT11_MODE_11N; + pe_debug("Update dot11mode to 11N"); + } + } +} +#else +static void lim_check_peer_ldpc_and_update(struct pe_session *session, + tSirProbeRespBeacon *beacon_struct) +{} +#endif + void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, uint16_t ie_len, uint8_t *qos_cap, uint8_t *uapsd, int8_t *local_constraint, @@ -542,6 +567,7 @@ void lim_extract_ap_capability(struct mac_context *mac_ctx, uint8_t *p_ie, } } lim_check_is_he_mcs_valid(session, beacon_struct); + lim_check_peer_ldpc_and_update(session, beacon_struct); lim_extract_he_op(session, beacon_struct); lim_update_he_bw_cap_mcs(session, beacon_struct); /* Extract the UAPSD flag from WMM Parameter element */ diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index d537e0c081e7..7b7973d3a8c9 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -6793,9 +6793,10 @@ static void lim_check_and_force_he_ldpc_cap(struct pe_session *session, tDot11fIEhe_cap *he_cap) { if (!he_cap->ldpc_coding && + !WLAN_REG_IS_24GHZ_CH_FREQ(session->curr_op_freq) && (session->ch_width > CH_WIDTH_20MHZ || - lim_check_he_80_mcs11_supp(session, he_cap) || - lim_check_is_bss_greater_than_4_nss_supp(session, he_cap))) + lim_check_he_80_mcs11_supp(session, he_cap) || + lim_check_is_bss_greater_than_4_nss_supp(session, he_cap))) he_cap->ldpc_coding = 1; }