From d8a56fbc4ad7a83ddb6e16e59ee9658d84a91eb5 Mon Sep 17 00:00:00 2001 From: "Masti, Narayanraddi" Date: Tue, 6 Sep 2016 16:07:33 +0530 Subject: [PATCH] qcacld-3.0: Do not include 11b rates in TDLS setup request qcacld-2.0 to qcacld-3.0 propagation If base channel is 5 GHz and when we support all 11a and 11g rates, then there is no need to advertise 11b rates in TDLS setup request/response frames. Advertising 11b rates also leading to IOT issues with few third party devices. Fix is to ensure that 11b rates are not included if base channel is 5ghz. Change-Id: I45590a4067194e8929bac225b1a82ec510903539 CRs-Fixed: 955788 --- core/mac/src/include/parser_api.h | 3 ++- core/mac/src/pe/lim/lim_process_tdls.c | 15 ++++++++------ .../src/sys/legacy/src/utils/src/parser_api.c | 20 ++++++++++++++----- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/core/mac/src/include/parser_api.h b/core/mac/src/include/parser_api.h index 495e86a388..1b1486ebde 100644 --- a/core/mac/src/include/parser_api.h +++ b/core/mac/src/include/parser_api.h @@ -757,7 +757,8 @@ populate_dot11f_supp_rates(tpAniSirGlobal pMac, tSirRetStatus populate_dot11f_rates_tdls(tpAniSirGlobal p_mac, tDot11fIESuppRates *p_supp_rates, - tDot11fIEExtSuppRates *p_ext_supp_rates); + tDot11fIEExtSuppRates *p_ext_supp_rates, + uint8_t curr_oper_channel); tSirRetStatus populate_dot11f_tpc_report(tpAniSirGlobal pMac, tDot11fIETPCReport *pDot11f, diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index f4ab93e6c6..58a0addfb1 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -707,8 +707,9 @@ static tSirRetStatus lim_send_tdls_dis_rsp_frame(tpAniSirGlobal pMac, /* populate supported rate and ext supported rate IE */ if (eSIR_FAILURE == populate_dot11f_rates_tdls(pMac, - &tdlsDisRsp.SuppRates, - &tdlsDisRsp.ExtSuppRates)) + &tdlsDisRsp.SuppRates, + &tdlsDisRsp.ExtSuppRates, + psessionEntry->currentOperChannel)) lim_log(pMac, LOGE, FL("could not populate supported data rates")); @@ -1013,8 +1014,9 @@ tSirRetStatus lim_send_tdls_link_setup_req_frame(tpAniSirGlobal pMac, /* populate supported rate and ext supported rate IE */ if (eSIR_FAILURE == populate_dot11f_rates_tdls(pMac, - &tdlsSetupReq.SuppRates, - &tdlsSetupReq.ExtSuppRates)) + &tdlsSetupReq.SuppRates, + &tdlsSetupReq.ExtSuppRates, + psessionEntry->currentOperChannel)) lim_log(pMac, LOGE, FL("could not populate supported data rates")); @@ -1500,8 +1502,9 @@ static tSirRetStatus lim_send_tdls_setup_rsp_frame(tpAniSirGlobal pMac, /* populate supported rate and ext supported rate IE */ if (eSIR_FAILURE == populate_dot11f_rates_tdls(pMac, - &tdlsSetupRsp.SuppRates, - &tdlsSetupRsp.ExtSuppRates)) + &tdlsSetupRsp.SuppRates, + &tdlsSetupRsp.ExtSuppRates, + psessionEntry->currentOperChannel)) lim_log(pMac, LOGE, FL("could not populate supported data rates")); diff --git a/core/mac/src/sys/legacy/src/utils/src/parser_api.c b/core/mac/src/sys/legacy/src/utils/src/parser_api.c index 4339fec20a..a2133316ec 100644 --- a/core/mac/src/sys/legacy/src/utils/src/parser_api.c +++ b/core/mac/src/sys/legacy/src/utils/src/parser_api.c @@ -1770,6 +1770,7 @@ populate_dot11f_supp_rates(tpAniSirGlobal pMac, * @p_mac gloabl - header. * @p_supp_rates - pointer to supported rates IE * @p_ext_supp_rates - pointer to extended supported rates IE + * @curr_oper_channel - current operating channel * * This function populates the supported rates and extended supported * rates IE based in the STA capability. If the number of rates @@ -1783,7 +1784,8 @@ populate_dot11f_supp_rates(tpAniSirGlobal pMac, tSirRetStatus populate_dot11f_rates_tdls(tpAniSirGlobal p_mac, tDot11fIESuppRates *p_supp_rates, - tDot11fIEExtSuppRates *p_ext_supp_rates) + tDot11fIEExtSuppRates *p_ext_supp_rates, + uint8_t curr_oper_channel) { tSirMacRateSet temp_rateset; tSirMacRateSet temp_rateset2; @@ -1793,15 +1795,23 @@ populate_dot11f_rates_tdls(tpAniSirGlobal p_mac, wlan_cfg_get_int(p_mac, WNI_CFG_DOT11_MODE, &self_dot11mode); /** - * Include 11b rates only when the device configured in - * auto, 11a/b/g or 11b_only + * Include 11b rates only when the device configured in + * auto, 11a/b/g or 11b_only and also if current base + * channel is 5 GHz then no need to advertise the 11b rates. + * If devices move to 2.4GHz off-channel then they can communicate + * in 11g rates i.e. (6, 9, 12, 18, 24, 36 and 54). */ - if ((self_dot11mode == WNI_CFG_DOT11_MODE_ALL) || + lim_log(p_mac, LOG1, + FL("Current operating channel %d self_dot11mode = %d"), + curr_oper_channel, self_dot11mode); + + if ((curr_oper_channel <= SIR_11B_CHANNEL_END) && + ((self_dot11mode == WNI_CFG_DOT11_MODE_ALL) || (self_dot11mode == WNI_CFG_DOT11_MODE_11A) || (self_dot11mode == WNI_CFG_DOT11_MODE_11AC) || (self_dot11mode == WNI_CFG_DOT11_MODE_11N) || (self_dot11mode == WNI_CFG_DOT11_MODE_11G) || - (self_dot11mode == WNI_CFG_DOT11_MODE_11B)) { + (self_dot11mode == WNI_CFG_DOT11_MODE_11B))) { val = WNI_CFG_SUPPORTED_RATES_11B_LEN; wlan_cfg_get_str(p_mac, WNI_CFG_SUPPORTED_RATES_11B, (uint8_t *)&temp_rateset.rate, &val);