Browse Source

Merge "qcacmn: CDP interface to deliver Tx mgmt frames"

Linux Build Service Account 5 years ago
parent
commit
e78475c89f

+ 0 - 2
dp/inc/cdp_txrx_cmn_struct.h

@@ -1447,12 +1447,10 @@ struct cdp_tx_indication_mpdu_info {
 
 /**
  * struct cdp_tx_indication_info - Tx capture information
- * @frame_payload: 802.11 payload is present already
  * @mpdu_info: Tx MPDU completion information
  * @mpdu_nbuf: reconstructed mpdu packet
  */
 struct cdp_tx_indication_info {
-	uint8_t frame_payload;
 	struct cdp_tx_indication_mpdu_info mpdu_info;
 	qdf_nbuf_t mpdu_nbuf;
 };

+ 24 - 0
dp/inc/cdp_txrx_mon.h

@@ -166,4 +166,28 @@ static inline void cdp_record_monitor_chan_num
 
 	soc->ops->mon_ops->txrx_monitor_record_channel(pdev, chan_num);
 }
+
+/**
+ * cdp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture
+ * @soc: Datapath SOC handle
+ * @pdev: Datapath PDEV handle
+ * @nbuf: Management frame buffer
+ */
+static inline void
+cdp_deliver_tx_mgmt(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
+		    qdf_nbuf_t nbuf)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance", __func__);
+		QDF_BUG(0);
+		return;
+	}
+
+	if (!soc->ops->mon_ops ||
+	    !soc->ops->mon_ops->txrx_deliver_tx_mgmt)
+		return;
+
+	soc->ops->mon_ops->txrx_deliver_tx_mgmt(pdev, nbuf);
+}
 #endif

+ 3 - 0
dp/inc/cdp_txrx_ops.h

