From cc1c447165ee689e7b9fbb00bd040c72c9fb2e55 Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 2 Aug 2021 15:31:51 +0530 Subject: [PATCH] qcacld-3.0: Fill He_Op correctly for non-6ghz TDLS link For the TDLS link, not established in 6ghz band, some elements in HE OP IE such as basic mcs, bss color are not filled properly. This might cause some IOT issue. To fix it fill the params correctly. It should be noted that VHT operation info should not be included in HE OP IE if the frame carries the VHT OP IE or sent in 2.4GHz. For TDLS link connected in 5Ghz band, VHT OP IE is sent in the setup confirm frame so no need to include that. Change-Id: I9426ff3ca16461628b8ebe9710048dc68866dbf4 CRs-Fixed: 3003984 --- core/mac/src/pe/lim/lim_process_tdls.c | 31 +++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 7e11426a5325..43b848df7e4c 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -919,15 +919,40 @@ static void lim_tdls_fill_setup_rsp_he_cap(struct mac_context *mac, pe_session); } +static void lim_tdls_populate_he_operations(struct mac_context *mac, + struct pe_session *pe_session, + tDot11fIEhe_op *he_op) +{ + struct wlan_mlme_he_caps *he_cap_info; + uint16_t mcs_set = 0; + + he_cap_info = &mac->mlme_cfg->he_caps; + he_op->co_located_bss = 0; + he_op->bss_color = pe_session->he_bss_color_change.new_color; + if (!he_op->bss_color) + he_op->bss_col_disabled = 1; + + mcs_set = (uint16_t)he_cap_info->he_ops_basic_mcs_nss; + if (pe_session->nss == NSS_1x1_MODE) + mcs_set |= 0xFFFC; + else + mcs_set |= 0xFFF0; + + *((uint16_t *)he_op->basic_mcs_nss) = mcs_set; + populate_dot11f_he_operation(mac, + pe_session, + he_op); +} + static void lim_tdls_fill_setup_cnf_he_op(struct mac_context *mac, uint32_t peer_capability, tDot11fTDLSSetupCnf *tdls_setup_cnf, struct pe_session *pe_session) { if (CHECK_BIT(peer_capability, TDLS_PEER_HE_CAP)) - populate_dot11f_he_operation(mac, - pe_session, - &tdls_setup_cnf->he_op); + lim_tdls_populate_he_operations(mac, + pe_session, + &tdls_setup_cnf->he_op); } static void lim_tdls_populate_he_matching_rate_set(struct mac_context *mac_ctx,