Browse Source

qcacld-3.0: Move user configured SAP frequency to vdev

When MLO SAP is started with two different bands, the 2.4 GHz
link follows the 5GHz and restarts on the same channel
as 5 GHz link.

The user configured frequency for the SAP is cached on the
psoc, therefore during the concurrency check after bringing
up the second connection, 2.4 GHz link considers the new
user configured frequency of 5GHz link and moves to the same
channel.

Save the user configured frequency per vdev to prevent
cross-utilization.

Change-Id: I62f883bf818332bb7d0c838e6ed629a8f2d2f21b
CRs-Fixed: 3209394
Surya Prakash Sivaraj 2 years ago
parent
commit
19dd97f211

+ 11 - 8
components/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h

@@ -2236,6 +2236,7 @@ QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc,
  * @psoc: PSOC object information
  * @sap_ch_freq: sap current frequency in MHz
  * @intf_ch_freq: input/out interference channel frequency to sap
+ * @sap_vdev_id: SAP vdev id
  *
  * Gets the mandatory channel for SAP operation
  *
@@ -2244,7 +2245,8 @@ QDF_STATUS policy_mgr_get_nss_for_vdev(struct wlan_objmgr_psoc *psoc,
 QDF_STATUS
 policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc,
 				     uint32_t sap_ch_freq,
-				     uint32_t *intf_ch_freq);
+				     uint32_t *intf_ch_freq,
+				     uint8_t sap_vdev_id);
 
 /**
  * policy_mgr_set_sap_mandatory_channels() - Set the mandatory channel for SAP
@@ -3895,14 +3897,15 @@ bool policy_mgr_is_valid_for_channel_switch(struct wlan_objmgr_psoc *psoc,
 					    uint32_t ch_freq);
 
 /**
- * policy_mgr_update_user_config_sap_chan() - Update user configured channel
- * @psoc: poniter to psoc
- * @ch_freq: channel frequency to be upated
+ * policy_mgr_get_user_config_sap_freq() - Get the user configured channel
  *
- * Return: void
- **/
-void policy_mgr_update_user_config_sap_chan(struct wlan_objmgr_psoc *psoc,
-					    uint32_t ch_freq);
+ * @psoc: pointer to psoc
+ * @vdev_id: vdev id
+ *
+ * Return: user configured frequency
+ */
+qdf_freq_t policy_mgr_get_user_config_sap_freq(struct wlan_objmgr_psoc *psoc,
+					       uint8_t vdev_id);
 
 /**
  * policy_mgr_nan_sap_post_enable_conc_check() - Do concurrency operations

+ 27 - 20
components/cmn_services/policy_mgr/src/wlan_policy_mgr_action.c

@@ -1490,17 +1490,23 @@ policy_mgr_con_mode_by_vdev_id(struct wlan_objmgr_psoc *psoc,
 }
 
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
-void policy_mgr_update_user_config_sap_chan(
-			struct wlan_objmgr_psoc *psoc, uint32_t ch_freq)
+qdf_freq_t
+policy_mgr_get_user_config_sap_freq(struct wlan_objmgr_psoc *psoc,
+				    uint8_t vdev_id)
 {
-	struct policy_mgr_psoc_priv_obj *pm_ctx;
+	struct wlan_objmgr_vdev *vdev;
+	qdf_freq_t freq;
 
-	pm_ctx = policy_mgr_get_context(psoc);
-	if (!pm_ctx) {
-		policy_mgr_err("Invalid pm context and failed to update the user config sap channel");
-		return;
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, vdev_id,
+						    WLAN_POLICY_MGR_ID);
+	if (!vdev) {
+		policy_mgr_err("vdev is NULL");
+		return 0;
 	}
-	pm_ctx->user_config_sap_ch_freq = ch_freq;
+	freq = wlan_get_sap_user_config_freq(vdev);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_POLICY_MGR_ID);
+
+	return freq;
 }
 
 /**
@@ -1598,6 +1604,7 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
 	uint8_t num_cxn_del = 0;
 	QDF_STATUS status;
 	uint32_t sta_gc_present = 0;
+	qdf_freq_t user_config_freq = 0;
 
 	if (intf_ch_freq)
 		*intf_ch_freq = 0;
@@ -1630,12 +1637,15 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
 							  PM_P2P_CLIENT_MODE,
 							  NULL);
 
-
 	for (i = 0 ; i < cc_count; i++) {
 		if (sap_vdev_id != INVALID_VDEV_ID &&
 		    sap_vdev_id != vdev_id[i])
 			continue;
 
+		sap_vdev_id = vdev_id[i];
+		user_config_freq =
+			policy_mgr_get_user_config_sap_freq(psoc, sap_vdev_id);
+
 		if (policy_mgr_is_any_mode_active_on_band_along_with_session(
 				psoc,  vdev_id[i],
 				WLAN_REG_IS_24GHZ_CH_FREQ(op_ch_freq_list[i]) ?
@@ -1647,7 +1657,6 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
 		     wlan_reg_is_dfs_for_freq(pm_ctx->pdev,
 					      op_ch_freq_list[i]) &&
 		     pm_ctx->last_disconn_sta_freq == op_ch_freq_list[i]) {
-			sap_vdev_id = vdev_id[i];
 			curr_sap_freq = op_ch_freq_list[i];
 			policy_mgr_debug("sta_sap_scc_on_dfs_chan %u, sta_sap_scc_on_dfs_chnl_config_value %u, dfs sap_ch_freq %u",
 					 sta_sap_scc_on_dfs_chan,
@@ -1659,7 +1668,6 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
 		if (sta_sap_scc_on_lte_coex_chan &&
 		    !policy_mgr_is_safe_channel(psoc, op_ch_freq_list[i]) &&
 		    pm_ctx->last_disconn_sta_freq == op_ch_freq_list[i]) {
-			sap_vdev_id = vdev_id[i];
 			curr_sap_freq = op_ch_freq_list[i];
 			policy_mgr_debug("sta_sap_scc_on_lte_coex_chan %u unsafe sap_ch_freq %u",
 					 sta_sap_scc_on_lte_coex_chan,
@@ -1676,20 +1684,18 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
 		if (sta_sap_scc_on_indoor_channel &&
 		    wlan_reg_is_freq_indoor(pm_ctx->pdev, op_ch_freq_list[i]) &&
 		    pm_ctx->last_disconn_sta_freq == op_ch_freq_list[i]) {
-			sap_vdev_id = vdev_id[i];
 			curr_sap_freq = op_ch_freq_list[i];
 			policy_mgr_debug("indoor sap_ch_freq %u",
 					 curr_sap_freq);
 			break;
 		}
 
-		if (!sta_gc_present &&
+		if (!sta_gc_present && user_config_freq &&
 		    WLAN_REG_IS_24GHZ_CH_FREQ(op_ch_freq_list[i]) &&
-		    WLAN_REG_IS_5GHZ_CH_FREQ(pm_ctx->user_config_sap_ch_freq)) {
-			sap_vdev_id = vdev_id[i];
+		    WLAN_REG_IS_5GHZ_CH_FREQ(user_config_freq)) {
 			curr_sap_freq = op_ch_freq_list[i];
-			policy_mgr_debug("Indoor sap_ch_freq %u",
-					 curr_sap_freq);
+			policy_mgr_debug("Move sap to user configured freq: %d",
+					 user_config_freq);
 			break;
 		}
 	}
@@ -1704,9 +1710,8 @@ bool policy_mgr_is_sap_restart_required_after_sta_disconnect(
 	policy_mgr_store_and_del_conn_info_by_vdev_id(psoc, sap_vdev_id,
 						      &info, &num_cxn_del);
 
-
 	/* Add the user config ch as first condidate */
