Browse Source

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
Tushnim Bhattacharyya 7 years ago
parent
commit
518e80fc94
3 changed files with 29 additions and 2 deletions
  1. 10 1
      core/sap/src/sap_ch_select.c
  2. 18 0
      core/sme/inc/sme_api.h
  3. 1 1
      core/sme/src/common/sme_api.c

+ 10 - 1
core/sap/src/sap_ch_select.c

@@ -509,6 +509,13 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl,
 				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 @@ uint8_t sap_select_preferred_channel_from_channel_list(uint8_t best_chnl,
 
 	/* 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",

+ 18 - 0
core/sme/inc/sme_api.h

@@ -1662,6 +1662,15 @@ QDF_STATUS sme_get_peer_info_ext(tHalHandle hal,
 		void (*callbackfn)(struct sir_peer_info_ext_resp *param,
 			void *pcontext));
 
+/**
+ * sme_set_5g_band_pref() - sme api to set 5Ghz preference
+ * @hal: hal handle for getting global mac struct
+ * @pref_params: preference info request struct
+ *
+ * This function will set 5Ghz preference for STA connection
+ *
+ * Return: None
+ */
 void sme_set_5g_band_pref(tHalHandle hal_handle,
 			  struct sme_5g_band_pref_params *pref_params);
 
@@ -1695,4 +1704,13 @@ QDF_STATUS sme_get_chain_rssi(tHalHandle hal,
  * Return: QDF_STATUS_SUCCESS or non-zero on failure
  */
 QDF_STATUS sme_get_valid_channels(uint8_t *chan_list, uint32_t *list_len);
+
+/**
+ * sme_get_mac_context() - sme api to get the pmac context
+ *
+ * This function will return the pmac context
+ *
+ * Return: pointer to pmac context
+ */
+tpAniSirGlobal sme_get_mac_context(void);
 #endif /* #if !defined( __SME_API_H ) */

+ 1 - 1
core/sme/src/common/sme_api.c

@@ -120,7 +120,7 @@ QDF_STATUS sme_release_global_lock(tSmeStruct *psSme)
 	return status;
 }
 
-static tpAniSirGlobal sme_get_mac_context(void)
+tpAniSirGlobal sme_get_mac_context(void)
 {
 	tpAniSirGlobal mac_ctx;
 	tHalHandle h_hal;