diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h index 3a923b41db..f2ac5dddc3 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 @@ -3421,4 +3421,16 @@ wlan_mlme_get_mgmt_hw_tx_retry_count(struct wlan_objmgr_psoc *psoc, 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 86ee4990a5..91e60ad48e 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_api.c @@ -5375,3 +5375,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 5c292a0f91..62ab6b541a 100644 --- a/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c +++ b/components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c @@ -1632,16 +1632,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 e3991dccce..7a29127c9b 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1251,6 +1251,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) { @@ -1266,7 +1267,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); + ch_width = wlansap_5g_original_bw_validate( sap_context, chan_freq, ch_width); concurrent_bw = wlan_sap_get_concurrent_bw( @@ -1282,13 +1290,14 @@ 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("csa freq %d bw %d (phymode %d con bw %d tgt bw %d orig %d reason %d)", + sap_nofl_debug("csa freq %d bw %d (phymode %d con bw %d tgt bw %d orig %d reason %d) channel bonding 5g %d", chan_freq, ch_width, sap_context->phyMode, concurrent_bw, tgt_ch_params ? tgt_ch_params->ch_width : CH_WIDTH_MAX, sap_context->ch_width_orig, - sap_context->csa_reason); + sap_context->csa_reason, + channel_bonding_mode); return ch_width; }