-	pcl_channels[0] = pm_ctx->user_config_sap_ch_freq;
+	pcl_channels[0] = user_config_freq;
 	pcl_weight[0] = 0;
 	status = policy_mgr_get_pcl(psoc, mode, &pcl_channels[1], &pcl_len,
 				    &pcl_weight[1],
@@ -2036,7 +2041,9 @@ void policy_mgr_nan_sap_post_disable_conc_check(struct wlan_objmgr_psoc *psoc)
 	sap_freq = policy_mgr_get_nondfs_preferred_channel(psoc, PM_SAP_MODE,
 							   false);
 	policy_mgr_debug("User/ACS orig Freq: %d New SAP Freq: %d",
-			 pm_ctx->user_config_sap_ch_freq, sap_freq);
+			 policy_mgr_get_user_config_sap_freq(
+						psoc, sap_info->vdev_id),
+			 sap_freq);
 	if (pm_ctx->hdd_cbacks.hdd_is_chan_switch_in_progress &&
 	    pm_ctx->hdd_cbacks.hdd_is_chan_switch_in_progress()) {
 		policy_mgr_debug("wait as channel switch is already in progress");

+ 12 - 16
components/cmn_services/policy_mgr/src/wlan_policy_mgr_core.c

@@ -2161,18 +2161,8 @@ void pm_dbs_opportunistic_timer_handler(void *data)
 				reason, POLICY_MGR_DEF_REQ_ID);
 }
 