@@ -752,6 +752,9 @@ struct cdp_mon_ops {
 
 	void (*txrx_monitor_record_channel)
 		(struct cdp_pdev *, int val);
+
+	void (*txrx_deliver_tx_mgmt)
+		(struct cdp_pdev *pdev, qdf_nbuf_t nbuf);
 };
 
 struct cdp_host_stats_ops {

+ 1 - 1
dp/wifi3.0/dp_htt.c

@@ -2691,7 +2691,7 @@ static void dp_process_ppdu_stats_user_compltn_flush_tlv(struct dp_pdev *pdev,
  *
  * return: void
  */
-static void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
+void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
 {
 	if (pdev->tx_sniffer_enable || pdev->mcopy_mode) {
 		dp_wdi_event_handler(WDI_EVENT_TX_MGMT_CTRL, pdev->soc,

+ 9 - 0
dp/wifi3.0/dp_internal.h

@@ -1361,6 +1361,15 @@ QDF_STATUS dp_tx_add_to_comp_queue(struct dp_soc *soc,
 }
 #endif
 
+#ifdef FEATURE_PERPKT_INFO
+void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf);
+#else
+static inline
+void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
+{
+}
+#endif
+
 /**
  * dp_vdev_to_cdp_vdev() - typecast dp vdev to cdp vdev
  * @vdev: DP vdev handle

+ 14 - 0
dp/wifi3.0/dp_main.c

@@ -6516,6 +6516,19 @@ void dp_pdev_set_monitor_channel(struct cdp_pdev *pdev_handle, int chan_num)
 	pdev->mon_chan_num = chan_num;
 }
 
+/**
+ * dp_deliver_tx_mgmt() - Deliver mgmt frame for tx capture
+ * @pdev_handle: Datapath PDEV handle
+ * @nbuf: Management frame buffer
+ */
+static void
+dp_deliver_tx_mgmt(struct cdp_pdev *pdev_handle, qdf_nbuf_t nbuf)
+{
+	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+
+	dp_deliver_mgmt_frm(pdev, nbuf);
+}
+
 /**
  * dp_get_pdev_id_frm_pdev() - get pdev_id
  * @pdev_handle: Datapath PDEV handle
@@ -9145,6 +9158,7 @@ static struct cdp_mon_ops dp_ops_mon = {
 	/* Added support for HK advance filter */
 	.txrx_set_advance_monitor_filter = dp_pdev_set_advance_monitor_filter,
 	.txrx_monitor_record_channel = dp_pdev_set_monitor_channel,
+	.txrx_deliver_tx_mgmt = dp_deliver_tx_mgmt,
 };
 
 static struct cdp_host_stats_ops dp_ops_host_stats = {

+ 124 - 0
target_if/spectral/target_if_spectral.c

@@ -3198,6 +3198,82 @@ target_if_is_aspectral_prohibited_by_adfs(struct wlan_objmgr_psoc *psoc,
 	}
 }
 
+/**
+ * target_if_get_curr_band() - Get current operating band of pdev
+ *
+ * @spectral: pointer to spectral object
+ *
+ * API to get current operating band of a given pdev.
+ *
+ * Return: if success enum band_info, BAND_UNKNOWN in case of failure
+ */
+static enum band_info
+target_if_get_curr_band(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_objmgr_vdev *vdev;
+	int16_t chan_freq;
+	enum band_info cur_band;
+	uint32_t chan_num;
+
+	if (!pdev) {
+		spectral_err("pdev is NULL");
+		return BAND_UNKNOWN;
+	}
+
+	vdev = wlan_objmgr_pdev_get_first_vdev(pdev, WLAN_SPECTRAL_ID);
+	if (!vdev) {
+		spectral_debug("vdev is NULL");
+		return BAND_UNKNOWN;
+	}
+	chan_freq = target_if_vdev_get_chan_freq(vdev);
+	chan_num = wlan_reg_freq_to_chan(pdev, chan_freq);
+	cur_band = wlan_reg_chan_to_band(chan_num);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_SPECTRAL_ID);
+
+	return cur_band;
+}
+
+/**
+ * target_if_is_agile_scan_active_in_5g() - Is Agile Spectral scan active on
+ * any of the 5G pdevs
+ * @psoc: Pointer to psoc
+ * @object: Pointer to pdev
+ * @arg: Pointer to flag which indicates whether Agile Spectral scan is in
+ *       progress in any 5G pdevs
+ *
+ * Return: void
+ */
+static void
+target_if_is_agile_scan_active_in_5g(struct wlan_objmgr_psoc *psoc,
+				     void *object, void *arg)
+{
+	enum band_info band;
+	bool *is_agile_scan_inprog_5g_pdev = arg;
+	struct target_if_spectral *spectral;
+	struct wlan_objmgr_pdev *cur_pdev = object;
+	struct target_if_spectral_ops *p_sops;
+
+	if (*is_agile_scan_inprog_5g_pdev)
+		return;
+
+	spectral = get_target_if_spectral_handle_from_pdev(cur_pdev);
+	if (!spectral) {
+		spectral_err("target if spectral handle is NULL");
+		return;
+	}
+	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
+
+	band = target_if_get_curr_band(cur_pdev);
+	if (band == BAND_UNKNOWN) {
+		spectral_debug("Failed to get current band");
+		return;
+	}
+
+	if (band == BAND_5G &&
+	    p_sops->is_spectral_active(spectral, SPECTRAL_SCAN_MODE_AGILE))
+		*is_agile_scan_inprog_5g_pdev = true;
+}
+
 QDF_STATUS
 target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
 			      const enum spectral_scan_mode smode,
@@ -3206,6 +3282,7 @@ target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
 	struct target_if_spectral_ops *p_sops;
 	struct target_if_spectral *spectral;
 	struct wlan_objmgr_psoc *psoc;
+	enum band_info band;
 
 	if (!err) {
 		spectral_err("Error code argument is null");
@@ -3237,6 +3314,53 @@ target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
 
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
 
+	band = target_if_get_curr_band(spectral->pdev_obj);
+	if (band == BAND_UNKNOWN) {
+		spectral_err("Failed to get current band");
+		return QDF_STATUS_E_FAILURE;
+	}
+	if ((band == BAND_5G) && (smode == SPECTRAL_SCAN_MODE_AGILE)) {
+		struct target_psoc_info *tgt_hdl;
+		enum wmi_host_hw_mode_config_type mode;
+		bool is_agile_scan_inprog_5g_pdev;
+
+		if (p_sops->is_spectral_active(spectral,
+					       SPECTRAL_SCAN_MODE_AGILE)) {
+			spectral_err("Agile Scan in progress in current pdev");
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
+		if (!tgt_hdl) {
+			target_if_err("target_psoc_info is null");
+			return QDF_STATUS_E_FAILURE;
+		}
+
+		mode = target_psoc_get_preferred_hw_mode(tgt_hdl);
+		switch (mode) {
+		case WMI_HOST_HW_MODE_SBS_PASSIVE:
+		case WMI_HOST_HW_MODE_SBS:
+		case WMI_HOST_HW_MODE_DBS_SBS:
+		case WMI_HOST_HW_MODE_DBS_OR_SBS:
+			is_agile_scan_inprog_5g_pdev = false;
+			wlan_objmgr_iterate_obj_list
+				(psoc, WLAN_PDEV_OP,
+				 target_if_is_agile_scan_active_in_5g,
+				 &is_agile_scan_inprog_5g_pdev, 0,
+				 WLAN_SPECTRAL_ID);
+			break;
+		default:
+			is_agile_scan_inprog_5g_pdev = false;
+			break;
+		}
+
+		if (is_agile_scan_inprog_5g_pdev) {
+			spectral_err("Agile Scan in progress in one of the SBS 5G pdev");
+			*err = SPECTRAL_SCAN_ERR_MODE_UNSUPPORTED;
+			return QDF_STATUS_E_FAILURE;
+		}
+	}
+
 	if (smode == SPECTRAL_SCAN_MODE_AGILE) {
 		bool is_aspectral_prohibited = false;
 		QDF_STATUS status;

+ 21 - 2
target_if/spectral/target_if_spectral.h

@@ -1274,10 +1274,19 @@ static inline
 struct target_if_spectral *get_target_if_spectral_handle_from_pdev(
 	struct wlan_objmgr_pdev *pdev)
 {
-	struct target_if_spectral *spectral = NULL;
-	struct wlan_objmgr_psoc *psoc = NULL;
+	struct target_if_spectral *spectral;
+	struct wlan_objmgr_psoc *psoc;
+
+	if (!pdev) {
+		spectral_err("pdev is null");
+		return NULL;
+	}
 
 	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc) {
+		spectral_err("psoc is null");
+		return NULL;
+	}
 
 	spectral = (struct target_if_spectral *)
 		psoc->soc_cb.rx_ops.sptrl_rx_ops.sptrlro_get_target_handle(
@@ -1416,6 +1425,11 @@ void target_if_spectral_set_rxchainmask(struct wlan_objmgr_pdev *pdev,
 	}
 
 	spectral = get_target_if_spectral_handle_from_pdev(pdev);
+	if (!spectral) {
+		spectral_err("Spectral target if object is null");
+		return;
+	}
+
 	/* set chainmask for all the modes */
 	for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
 		spectral->params[smode].ss_chn_mask = spectral_rx_chainmask;
@@ -1449,6 +1463,11 @@ void target_if_spectral_process_phyerr(
 	struct target_if_spectral_ops *p_sops = NULL;
 
 	spectral = get_target_if_spectral_handle_from_pdev(pdev);
+	if (!spectral) {
+		spectral_err("Spectral target if object is null");
+		return;
+	}
+
 	p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
 	p_sops->spectral_process_phyerr(spectral, data, datalen,
 					p_rfqual, p_chaninfo,

+ 47 - 3
umac/regulatory/core/src/reg_build_chan_list.c

@@ -542,8 +542,50 @@ static void reg_modify_chan_list_for_cached_channels(
 }
 #endif
 
-void reg_compute_pdev_current_chan_list(
-		struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj)
+#ifdef CONFIG_REG_CLIENT
+/**
+ * reg_modify_chan_list_for_srd_channels() - Modify SRD channels in ETSI13
+ * @pdev: Pointer to pdev object
+ * @chan_list: Current channel list
+ *
+ * This function converts SRD channels to passive in ETSI13 regulatory domain
+ * when enable_srd_chan_in_master_mode is not set.
+ */
+static void
+reg_modify_chan_list_for_srd_channels(struct wlan_objmgr_pdev *pdev,
+				      struct regulatory_channel *chan_list)
+{
+	enum channel_enum chan_enum;
+
+	if (!reg_is_etsi13_regdmn(pdev))
+		return;
+
+	if (reg_is_etsi13_srd_chan_allowed_master_mode(pdev))
+		return;
+
+	for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
+		if (chan_list[chan_enum].chan_flags & REGULATORY_CHAN_DISABLED)
+			continue;
+
+		if (reg_is_etsi13_srd_chan(pdev,
+					   chan_list[chan_enum].chan_num)) {
+			chan_list[chan_enum].state =
+				CHANNEL_STATE_DFS;
+			chan_list[chan_enum].chan_flags |=
+				REGULATORY_CHAN_NO_IR;
+		}
+	}
+}
+#else
+static inline void
+reg_modify_chan_list_for_srd_channels(struct wlan_objmgr_pdev *pdev,
+				      struct regulatory_channel *chan_list)
+{
+}
+#endif
+
+void reg_compute_pdev_current_chan_list(struct wlan_regulatory_pdev_priv_obj
+					*pdev_priv_obj)
 {
 	qdf_mem_copy(pdev_priv_obj->cur_chan_list, pdev_priv_obj->mas_chan_list,
 		     NUM_CHANNELS * sizeof(struct regulatory_channel));
@@ -571,6 +613,9 @@ void reg_compute_pdev_current_chan_list(
 					  pdev_priv_obj->en_chan_144);
 
 	reg_modify_chan_list_for_cached_channels(pdev_priv_obj);
+
+	reg_modify_chan_list_for_srd_channels(pdev_priv_obj->pdev_ptr,
+					      pdev_priv_obj->cur_chan_list);
 }
 
 void reg_reset_reg_rules(struct reg_rule_info *reg_rules)
@@ -907,7 +952,6 @@ QDF_STATUS reg_process_master_chan_list(
 	if (pdev) {
 		reg_propagate_mas_chan_list_to_pdev(psoc, pdev, &dir);
 		wlan_objmgr_pdev_release_ref(pdev, dbg_id);
-		reg_reset_reg_rules(reg_rules);
 	}
 
 	return QDF_STATUS_SUCCESS;

+ 12 - 3
umac/regulatory/core/src/reg_offload_11d_scan.c

@@ -367,6 +367,7 @@ QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc,
 	struct wlan_lmac_if_reg_tx_ops *tx_ops;
 	struct set_country country_code;
 	uint8_t pdev_id;
+	uint8_t ctr;
 
 	psoc_priv_obj = reg_get_psoc_obj(psoc);
 	if (!psoc_priv_obj) {
@@ -375,8 +376,14 @@ QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	pdev_id = psoc_priv_obj->def_pdev_id;
-	psoc_priv_obj->new_11d_ctry_pending[pdev_id] = true;
+	/*
+	 * Need firmware to send channel list event
+	 * for all phys. Therefore set pdev_id to 0xFF
+	 */
+	pdev_id = 0xFF;
+	for (ctr = 0; ctr < psoc_priv_obj->num_phy; ctr++)
+		psoc_priv_obj->new_11d_ctry_pending[ctr] = true;
+
 	qdf_mem_copy(country_code.country, country, REG_ALPHA2_LEN + 1);
 	country_code.pdev_id = pdev_id;
 
@@ -386,7 +393,9 @@ QDF_STATUS reg_save_new_11d_country(struct wlan_objmgr_psoc *psoc,
 			tx_ops->set_country_code(psoc, &country_code);
 		} else {
 			reg_err("country set handler is not present");
-			psoc_priv_obj->new_11d_ctry_pending[pdev_id] = false;
+			for (ctr = 0; ctr < psoc_priv_obj->num_phy; ctr++)
+				psoc_priv_obj->new_11d_ctry_pending[ctr] =
+					false;
 			return QDF_STATUS_E_FAULT;
 		}
 	}

+ 7 - 9
umac/regulatory/core/src/reg_priv_objs.c

@@ -91,9 +91,8 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 	soc_reg_obj->vdev_cnt_11d = 0;
 	soc_reg_obj->vdev_id_for_11d_scan = INVALID_VDEV_ID;
 	soc_reg_obj->restart_beaconing = CH_AVOID_RULE_RESTART;
-	soc_reg_obj->enable_srd_chan_in_master_mode = false;
+	soc_reg_obj->enable_srd_chan_in_master_mode = true;
 	soc_reg_obj->enable_11d_in_world_mode = false;
-	soc_reg_obj->def_pdev_id = -1;
 
 	for (i = 0; i < MAX_STA_VDEV_CNT; i++)
 		soc_reg_obj->vdev_ids_11d[i] = INVALID_VDEV_ID;
@@ -185,11 +184,6 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 		return QDF_STATUS_E_FAULT;
 	}
 
-	if (psoc_priv_obj->def_pdev_id == -1)
-		psoc_priv_obj->def_pdev_id = pdev_id;
-	else
-		reg_err("reg cannot handle more than one pdev");
-
 	pdev_priv_obj->pdev_ptr = pdev;
 	pdev_priv_obj->dfs_enabled = psoc_priv_obj->dfs_enabled;
 	pdev_priv_obj->set_fcc_channel = false;
@@ -236,8 +230,6 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 	reg_init_pdev_mas_chan_list(pdev_priv_obj,
 				    &psoc_priv_obj->mas_chan_params[pdev_id]);
 
-	reg_compute_pdev_current_chan_list(pdev_priv_obj);
-
 	psoc_reg_rules = &psoc_priv_obj->mas_chan_params[pdev_id].reg_rules;
 	reg_save_reg_rules_to_pdev(psoc_reg_rules, pdev_priv_obj);
 
@@ -249,6 +241,9 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 		qdf_mem_free(pdev_priv_obj);
 		return status;
 	}
+
+	reg_compute_pdev_current_chan_list(pdev_priv_obj);
+
 	if (!psoc_priv_obj->is_11d_offloaded)
 		reg_11d_host_scan_init(parent_psoc);
 
@@ -263,9 +258,12 @@ QDF_STATUS wlan_regulatory_pdev_obj_destroyed_notification(
 	QDF_STATUS status;
 	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
 	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+	uint32_t pdev_id;
 
 	pdev_priv_obj = reg_get_pdev_obj(pdev);
 
+	pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
+
 	if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) {
 		reg_err("reg pdev private obj is NULL");
 		return QDF_STATUS_E_FAILURE;

+ 0 - 2
umac/regulatory/core/src/reg_priv_objs.h

@@ -86,7 +86,6 @@ struct chan_change_cbk_entry {
  *	country update is pending for pdev (phy_id).
  * @world_country_pending: In this array, element[phy_id] is true if any world
  *	country update is pending for pdev (phy_id).
- * @def_pdev_id: Default pdev id, used in case of MCL
  */
 struct wlan_regulatory_psoc_priv_obj {
 	struct mas_chan_params mas_chan_params[PSOC_MAX_PHY_REG_CAP];
@@ -132,7 +131,6 @@ struct wlan_regulatory_psoc_priv_obj {
 	bool force_ssc_disable_indoor_channel;
 	bool enable_srd_chan_in_master_mode;
 	bool enable_11d_in_world_mode;
-	int8_t def_pdev_id;
 	qdf_spinlock_t cbk_list_lock;
 };
 

+ 23 - 18
umac/regulatory/core/src/reg_utils.c

@@ -953,13 +953,13 @@ void reg_reset_ctry_pending_hints(struct wlan_regulatory_psoc_priv_obj
 	}
 }
 
-QDF_STATUS reg_set_curr_country(
-		struct wlan_regulatory_psoc_priv_obj *soc_reg,
-		struct cur_regulatory_info *regulat_info,
-		struct wlan_lmac_if_reg_tx_ops *tx_ops)
+QDF_STATUS reg_set_curr_country(struct wlan_regulatory_psoc_priv_obj *soc_reg,
+				struct cur_regulatory_info *regulat_info,
+				struct wlan_lmac_if_reg_tx_ops *tx_ops)
 {
 	struct wlan_objmgr_psoc *psoc = regulat_info->psoc;
 	uint8_t pdev_id;
+	uint8_t phy_num;
 	struct set_country country_code;
 	QDF_STATUS status;
 
@@ -974,13 +974,19 @@ QDF_STATUS reg_set_curr_country(
 			  REG_ALPHA2_LEN)))
 		return QDF_STATUS_SUCCESS;
 
-	pdev_id = soc_reg->def_pdev_id;
-	if (soc_reg->cc_src == SOURCE_USERSPACE)
-		soc_reg->new_user_ctry_pending[pdev_id] = true;
-	else if (soc_reg->cc_src == SOURCE_11D)
-		soc_reg->new_11d_ctry_pending[pdev_id] = true;
-	else
-		soc_reg->world_country_pending[pdev_id] = true;
+	/*
+	 * Need firmware to send channel list event
+	 * for all phys. Therefore set pdev_id to 0xFF
+	 */
+	pdev_id = 0xFF;
+	for (phy_num = 0; phy_num < regulat_info->num_phy; phy_num++) {
+		if (soc_reg->cc_src == SOURCE_USERSPACE)
+			soc_reg->new_user_ctry_pending[phy_num] = true;
+		else if (soc_reg->cc_src == SOURCE_11D)
+			soc_reg->new_11d_ctry_pending[phy_num] = true;
+		else
+			soc_reg->world_country_pending[phy_num] = true;
+	}
 
 	qdf_mem_zero(&country_code, sizeof(country_code));
 	qdf_mem_copy(country_code.country, soc_reg->cur_country,
@@ -1013,7 +1019,7 @@ error:
 bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg,
 				struct cur_regulatory_info *regulat_info)
 {
-	uint8_t pdev_id;
+	uint8_t phy_num;
 
 	if (!soc_reg->offload_enabled)
 		return false;
@@ -1021,12 +1027,11 @@ bool reg_ignore_default_country(struct wlan_regulatory_psoc_priv_obj *soc_reg,
 	if (soc_reg->cc_src == SOURCE_UNKNOWN)
 		return false;
 
-	pdev_id = regulat_info->phy_id;
-
-	if (soc_reg->new_user_ctry_pending[pdev_id] ||
-	    soc_reg->new_init_ctry_pending[pdev_id] ||
-	    soc_reg->new_11d_ctry_pending[pdev_id] ||
-	    soc_reg->world_country_pending[pdev_id])
+	phy_num = regulat_info->phy_id;
+	if (soc_reg->new_user_ctry_pending[phy_num] ||
+	    soc_reg->new_init_ctry_pending[phy_num] ||
+	    soc_reg->new_11d_ctry_pending[phy_num] ||
+	    soc_reg->world_country_pending[phy_num])
 		return false;
 
 	return true;

+ 2 - 0
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -807,6 +807,8 @@ enum band_info wlan_reg_chan_to_band(uint32_t chan_num)
 	return reg_chan_to_band(chan_num);
 }
 
+qdf_export_symbol(wlan_reg_chan_to_band);
+
 /**
  * wlan_reg_get_chan_enum() - Get channel enum for given channel number
  * @chan_num: Channel number