qcacld-3.0: Add the DFS MCC check in ACS algorithm
During channel selection for SAP via ACS, add check if there is
a connection on 5Ghz, don't allow SAP to select DFS channel.
Change-Id: If6e42cbc584ddb80588daf138d94d2e0a75b882a
CRs-Fixed: 2102024
diff --git a/core/sap/src/sap_ch_select.c b/core/sap/src/sap_ch_select.c
index e4529a3..1d9abc8 100644
--- a/core/sap/src/sap_ch_select.c
+++ b/core/sap/src/sap_ch_select.c
@@ -509,6 +509,13 @@
tSapChSelSpectInfo *spectinfo_param)
{
uint8_t i = 0;
+ tpAniSirGlobal mac_ctx = sme_get_mac_context();
+
+ if (NULL == mac_ctx) {
+ QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_ERROR,
+ "pmac Global Context is NULL");
+ return SAP_CHANNEL_NOT_SELECTED;
+ }
/*
* If Channel List is not Configured don't do anything
@@ -524,7 +531,9 @@
/* Select the best channel from allowed list */
for (i = 0; i < sap_ctx->acs_cfg->ch_list_count; i++) {
- if (sap_ctx->acs_cfg->ch_list[i] == best_chnl) {
+ if ((sap_ctx->acs_cfg->ch_list[i] == best_chnl) &&
+ !(wlan_reg_is_dfs_ch(mac_ctx->pdev, best_chnl) &&
+ policy_mgr_disallow_mcc(mac_ctx->psoc, best_chnl))) {
QDF_TRACE(QDF_MODULE_ID_SAP,
QDF_TRACE_LEVEL_INFO_HIGH,
"Best channel is: %d",