-/**
- * policy_mgr_get_connection_for_vdev_id() - provides the
- * perticular connection with the requested vdev id
- * @vdev_id: vdev id of the connection
- *
- * This function provides the specific connection with the
- * requested vdev id
- *
- * Return: index in the connection table
- */
-static uint32_t policy_mgr_get_connection_for_vdev_id(
-		struct wlan_objmgr_psoc *psoc, uint32_t vdev_id)
+uint32_t policy_mgr_get_connection_for_vdev_id(struct wlan_objmgr_psoc *psoc,
+					       uint32_t vdev_id)
 {
 	uint32_t conn_index = 0;
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
@@ -4371,6 +4361,7 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
 	bool sbs_mlo_present = false;
 	bool allow_6ghz = true, sta_sap_scc_on_indoor_channel_allowed;
 	uint8_t sta_count;
+	qdf_freq_t user_config_freq;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
@@ -4431,20 +4422,24 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
 		     WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq)))) {
 			status = policy_mgr_get_sap_mandatory_channel(
 							psoc, sap_ch_freq,
-							intf_ch_freq);
+							intf_ch_freq, vdev_id);
 			if (QDF_IS_STATUS_SUCCESS(status))
 				return;
 
 			policy_mgr_err("No mandatory channels");
 		}
 
+		user_config_freq =
+			policy_mgr_get_user_config_sap_freq(psoc, vdev_id);
+
 		if (WLAN_REG_IS_24GHZ_CH_FREQ(sap_ch_freq) &&
-		    !WLAN_REG_IS_24GHZ_CH_FREQ(pm_ctx->user_config_sap_ch_freq) &&
+		    user_config_freq &&
+		    !WLAN_REG_IS_24GHZ_CH_FREQ(user_config_freq) &&
 		    (wlan_reg_get_channel_state_for_freq(pm_ctx->pdev,
 							 *intf_ch_freq) == CHANNEL_STATE_ENABLE)) {
 			status = policy_mgr_get_sap_mandatory_channel(
 							psoc, sap_ch_freq,
-							intf_ch_freq);
+							intf_ch_freq, vdev_id);
 			if (QDF_IS_STATUS_SUCCESS(status))
 				return;
 		}
@@ -4481,7 +4476,8 @@ void policy_mgr_check_scc_sbs_channel(struct wlan_objmgr_psoc *psoc,
 		/* Same band with Fav channel if STA is present */
 		status = policy_mgr_get_sap_mandatory_channel(psoc,
 							      sap_ch_freq,
-							      intf_ch_freq);
+							      intf_ch_freq,
+							      vdev_id);
 		if (QDF_IS_STATUS_SUCCESS(status))
 			return;
 

+ 6 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c

