Browse Source

qcacld-3.0: Change SAP related APIs to use secondary channel list

In any start BSS or ACS related function, change the calls to regulatory
to access the secondary channel list instead. This list will hold the
VLP channels specifically for any beaconing modes. This allows a client
and an AP to operate simultaneously on different power modes.

Change-Id: Ic06b408ebcc78292d84f1f035c00bf39a23de3ca
CRs-fixed: 2944484
Lincoln Tran 3 years ago
parent
commit
8b2cd2c24d

+ 0 - 8
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -2001,14 +2001,6 @@ QDF_STATUS policy_mgr_decr_active_session(struct wlan_objmgr_psoc *psoc,
 			pm_ctx->dp_cbacks.hdd_disable_rx_ol_in_concurrency(false);
 	};
 
-	if ((mode == QDF_SAP_MODE || mode == QDF_P2P_GO_MODE) &&
-	    (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE,
-						       NULL) == 0) &&
-	    (policy_mgr_mode_specific_connection_count(psoc, PM_P2P_GO_MODE,
-						       NULL) == 0))
-		wlan_reg_set_ap_pwr_and_update_chan_list(pm_ctx->pdev,
-							 REG_INDOOR_AP);
-
 	/* Disable RPS if SAP interface has come up */
 	if (policy_mgr_mode_specific_connection_count(psoc, PM_SAP_MODE, NULL)
 		== 0) {

+ 18 - 6
components/cmn_services/policy_mgr/src/wlan_policy_mgr_pcl.c

@@ -225,6 +225,7 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc,
  * policy_mgr_update_valid_ch_freq_list() - Update policy manager valid ch list
  * @pm_ctx: policy manager context data
  * @ch_list: Regulatory channel list
+ * @is_client: true if caller is a client, false if it is a beaconing entity
  *
  * When regulatory component channel list is updated this internal function is
  * called to update policy manager copy of valid channel list.
@@ -233,14 +234,21 @@ void policy_mgr_decr_session_set_pcl(struct wlan_objmgr_psoc *psoc,
  */
 static void
 policy_mgr_update_valid_ch_freq_list(struct policy_mgr_psoc_priv_obj *pm_ctx,
-				     struct regulatory_channel *reg_ch_list)
+				     struct regulatory_channel *reg_ch_list,
+				     bool is_client)
 {
 	uint32_t i, j = 0, ch_freq;
 	enum channel_state state;
 
 	for (i = 0; i < NUM_CHANNELS; i++) {
 		ch_freq = reg_ch_list[i].center_freq;
-		state = wlan_reg_get_channel_state_for_freq(pm_ctx->pdev, ch_freq);
+		if (is_client)
+			state = wlan_reg_get_channel_state_for_freq(
+							pm_ctx->pdev, ch_freq);
+		else
+			state =
+			wlan_reg_get_channel_state_from_secondary_list_for_freq(
+							pm_ctx->pdev, ch_freq);
 
 		if (state != CHANNEL_STATE_DISABLE &&
 		    state != CHANNEL_STATE_INVALID) {
@@ -268,7 +276,8 @@ policy_mgr_reg_chan_change_callback(struct wlan_objmgr_psoc *psoc,
 		return;
 	}
 
-	policy_mgr_update_valid_ch_freq_list(pm_ctx, chan_list);
+	wlan_reg_decide_6g_ap_pwr_type(pdev);
+	policy_mgr_update_valid_ch_freq_list(pm_ctx, chan_list, false);
 
 	if (!avoid_freq_ind) {
 		policy_mgr_debug("avoid_freq_ind NULL");
@@ -571,7 +580,9 @@ static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_dfs(
 	}
 
 	for (i = 0; i < *pcl_len_org; i++) {
-		if (!wlan_reg_is_dfs_for_freq(pm_ctx->pdev, pcl_list_org[i])) {
+		if (!wlan_reg_is_dfs_in_secondary_list_for_freq(
+							pm_ctx->pdev,
+							pcl_list_org[i])) {
 			pcl_list_org[pcl_len] = pcl_list_org[i];
 			weight_list_org[pcl_len++] = weight_list_org[i];
 		}
@@ -604,7 +615,7 @@ static QDF_STATUS policy_mgr_modify_sap_pcl_based_on_nol(
 	}
 
 	for (i = 0; i < *pcl_len_org; i++) {
-		if (!wlan_reg_is_disable_for_freq(
+		if (!wlan_reg_is_disable_in_secondary_list_for_freq(
 		    pm_ctx->pdev, pcl_list_org[i])) {
 			pcl_list[pcl_len] = pcl_list_org[i];
 			weight_list[pcl_len++] = weight_list_org[i];
@@ -704,7 +715,8 @@ policy_mgr_modify_pcl_based_on_indoor(struct wlan_objmgr_psoc *psoc,
 	}
 
 	for (i = 0; i < *pcl_len_org; i++) {
-		if (wlan_reg_is_freq_indoor(pm_ctx->pdev, pcl_list_org[i]))
+		if (wlan_reg_is_freq_indoor_in_secondary_list(pm_ctx->pdev,
+							      pcl_list_org[i]))
 			continue;
 		pcl_list[pcl_len] = pcl_list_org[i];
 		weight_list[pcl_len++] = weight_list_org[i];

+ 2 - 2
core/hdd/src/wlan_hdd_cfg80211.c

@@ -5783,7 +5783,7 @@ static bool wlan_hdd_check_dfs_channel_for_adapter(struct hdd_context *hdd_ctx,
 			 *  radios !!
 			 */
 			if (CHANNEL_STATE_DFS ==
-			    wlan_reg_get_channel_state_for_freq(
+			    wlan_reg_get_channel_state_from_secondary_list_for_freq(
 				hdd_ctx->pdev,
 				ap_ctx->operating_chan_freq)) {
 				hdd_err("SAP running on DFS channel");
@@ -17375,7 +17375,7 @@ QDF_STATUS wlan_hdd_validate_operation_channel(struct hdd_adapter *adapter,
 		if (!cur_chan_list)
 			return QDF_STATUS_E_NOMEM;
 
-		if (wlan_reg_get_current_chan_list(
+		if (wlan_reg_get_secondary_current_chan_list(
 		    hdd_ctx->pdev, cur_chan_list) != QDF_STATUS_SUCCESS) {
 			qdf_mem_free(cur_chan_list);
 			return QDF_STATUS_E_INVAL;

+ 11 - 7
core/hdd/src/wlan_hdd_hostapd.c

@@ -1910,7 +1910,7 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 
 		/* DFS requirement: DO NOT transmit during CAC. */
 		if (CHANNEL_STATE_DFS !=
-		    wlan_reg_get_channel_state_for_freq(
+		    wlan_reg_get_channel_state_from_secondary_list_for_freq(
 			hdd_ctx->pdev, ap_ctx->operating_chan_freq) ||
 			ignoreCAC ||
 			(hdd_ctx->dev_dfs_cac_status ==
@@ -2707,7 +2707,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
 		wlan_hdd_enable_roaming(adapter,
 					RSO_SAP_CHANNEL_CHANGE);
 		if (CHANNEL_STATE_DFS !=
-		    wlan_reg_get_channel_state_for_freq(hdd_ctx->pdev,
+		    wlan_reg_get_channel_state_from_secondary_list_for_freq(
+						hdd_ctx->pdev,
 						ap_ctx->operating_chan_freq))
 			ap_ctx->dfs_cac_block_tx = false;
 
@@ -5033,7 +5034,7 @@ int wlan_hdd_disable_channels(struct hdd_context *hdd_ctx)
 		 * the channels
 		 */
 		cache_chann->channel_info[i].reg_status =
-					wlan_reg_get_channel_state_for_freq(
+			wlan_reg_get_channel_state_from_secondary_list_for_freq(
 							hdd_ctx->pdev,
 							freq);
 		cache_chann->channel_info[i].wiphy_status =
@@ -5419,8 +5420,9 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 		/* reject SAP if DFS channel scan is not allowed */
 		if (!(enable_dfs_scan) &&
 		    (CHANNEL_STATE_DFS ==
-		     wlan_reg_get_channel_state_for_freq(hdd_ctx->pdev,
-							 config->chan_freq))) {
+		     wlan_reg_get_channel_state_from_secondary_list_for_freq(
+							hdd_ctx->pdev,
+							config->chan_freq))) {
 			hdd_err("No SAP start on DFS channel");
 			ret = -EOPNOTSUPP;
 			goto error;
@@ -6607,8 +6609,10 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
 		enum phy_ch_width sub_20_ch_width = CH_WIDTH_INVALID;
 		struct sap_config *sap_cfg = &adapter->session.ap.sap_config;
 
-		if (CHANNEL_STATE_DFS == wlan_reg_get_channel_state_for_freq(
-					hdd_ctx->pdev, freq)) {
+		if (CHANNEL_STATE_DFS ==
+		    wlan_reg_get_channel_state_from_secondary_list_for_freq(
+								hdd_ctx->pdev,
+								freq)) {
 			hdd_err("Can't start SAP-DFS (channel=%d)with sub 20 MHz ch wd",
 				freq);
 			return -EINVAL;