diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c index c03d95a8d164..f5e89692f558 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-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 @@ -1724,7 +1724,7 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) struct wlan_objmgr_psoc *psoc; struct policy_mgr_psoc_priv_obj *pm_ctx = NULL; struct sta_ap_intf_check_work_ctx *work_info = NULL; - uint32_t mcc_to_scc_switch, cc_count = 0, i, go_index_start; + uint32_t mcc_to_scc_switch, cc_count = 0, i; QDF_STATUS status; uint32_t ch_freq; uint32_t op_ch_freq_list[MAX_NUMBER_OF_CONC_CONNECTIONS]; @@ -1760,7 +1760,6 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) psoc, &op_ch_freq_list[cc_count], &vdev_id[cc_count], PM_SAP_MODE); policy_mgr_debug("Number of concurrent SAP: %d", cc_count); - go_index_start = cc_count; if (cc_count < MAX_NUMBER_OF_CONC_CONNECTIONS) cc_count = cc_count + policy_mgr_get_mode_specific_conn_info( @@ -1789,9 +1788,6 @@ static void __policy_mgr_check_sta_ap_concurrent_ch_intf(void *data) } if (cc_count < MAX_NUMBER_OF_CONC_CONNECTIONS) for (i = 0; i < cc_count; i++) { - if (i >= go_index_start && - !policy_mgr_go_scc_enforced(psoc)) - continue; status = pm_ctx->hdd_cbacks. wlan_hdd_get_channel_for_sap_restart (psoc, vdev_id[i], &ch_freq); diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 15a2ae304fb7..7f6daf516c62 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-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 @@ -3093,6 +3093,8 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( psoc, vdev_id); uint32_t sap_ch_freq, intf_ch_freq; struct sap_context *sap_context; + enum sap_csa_reason_code csa_reason = + CSA_REASON_CONCURRENT_STA_CHANGED_CHANNEL; if (!ap_adapter) { hdd_err("ap_adapter is NULL"); @@ -3131,6 +3133,11 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( return QDF_STATUS_E_FAILURE; } + intf_ch_freq = wlansap_get_chan_band_restrict(sap_context); + if (intf_ch_freq) { + csa_reason = CSA_REASON_BAND_RESTRICTED; + goto sap_restart; + } /* * If STA+SAP sessions are on DFS channel and STA+SAP SCC is * enabled on DFS channel then move the SAP out of DFS channel @@ -3143,6 +3150,12 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( goto sap_restart; } + if (ap_adapter->device_mode == QDF_P2P_GO_MODE && + !policy_mgr_go_scc_enforced(psoc)) { + wlansap_context_put(sap_context); + hdd_debug("p2p go no scc required"); + return QDF_STATUS_E_FAILURE; + } ucfg_policy_mgr_get_mcc_scc_switch(hdd_ctx->psoc, &mcc_to_scc_switch); /* @@ -3168,19 +3181,13 @@ QDF_STATUS wlan_hdd_get_channel_for_sap_restart( } sap_restart: - if (!intf_ch_freq) { - intf_ch_freq = wlansap_get_chan_band_restrict(sap_context); - if (intf_ch_freq == sap_ch_freq) - intf_ch_freq = 0; - } else - sap_context->csa_reason = - CSA_REASON_CONCURRENT_STA_CHANGED_CHANNEL; if (!intf_ch_freq) { wlansap_context_put(sap_context); hdd_debug("interface channel is 0"); return QDF_STATUS_E_FAILURE; + } else { + sap_context->csa_reason = csa_reason; } - hdd_info("SAP restart orig chan freq: %d, new freq: %d", hdd_ap_ctx->sap_config.chan_freq, intf_ch_freq); ch_params.ch_width = CH_WIDTH_MAX; diff --git a/core/sap/src/sap_module.c b/core/sap/src/sap_module.c index 31e6c0fe2353..dbc70cf74c9f 100644 --- a/core/sap/src/sap_module.c +++ b/core/sap/src/sap_module.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-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 @@ -3238,7 +3238,7 @@ qdf_freq_t wlansap_get_chan_band_restrict(struct sap_context *sap_ctx) restart_freq = intf_ch_freq; vdev_id = sap_ctx->vdev->vdev_objmgr.vdev_id; sap_debug("vdev: %d, CSA target freq: %d", vdev_id, restart_freq); - sap_ctx->csa_reason = CSA_REASON_BAND_RESTRICTED; + return restart_freq; }