@@ -7944,6 +7944,7 @@ bool policy_mgr_is_restart_sap_required(struct wlan_objmgr_psoc *psoc,
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
 	struct policy_mgr_conc_connection_info *connection;
 	bool sta_sap_scc_on_dfs_chan, sta_sap_scc_allowed_on_indoor_ch;
+	qdf_freq_t user_config_freq;
 
 	pm_ctx = policy_mgr_get_context(psoc);
 	if (!pm_ctx) {
@@ -8020,15 +8021,18 @@ bool policy_mgr_is_restart_sap_required(struct wlan_objmgr_psoc *psoc,
 		 * Now SAP has to move to STA 5 GHz channel if SAP
 		 * was started on 5 GHz channel initialy.
 		 */
+		user_config_freq =
+			policy_mgr_get_user_config_sap_freq(psoc, vdev_id);
+
 		if (connection[i].freq != freq &&
 		    WLAN_REG_IS_24GHZ_CH_FREQ(freq) &&
 		    WLAN_REG_IS_5GHZ_CH_FREQ(connection[i].freq) &&
 		    !wlan_reg_is_dfs_for_freq(pm_ctx->pdev,
 					      connection[i].freq) &&
-		    WLAN_REG_IS_5GHZ_CH_FREQ(pm_ctx->user_config_sap_ch_freq)) {
+		    WLAN_REG_IS_5GHZ_CH_FREQ(user_config_freq)) {
 			policy_mgr_debug("Move SAP from:%d to STA ch:%d  (sap start freq:%d)",
 					 freq, connection[i].freq,
-					 pm_ctx->user_config_sap_ch_freq);
+					 user_config_freq);
 			restart_required = true;
 
 			if (wlan_reg_is_freq_indoor(pm_ctx->pdev,

+ 13 - 2
components/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h

@@ -349,7 +349,6 @@ struct policy_mgr_cfg {
  *                               & FW HW mode
  * @channel_switch_complete_evt: qdf event for channel switch completion check
  * @mode_change_cb: Mode change callback
- * @user_config_sap_ch_freq: SAP channel freq configured by user application
  * @cfg: Policy manager config data
  * @dynamic_mcc_adaptive_sched: disable/enable mcc adaptive scheduler feature
  * @dynamic_dfs_master_disabled: current state of dynamic dfs master
@@ -391,7 +390,6 @@ struct policy_mgr_psoc_priv_obj {
 	qdf_event_t opportunistic_update_done_evt;
 	qdf_event_t channel_switch_complete_evt;
 	send_mode_change_event_cb mode_change_cb;
-	uint32_t user_config_sap_ch_freq;
 	struct policy_mgr_cfg cfg;
 	uint32_t valid_ch_freq_list[NUM_CHANNELS];
 	uint32_t valid_ch_freq_list_count;
@@ -889,4 +887,17 @@ bool policy_mgr_is_concurrency_allowed(struct wlan_objmgr_psoc *psoc,
  */
 bool policy_mgr_2_freq_same_mac_in_sbs(struct policy_mgr_psoc_priv_obj *pm_ctx,
 				       qdf_freq_t freq_1, qdf_freq_t freq_2);
+
+/**
+ * policy_mgr_get_connection_for_vdev_id() - provides the
+ * particular connection with the requested vdev id
+ * @vdev_id: vdev id of the connection
+ *
+ * This function provides the specific connection with the
+ * requested vdev id
+ *
+ * Return: index in the connection table
+ */
+uint32_t policy_mgr_get_connection_for_vdev_id(struct wlan_objmgr_psoc *psoc,
+					       uint32_t vdev_id);
 #endif

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

@@ -3184,13 +3184,15 @@ update_pcl:
 QDF_STATUS
 policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc,
 				     uint32_t sap_ch_freq,
-				     uint32_t *intf_ch_freq)
+				     uint32_t *intf_ch_freq,
+				     uint8_t vdev_id)
 {
 	struct policy_mgr_psoc_priv_obj *pm_ctx;
 	QDF_STATUS status;
 	struct policy_mgr_pcl_list pcl;
 	uint32_t i;
 	uint32_t sap_new_freq;
+	qdf_freq_t user_config_freq = 0;
 	bool sta_sap_scc_on_indoor_channel =
 		 policy_mgr_get_sta_sap_scc_allowed_on_indoor_chnl(psoc);
 
@@ -3276,6 +3278,8 @@ policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc,
 	}
 
 	sap_new_freq = pcl.pcl_list[0];
+	user_config_freq = policy_mgr_get_user_config_sap_freq(psoc, vdev_id);
+
 	for (i = 0; i < pcl.pcl_len; i++) {
 		/* When sta_sap_scc_on_indoor_channel is enabled,
 		 * and if pcl contains SCC channel, then STA must
@@ -3290,7 +3294,7 @@ policy_mgr_get_sap_mandatory_channel(struct wlan_objmgr_psoc *psoc,
 			goto update_freq;
 		}
 
-		if (pcl.pcl_list[i] ==  pm_ctx->user_config_sap_ch_freq) {
+		if (user_config_freq && (pcl.pcl_list[i] == user_config_freq)) {
 			sap_new_freq = pcl.pcl_list[i];
 			policy_mgr_debug("Prefer starting SAP on user configured channel:%d",
 					 sap_ch_freq);

+ 33 - 0
components/mlme/core/inc/wlan_mlme_main.h

@@ -400,6 +400,15 @@ struct wait_for_key_timer {
 	qdf_mc_timer_t timer;
 };
 
+/**
+ * struct mlme_ap_config - VDEV MLME legacy private SAP
+ * related configurations
+ * @user_config_sap_ch_freq : Frequency from userspace to start SAP
+ */
+struct mlme_ap_config {
+	qdf_freq_t user_config_sap_ch_freq;
+};
+
 /**
  * struct mlme_legacy_priv - VDEV MLME legacy priv object
  * @chan_switch_in_progress: flag to indicate that channel switch is in progress
@@ -444,6 +453,7 @@ struct wait_for_key_timer {
  * @max_mcs_index: Max supported mcs index of vdev
  * @vdev_traffic_type: to set if vdev is LOW_LATENCY or HIGH_TPUT
  * @country_ie_for_all_band: take all band channel info in country ie
+ * @mlme_ap: SAP related vdev private configurations
  */
 struct mlme_legacy_priv {
 	bool chan_switch_in_progress;
@@ -493,6 +503,7 @@ struct mlme_legacy_priv {
 #endif
 	uint8_t vdev_traffic_type;
 	bool country_ie_for_all_band;
+	struct mlme_ap_config mlme_ap;
 };
 
 /**
@@ -1154,4 +1165,26 @@ void wlan_acquire_peer_key_wakelock(struct wlan_objmgr_pdev *pdev,
  */
 void wlan_release_peer_key_wakelock(struct wlan_objmgr_pdev *pdev,
 				    uint8_t *mac_addr);
+
+/**
+ * wlan_get_sap_user_config_freq() - Get the user configured frequency
+ *
+ * @vdev: pointer to vdev
+ *
+ * Return: User configured sap frequency.
+ */
+qdf_freq_t
+wlan_get_sap_user_config_freq(struct wlan_objmgr_vdev *vdev);
+
+/**
+ * wlan_set_sap_user_config_freq() - Set the user configured frequency
+ *
+ * @vdev: pointer to vdev
+ * @freq: user configured SAP frequency
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS
+wlan_set_sap_user_config_freq(struct wlan_objmgr_vdev *vdev,
+			      qdf_freq_t freq);
 #endif

+ 44 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -3975,3 +3975,47 @@ QDF_STATUS wlan_mlme_get_mac_vdev_id(struct wlan_objmgr_pdev *pdev,
 
 	return QDF_STATUS_SUCCESS;
 }
+
+qdf_freq_t
+wlan_get_sap_user_config_freq(struct wlan_objmgr_vdev *vdev)
+{
+	struct mlme_legacy_priv *mlme_priv;
+	enum QDF_OPMODE opmode = QDF_MAX_NO_OF_MODE;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return 0;
+	}
+
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (opmode != QDF_SAP_MODE && opmode != QDF_P2P_GO_MODE) {
+		mlme_debug("Cannot get user config freq for mode %d", opmode);
+		return 0;
+	}
+
+	return mlme_priv->mlme_ap.user_config_sap_ch_freq;
+}
+
+QDF_STATUS
+wlan_set_sap_user_config_freq(struct wlan_objmgr_vdev *vdev,
+			      qdf_freq_t freq)
+{
+	struct mlme_legacy_priv *mlme_priv;
+	enum QDF_OPMODE opmode = QDF_MAX_NO_OF_MODE;
+
+	mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
+	if (!mlme_priv) {
+		mlme_legacy_err("vdev legacy private object is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (opmode != QDF_SAP_MODE && opmode != QDF_P2P_GO_MODE) {
+		mlme_debug("Cannot set user config freq for mode %d", opmode);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	mlme_priv->mlme_ap.user_config_sap_ch_freq = freq;
+	return QDF_STATUS_SUCCESS;
+}

+ 5 - 2
core/hdd/src/wlan_hdd_hostapd.c

@@ -5790,6 +5790,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 	enum reg_phymode reg_phy_mode, updated_phy_mode;
 	struct sap_context *sap_ctx;
 	struct wlan_objmgr_vdev *vdev;
+	uint32_t user_config_freq = 0;
 
 	hdd_enter();
 
@@ -5858,6 +5859,8 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 		goto free;
 	}
 
+	user_config_freq = config->chan_freq;
+
 	if (QDF_STATUS_SUCCESS !=
 	    ucfg_policy_mgr_get_indoor_chnl_marking(hdd_ctx->psoc,
 						    &indoor_chnl_marking))
@@ -5914,8 +5917,6 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 		config->acs_dfs_mode = wlan_hdd_get_dfs_mode(mode);
 	}
 
-	policy_mgr_update_user_config_sap_chan(hdd_ctx->psoc,
-					       config->chan_freq);
 	ucfg_policy_mgr_get_mcc_scc_switch(hdd_ctx->psoc, &mcc_to_scc_switch);
 
 	if (adapter->device_mode == QDF_SAP_MODE ||
@@ -6460,6 +6461,7 @@ int wlan_hdd_cfg80211_start_bss(struct hdd_adapter *adapter,
 
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    true);
+		wlan_set_sap_user_config_freq(vdev, user_config_freq);
 	}
 
 	wlan_hdd_dhcp_offload_enable(hdd_ctx, adapter);
@@ -6655,6 +6657,7 @@ static int __wlan_hdd_cfg80211_stop_ap(struct wiphy *wiphy,
 		hdd_green_ap_start_state_mc(hdd_ctx, adapter->device_mode,
 					    false);
 		wlan_twt_concurrency_update(hdd_ctx);
+		wlan_set_sap_user_config_freq(adapter->vdev, 0);
 		status = ucfg_if_mgr_deliver_event(adapter->vdev,
 				WLAN_IF_MGR_EV_AP_STOP_BSS_COMPLETE,
 				NULL);

+ 3 - 1
core/mac/src/pe/lim/lim_session.c

@@ -1005,8 +1005,10 @@ void pe_delete_session(struct mac_context *mac_ctx, struct pe_session *session)
 
 	session->access_policy_vendor_ie = NULL;
 
-	if (LIM_IS_AP_ROLE(session))
+	if (LIM_IS_AP_ROLE(session)) {
 		lim_check_and_reset_protection_params(mac_ctx);
+		wlan_set_sap_user_config_freq(session->vdev, 0);
+	}
 
 	session->user_edca_set = 0;
 

+ 1 - 1
core/sme/src/csr/csr_util.c

@@ -721,7 +721,7 @@ uint16_t csr_check_concurrent_channel_overlap(struct mac_context *mac_ctx,
 			status =
 				policy_mgr_get_sap_mandatory_channel(
 					mac_ctx->psoc, sap_ch_freq,
-					&intf_ch_freq);
+					&intf_ch_freq, vdev_id);
 			if (QDF_IS_STATUS_ERROR(status))
 				sme_err("no mandatory channel");
 		}