From 44e489aad770953cf19f49f5e0f90893df4360ca Mon Sep 17 00:00:00 2001 From: Balaji Pothunoori Date: Fri, 25 Feb 2022 11:37:22 +0530 Subject: [PATCH] qcacld-3.0: select min bw during csa if channel bonding disabled During CSA max bw is selected for SAP in STA + SAP concurrency for non-dfs channel and SAP is tear down after 60 sec of operation due to STA is in 20Mhz and SAP is in 40Mhz with IEEE80211_HT_CAP_SUP_WIDTH_20_40 flag disabled. This change is to select 20Mhz BW during CSA if channel bonding is disabled. Change-Id: If4ed3d9a080ed976a0f4be6704848ae4494c7bbc CRs-Fixed: 3126074 --- components/mlme/dispatcher/inc/wlan_mlme_api.h | 14 +++++++++++++- components/mlme/dispatcher/src/wlan_mlme_api.c | 16 ++++++++++++++++ .../mlme/dispatcher/src/wlan_mlme_ucfg_api.c | 11 +---------- core/sap/src/sap_module.c | 15 ++++++++++++--- 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index ba0c7bcf82d6..12e7571b21a9 100644 --- a/components/mlme/dispatcher/inc/wlan_mlme_api.h +++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2018-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. 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 @@ -3221,4 +3221,16 @@ QDF_STATUS wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc, uint32_t *tx_retry_multiplier); +/** + * wlan_mlme_get_channel_bonding_5ghz - Get the channel bonding + * val for 5ghz freq + * @psoc: pointer to psoc object + * @value: pointer to the value which will be filled for the caller + * + * Return: QDF Status + */ +QDF_STATUS +wlan_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, + uint32_t *value); + #endif /* _WLAN_MLME_API_H_ */ diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c index 4926ab2098c6..d488f37ccd65 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -4990,3 +4990,19 @@ wlan_mlme_get_tx_retry_multiplier(struct wlan_objmgr_psoc *psoc, *tx_retry_multiplier = mlme_obj->cfg.gen.tx_retry_multiplier; return QDF_STATUS_SUCCESS; } + +QDF_STATUS +wlan_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, + uint32_t *value) +{ + struct wlan_mlme_psoc_ext_obj *mlme_obj; + + mlme_obj = mlme_get_psoc_ext_obj(psoc); + if (!mlme_obj) { + *value = cfg_default(CFG_CHANNEL_BONDING_MODE_5GHZ); + return QDF_STATUS_E_INVAL; + } + + *value = mlme_obj->cfg.feature_flags.channel_bonding_mode_5ghz; + return QDF_STATUS_SUCCESS; +} diff --git a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c index 269bf8c110ef..ce2808c49b6c 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1642,16 +1642,7 @@ QDF_STATUS ucfg_mlme_get_channel_bonding_5ghz(struct wlan_objmgr_psoc *psoc, uint32_t *value) { - struct wlan_mlme_psoc_ext_obj *mlme_obj; - - mlme_obj = mlme_get_psoc_ext_obj(psoc); - if (!mlme_obj) { - *value = cfg_default(CFG_CHANNEL_BONDING_MODE_5GHZ); - return QDF_STATUS_E_INVAL; - } - *value = mlme_obj->cfg.feature_flags.channel_bonding_mode_5ghz; - - return QDF_STATUS_SUCCESS; + return wlan_mlme_get_channel_bonding_5ghz(psoc, value); } QDF_STATUS diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 3387098db157..e0262ec99646 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1235,6 +1235,7 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context, enum phy_ch_width ch_width, concurrent_bw = 0; struct mac_context *mac; struct ch_params ch_params = {0}; + uint32_t channel_bonding_mode = 0; mac = sap_get_mac_context(); if (!mac) { @@ -1250,7 +1251,14 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context, */ ch_width = CH_WIDTH_20MHZ; } else { - ch_width = wlansap_get_max_bw_by_phymode(sap_context); + wlan_mlme_get_channel_bonding_5ghz(mac->psoc, + &channel_bonding_mode); + if (WLAN_REG_IS_5GHZ_CH_FREQ(chan_freq) && + (!channel_bonding_mode)) + ch_width = CH_WIDTH_20MHZ; + else + ch_width = wlansap_get_max_bw_by_phymode(sap_context); + concurrent_bw = wlan_sap_get_concurrent_bw( mac->pdev, mac->psoc, chan_freq, ch_width); @@ -1264,11 +1272,12 @@ wlansap_get_csa_chanwidth_from_phymode(struct sap_context *sap_context, ch_width = ch_params.ch_width; if (tgt_ch_params) *tgt_ch_params = ch_params; - sap_nofl_debug("freq %d bw %d (phymode %d, con bw %d, tgt bw %d)", + sap_nofl_debug("freq %d bw %d (phymode %d, con bw %d, tgt bw %d) channel bonding 5g %d", chan_freq, ch_width, sap_context->csr_roamProfile.phyMode, concurrent_bw, - tgt_ch_params ? tgt_ch_params->ch_width : CH_WIDTH_MAX); + tgt_ch_params ? tgt_ch_params->ch_width : CH_WIDTH_MAX, + channel_bonding_mode); return ch_width; }