diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c index afc54ac8eedb..f65ce0cd1017 100644 --- a/core/hdd/src/wlan_hdd_cfg80211.c +++ b/core/hdd/src/wlan_hdd_cfg80211.c @@ -2353,6 +2353,7 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, uint8_t ch_width; enum qca_wlan_vendor_acs_hw_mode hw_mode; QDF_STATUS qdf_status; + uint8_t conc_channel; /* ***Note*** Donot set SME config related to ACS operation here because * ACS operation is not synchronouse and ACS for Second AP may come when @@ -2607,6 +2608,37 @@ static int __wlan_hdd_cfg80211_do_acs(struct wiphy *wiphy, for (i = 0; i < sap_config->acs_cfg.ch_list_count; i++) hdd_debug("%d ", sap_config->acs_cfg.ch_list[i]); } + + conc_channel = policy_mgr_mode_specific_get_channel(hdd_ctx->hdd_psoc, + PM_STA_MODE); + if (hdd_ctx->config->external_acs_policy == + HDD_EXTERNAL_ACS_PCL_MANDATORY) { + if ((conc_channel >= WLAN_REG_CH_NUM(CHAN_ENUM_36) && + sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211A) || + (conc_channel <= WLAN_REG_CH_NUM(CHAN_ENUM_14) && + (sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211B || + sap_config->acs_cfg.band == QCA_ACS_MODE_IEEE80211A))) { + sap_config->acs_cfg.pri_ch = conc_channel; + wlan_sap_set_sap_ctx_acs_cfg( + WLAN_HDD_GET_SAP_CTX_PTR(adapter), sap_config); + sap_config_acs_result(hdd_ctx->hHal, + WLAN_HDD_GET_SAP_CTX_PTR(adapter), + sap_config->acs_cfg.ht_sec_ch); + sap_config->ch_params.ch_width = + sap_config->acs_cfg.ch_width; + sap_config->ch_params.sec_ch_offset = + sap_config->acs_cfg.ht_sec_ch; + sap_config->ch_params.center_freq_seg0 = + sap_config->acs_cfg.vht_seg0_center_ch; + sap_config->ch_params.center_freq_seg1 = + sap_config->acs_cfg.vht_seg1_center_ch; + /*notify hostapd about channel override */ + wlan_hdd_cfg80211_acs_ch_select_evt(adapter); + ret = 0; + goto out; + } + } + sap_config->acs_cfg.acs_mode = true; if (test_bit(ACS_IN_PROGRESS, &hdd_ctx->g_event_flags)) { /* ***Note*** Completion variable usage is not allowed diff --git a/core/sap/inc/sap_api.h b/core/sap/inc/sap_api.h index 7c76e9135120..81938b5a08fc 100644 --- a/core/sap/inc/sap_api.h +++ b/core/sap/inc/sap_api.h @@ -1296,6 +1296,21 @@ uint32_t wlan_sap_get_vht_ch_width(struct sap_context *sap_ctx); void wlan_sap_set_vht_ch_width(struct sap_context *sap_ctx, uint32_t vht_channel_width); +/** + * wlan_sap_set_sap_ctx_acs_cfg() - Sets acs cfg + * @sap_ctx: Pointer to Sap Context + * @sap_config: Pointer to sap config + * + * This function sets the acs cfg in sap context. + * + * Return: None + */ +void wlan_sap_set_sap_ctx_acs_cfg(struct sap_context *sap_ctx, + tsap_config_t *sap_config); + +void sap_config_acs_result(tHalHandle hal, struct sap_context *sap_ctx, + uint32_t sec_ch); + QDF_STATUS wlansap_update_sap_config_add_ie(tsap_config_t *pConfig, const uint8_t * pAdditionIEBuffer, diff --git a/core/sap/src/sap_internal.h b/core/sap/src/sap_internal.h index 66f4eb058968..5a04cea43a9d 100644 --- a/core/sap/src/sap_internal.h +++ b/core/sap/src/sap_internal.h @@ -389,8 +389,6 @@ QDF_STATUS sap_goto_channel_sel( bool sap_do_acs_pre_start_bss, bool check_for_connection_update); -void sap_config_acs_result(tHalHandle hal, struct sap_context *sap_ctx, - uint32_t sec_ch); /** * sap_check_in_avoid_ch_list() - checks if given channel present is channel * avoidance list diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index fa9a59907122..55b23b3a3189 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -620,6 +620,20 @@ static inline bool wlan_sap_validate_channel_switch(tHalHandle hal, return true; } #endif + +void wlan_sap_set_sap_ctx_acs_cfg(struct sap_context *sap_ctx, + tsap_config_t *sap_config) +{ + if (!sap_ctx) { + QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, + "%s: Invalid SAP pointer", + __func__); + return; + } + + sap_ctx->acs_cfg = &sap_config->acs_cfg; +} + QDF_STATUS wlansap_start_bss(struct sap_context *sap_ctx, tpWLAN_SAPEventCB pSapEventCallback, tsap_config_t *pConfig, void *pUsrContext)