瀏覽代碼

qcacld-3.0: Don't allow SAP setup on indoor chn only

In default configure with sta_sap_scc_on_indoor_chan=1 and
gindoor_channel_support=0, we don't expect sap setup on indoor
channel only.

Change-Id: Ibea0eb41b20bcbdaa365bd3fa4f0a7be7b696493
CRs-Fixed: 3278223
chunquan 2 年之前
父節點
當前提交
00d1710be6
共有 1 個文件被更改,包括 18 次插入0 次删除
  1. 18 0
      core/sap/src/sap_ch_select.c

+ 18 - 0
core/sap/src/sap_ch_select.c

@@ -51,6 +51,7 @@
 #include "wlan_reg_services_api.h"
 #include <wlan_scan_utils_api.h>
 #include <wlan_cp_stats_mc_ucfg_api.h>
+#include <wlan_policy_mgr_api.h>
 
 /*--------------------------------------------------------------------------
    Function definitions
@@ -417,6 +418,8 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle,
 	bool include_dfs_ch = true;
 	uint8_t sta_sap_scc_on_dfs_chnl_config_value;
 	bool ch_support_puncture;
+	bool is_sta_sap_scc;
+	bool sta_sap_scc_on_indoor_channel;
 
 	pSpectInfoParams->numSpectChans =
 		mac->scan.base_channels.numChannels;
@@ -442,6 +445,9 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle,
 	    ACS_DFS_MODE_DISABLE == sap_ctx->dfs_mode)
 		include_dfs_ch = false;
 
+	sta_sap_scc_on_indoor_channel =
+		policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(mac->psoc);
+
 	/* Fill the channel number in the spectrum in the operating freq band */
 	for (channelnum = 0;
 	     channelnum < pSpectInfoParams->numSpectChans;
@@ -501,6 +507,18 @@ static bool sap_chan_sel_init(mac_handle_t mac_handle,
 		if (wlan_reg_is_dsrc_freq(pSpectCh->chan_freq))
 			continue;
 
+		/* Skip indoor channels for non-scc indoor scenario*/
+		is_sta_sap_scc = policy_mgr_is_sta_sap_scc(mac->psoc,
+							   *pChans);
+		if (!(is_sta_sap_scc && sta_sap_scc_on_indoor_channel) &&
+		    !policy_mgr_sap_allowed_on_indoor_freq(mac->psoc,
+							   mac->pdev,
+							   *pChans)) {
+			sap_debug("Do not allow SAP on indoor frequency %u",
+				  *pChans);
+			continue;
+		}
+
 		/*
 		 * Skip the channels which are not in ACS config from user
 		 * space