From 5f8906d29fa4cda70af3a7baa488ca1805424d0e Mon Sep 17 00:00:00 2001 From: Liangwei Dong Date: Tue, 31 Dec 2019 17:27:05 +0800 Subject: [PATCH] qcacld-3.0: Fix unknown phymode in vdev start If gDot11Mode=1 is set to INI, DUT STA will be failed to connect to 5G AP due to "unknown phymode" included in vdev start. Correct the driver to use freq API to identify 5G band BSS instead of channel API. And the change forces 11ax mode for 6ghz bss. Change-Id: I692fa744756490e7125ccd5fd82c15febc19ce68 CRs-Fixed: 2594048 --- core/sme/src/csr/csr_util.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/core/sme/src/csr/csr_util.c b/core/sme/src/csr/csr_util.c index f3d2a86ef4da..f6b5b5a6268f 100644 --- a/core/sme/src/csr/csr_util.c +++ b/core/sme/src/csr/csr_util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1903,12 +1903,19 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode, eCsrPhyMode phyMode2 = eCSR_DOT11_MODE_AUTO; enum csr_cfgdot11mode cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_AUTO; uint32_t bitMask, loopCount; - uint8_t bss_chan_id; + uint32_t bss_chan_freq; if (!QDF_IS_STATUS_SUCCESS(csr_get_phy_mode_from_bss(mac, pSirBssDesc, &phyModeInBssDesc, pIes))) return fMatch; + bss_chan_freq = pSirBssDesc->chan_freq; + if (WLAN_REG_IS_6GHZ_CHAN_FREQ(bss_chan_freq)) { + if (pReturnCfgDot11Mode) + *pReturnCfgDot11Mode = eCSR_CFG_DOT11_MODE_11AX; + return true; + } + if ((0 == phyMode) || (eCSR_DOT11_MODE_AUTO & phyMode)) { if (eCSR_CFG_DOT11_MODE_ABG == mac->roam.configParam.uCfgDot11Mode) { @@ -1927,7 +1934,6 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode, } } - bss_chan_id = wlan_reg_freq_to_chan(mac->pdev, pSirBssDesc->chan_freq); if ((0 == phyMode) || (eCSR_DOT11_MODE_AUTO & phyMode)) { if (0 != phyMode) { if (eCSR_DOT11_MODE_AUTO & phyMode) { @@ -1939,8 +1945,8 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode, } fMatch = csr_get_phy_mode_in_use(mac, phyMode2, phyModeInBssDesc, - WLAN_REG_IS_5GHZ_CH( - bss_chan_id), + !WLAN_REG_IS_24GHZ_CH_FREQ + (bss_chan_freq), &cfgDot11ModeToUse); } else { bitMask = 1; @@ -1950,7 +1956,7 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode, if (0 != phyMode2 && csr_get_phy_mode_in_use(mac, phyMode2, phyModeInBssDesc, - WLAN_REG_IS_5GHZ_CH(bss_chan_id), + !WLAN_REG_IS_24GHZ_CH_FREQ(bss_chan_freq), &cfgDot11ModeToUse)) { fMatch = true; break; @@ -1975,7 +1981,7 @@ bool csr_is_phy_mode_match(struct mac_context *mac, uint32_t phyMode, (eCSR_CFG_DOT11_MODE_11AX == cfgDot11ModeToUse))) { /* We cannot do 11n here */ - if (!WLAN_REG_IS_5GHZ_CH(bss_chan_id)) { + if (WLAN_REG_IS_24GHZ_CH_FREQ(bss_chan_freq)) { cfgDot11ModeToUse = eCSR_CFG_DOT11_MODE_11G; } else {