From 00b694406fb1137a1597e6720ce0a0532644aead Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Wed, 24 Mar 2021 06:59:38 +0530 Subject: [PATCH] qcacld-3.0: Fix TDLS ax throughput issue When TDLS connection is made in 160 MHZ for 11ax staions, the MCS rates for the same aren't updated correctly. Also, MCS rate can change in case the connection between both stations is made with AP operating in NSS 1x1, as there is a check in lim_populate_he_mcs_set which will disable MCS rates corresponding to nss > 1x1. To fix this, copy 160 MHZ mcs from the staion parameters which gets updated in change station. Also, use nss parameter which is passed by lim_populate_he_mcs_set() in the check which was used to disable mcs rates corresponding to nss > 1x1. Thus, peer station nss will be used to determine whether to disable or not. Change-Id: I23079aed3795202e6ae32583a220c1ed3227c1dd CRs-Fixed: 2904540 --- components/tdls/dispatcher/inc/wlan_tdls_public_structs.h | 8 ++++++-- core/mac/src/pe/lim/lim_utils.c | 2 +- os_if/tdls/src/wlan_cfg80211_tdls.c | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h index 2e2a63496f..1b29493d15 100644 --- a/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h +++ b/components/tdls/dispatcher/inc/wlan_tdls_public_structs.h @@ -774,8 +774,12 @@ struct hecap { uint8_t mac_cap_info[6]; uint8_t phycap_info[11]; struct { - uint16_t rx_map; - uint16_t tx_map; + uint16_t rx_he_mcs_map_lt_80; + uint16_t tx_he_mcs_map_lt_80; + uint16_t rx_he_mcs_map_160; + uint16_t tx_he_mcs_map_160; + uint16_t rx_he_mcs_map_80_80; + uint16_t tx_he_mcs_map_80_80; } he_cap_mcs_info; } qdf_packed; #endif diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c index 67b82c0047..cfbafee830 100644 --- a/core/mac/src/pe/lim/lim_utils.c +++ b/core/mac/src/pe/lim/lim_utils.c @@ -7621,7 +7621,7 @@ QDF_STATUS lim_populate_he_mcs_set(struct mac_context *mac_ctx, (*(uint16_t *)peer_he_caps->rx_he_mcs_map_80_80), (*(uint16_t *)peer_he_caps->tx_he_mcs_map_80_80)); - if (session_entry->nss == NSS_2x2_MODE) { + if (nss == NSS_2x2_MODE) { if (mac_ctx->mlme_cfg->gen.as_enabled && wlan_reg_is_24ghz_ch_freq(session_entry->curr_op_freq)) { if (IS_2X2_CHAIN(session_entry->chainMask)) diff --git a/os_if/tdls/src/wlan_cfg80211_tdls.c b/os_if/tdls/src/wlan_cfg80211_tdls.c index 6c9123b1b8..9aaf9e7744 100644 --- a/os_if/tdls/src/wlan_cfg80211_tdls.c +++ b/os_if/tdls/src/wlan_cfg80211_tdls.c @@ -238,7 +238,8 @@ tdls_calc_channels_from_staparams(struct tdls_update_peer_params *req_info, } #ifdef WLAN_FEATURE_11AX -#define MIN_TDLS_HE_CAP_LEN 21 +#define MIN_TDLS_HE_CAP_LEN 17 +#define MAX_TDLS_HE_CAP_LEN 29 static void wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info, @@ -256,8 +257,11 @@ wlan_cfg80211_tdls_extract_he_params(struct tdls_update_peer_params *req_info, } req_info->he_cap_len = params->he_capa_len; + if (req_info->he_cap_len > MAX_TDLS_HE_CAP_LEN) + req_info->he_cap_len = MAX_TDLS_HE_CAP_LEN; + qdf_mem_copy(&req_info->he_cap, params->he_capa, - sizeof(struct hecap)); + req_info->he_cap_len); return; }