Преглед на файлове

qcacmn: Populate the current channel list by pdev

The current channel list needs to be maintained at pdev level.
Compute the current channel list when a pdev is created.

Change-Id: I4922c2d2f9145fb5acfd694f7d2d364af8e676fa
CRs-Fixed: 2002892
Amar Singhal преди 8 години
родител
ревизия
1b8762f7a6

+ 12 - 2
umac/regulatory/core/src/reg_priv.h

@@ -56,13 +56,23 @@ struct wlan_regulatory_psoc_priv_obj {
 	uint32_t phybitmap;
 	enum dfs_reg dfs_region;
 	char country_11d[REG_ALPHA2_LEN + 1];
-	bool dfs_disable;
+	bool dfs_disabled;
 	bool set_fcc_channel;
 	enum band_info band_capability;
-	bool indoor_ch_enabled;
+	bool indoor_chan_enabled;
 	bool enable_11d_supp_original;
 	bool enable_11d_supp_current;
 	bool userspace_country_priority;
 };
 
+struct wlan_regulatory_pdev_priv_obj {
+	struct regulatory_channel cur_chan_list[NUM_CHANNELS];
+	enum channel_enum nol_list[NUM_CHANNELS];
+	struct wlan_objmgr_pdev *pdev_ptr;
+	bool dfs_disabled;
+	bool set_fcc_channel;
+	enum band_info band_capability;
+	bool indoor_chan_enabled;
+};
+
 #endif

+ 304 - 13
umac/regulatory/core/src/reg_services.c

@@ -33,6 +33,8 @@
 #include "reg_services.h"
 #include "reg_priv.h"
 
+#define MAX_PWR_FCC_CHAN_12 8
+#define MAX_PWR_FCC_CHAN_13 2
 
 const struct bonded_channel bonded_chan_40mhz_list[] = {
 	{36, 40},
@@ -89,6 +91,15 @@ const struct chan_map channel_map[NUM_CHANNELS] = {
 	[CHAN_ENUM_13] = {2472, 13},
 	[CHAN_ENUM_14] = {2484, 14},
 
+	[CHAN_ENUM_183] = {4915, 183},
+	[CHAN_ENUM_184] = {4920, 184},
+	[CHAN_ENUM_185] = {4925, 185},
+	[CHAN_ENUM_187] = {4935, 187},
+	[CHAN_ENUM_188] = {4940, 188},
+	[CHAN_ENUM_189] = {4945, 189},
+	[CHAN_ENUM_192] = {4960, 192},
+	[CHAN_ENUM_196] = {4980, 196},
+
 	[CHAN_ENUM_36] = {5180, 36},
 	[CHAN_ENUM_40] = {5200, 40},
 	[CHAN_ENUM_44] = {5220, 44},
@@ -117,14 +128,6 @@ const struct chan_map channel_map[NUM_CHANNELS] = {
 	[CHAN_ENUM_161] = {5805, 161},
 	[CHAN_ENUM_165] = {5825, 165},
 
-	[CHAN_ENUM_183] = {4915, 183},
-	[CHAN_ENUM_184] = {4920, 184},
-	[CHAN_ENUM_185] = {4925, 185},
-	[CHAN_ENUM_187] = {4935, 187},
-	[CHAN_ENUM_188] = {4940, 188},
-	[CHAN_ENUM_189] = {4945, 189},
-	[CHAN_ENUM_192] = {4960, 192},
-	[CHAN_ENUM_196] = {4980, 196},
 };
 
 /**
@@ -145,6 +148,7 @@ QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_psoc *psoc,
 		reg_err("chan_list or num_ch is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
+
 	soc_reg = (struct wlan_regulatory_psoc_priv_obj *)
 		wlan_objmgr_psoc_get_comp_private_obj(psoc,
 				WLAN_UMAC_COMP_REGULATORY);
@@ -716,7 +720,7 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
 	uint16_t min_bw_2g, max_bw_2g, min_bw_5g, max_bw_5g;
 	struct regulatory_channel *mas_chan_list, *cur_chan_list;
 
-	reg_info("%s: process reg chan list", __func__);
+	reg_debug("process reg master chan list");
 
 	soc_reg = (struct wlan_regulatory_psoc_priv_obj *)
 		wlan_objmgr_psoc_get_comp_private_obj(regulat_info->psoc,
@@ -788,8 +792,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 	enum channel_enum chan_enum;
 	QDF_STATUS status;
 
-	soc_reg_obj =
-		qdf_mem_malloc(sizeof(*soc_reg_obj));
+	soc_reg_obj = qdf_mem_malloc(sizeof(*soc_reg_obj));
 
 	if (NULL == soc_reg_obj) {
 		reg_alert("Mem alloc failed for reg psoc priv obj");
@@ -798,6 +801,11 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 
 	soc_reg_obj->offload_enabled  = false;
 	soc_reg_obj->psoc_ptr = psoc;
+	soc_reg_obj->dfs_disabled = false;
+	soc_reg_obj->set_fcc_channel = false;
+	soc_reg_obj->band_capability = BAND_ALL;
+	soc_reg_obj->indoor_chan_enabled = true;
+
 
 	mas_chan_list = soc_reg_obj->master_ch_list;
 
@@ -832,7 +840,7 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
  *
  * Return: Success or Failure
  */
-QDF_STATUS  wlan_regulatory_psoc_obj_destroyed_notification(
+QDF_STATUS wlan_regulatory_psoc_obj_destroyed_notification(
 		struct wlan_objmgr_psoc *psoc, void *arg_list)
 {
 	QDF_STATUS status;
@@ -853,10 +861,293 @@ QDF_STATUS  wlan_regulatory_psoc_obj_destroyed_notification(
 	if (status != QDF_STATUS_SUCCESS)
 		reg_err("soc_reg private obj detach failed");
 
-	reg_debug("reg psoc obj deleted with status %d", status);
+	reg_debug("reg psoc obj detached with status %d", status);
 
 	qdf_mem_free(soc_reg);
 
 	return status;
 }
 
+static void
+modify_chan_list_for_dfs_channels(struct regulatory_channel *chan_list,
+				  bool dfs_disabled)
+{
+	enum channel_enum chan_enum;
+
+	if (!dfs_disabled)
+		return;
+
+	for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
+		if (CHANNEL_STATE_DFS ==
+		    chan_list[chan_enum].state) {
+			chan_list[chan_enum].state =
+				CHANNEL_STATE_DISABLE;
+			chan_list[chan_enum].chan_flags |=
+				REGULATORY_CHAN_DISABLED;
+		}
+	}
+}
+
+static void
+modify_chan_list_for_indoor_channels(struct regulatory_channel
+				     *chan_list,
+				     bool indoor_chan_enabled)
+{
+	enum channel_enum chan_enum;
+
+	if (indoor_chan_enabled)
+		return;
+
+	for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
+		if (REGULATORY_CHAN_INDOOR_ONLY &
+		    chan_list[chan_enum].chan_flags) {
+			chan_list[chan_enum].state =
+				CHANNEL_STATE_PASSIVE;
+			chan_list[chan_enum].chan_flags |=
+				REGULATORY_CHAN_NO_IR;
+		}
+	}
+}
+
+static void
+modify_chan_list_for_band(struct regulatory_channel
+			  *chan_list,
+			  enum band_info band_val)
+{
+	enum channel_enum chan_enum;
+
+	if (BAND_2G == band_val) {
+		for (chan_enum = CHAN_ENUM_36; chan_enum <= CHAN_ENUM_165;
+		     chan_enum++) {
+			chan_list[chan_enum].chan_flags |=
+				REGULATORY_CHAN_DISABLED;
+			chan_list[chan_enum].state =
+				CHANNEL_STATE_DISABLE;
+		}
+	}
+
+	if (BAND_5G == band_val) {
+		for (chan_enum = CHAN_ENUM_1; chan_enum <= CHAN_ENUM_14;
+		     chan_enum++) {
+			chan_list[chan_enum].chan_flags |=
+				REGULATORY_CHAN_DISABLED;
+			chan_list[chan_enum].state =
+				CHANNEL_STATE_DISABLE;
+		}
+	}
+}
+
+static void
+modify_chan_list_for_fcc_channel(struct regulatory_channel
+				 *chan_list,
+				 bool set_fcc_channel)
+{
+	if (set_fcc_channel) {
+		chan_list[CHAN_ENUM_12].tx_power = MAX_PWR_FCC_CHAN_12;
+		chan_list[CHAN_ENUM_13].tx_power = MAX_PWR_FCC_CHAN_13;
+	}
+}
+
+static void
+modify_chan_list_for_freq_range(struct regulatory_channel
+				*chan_list,
+				uint32_t low_freq_2g,
+				uint32_t high_freq_2g,
+				uint32_t low_freq_5g,
+				uint32_t high_freq_5g)
+{
+	enum channel_enum low_limit_2g = 0, high_limit_2g = 0,
+		low_limit_5g = 0, high_limit_5g = 0, chan_enum;
+	bool chan_in_range;
+
+	for (chan_enum = 0; chan_enum < NUM_CHANNELS && !low_limit_2g;
+	     chan_enum++) {
+		if ((chan_list[chan_enum].center_freq - 10) >=
+		    low_freq_2g)
+			low_limit_2g = chan_enum;
+	}
+
+	for (chan_enum = 0; chan_enum < NUM_CHANNELS && !low_limit_5g;
+	     chan_enum++) {
+		if ((chan_list[chan_enum].center_freq - 10) >=
+		    low_freq_5g)
+			low_limit_5g = chan_enum;
+	}
+
+	for (chan_enum = NUM_CHANNELS - 1; chan_enum >= 0 &&
+		     !high_limit_2g; chan_enum--) {
+		if (chan_list[chan_enum].center_freq + 10 <=
+		    high_freq_2g)
+			high_limit_2g = chan_enum;
+	}
+
+	for (chan_enum = NUM_CHANNELS - 1; chan_enum >= 0 &&
+		     !high_limit_5g; chan_enum--) {
+		if (chan_list[chan_enum].center_freq + 10 <=
+		    high_freq_5g)
+			high_limit_5g = chan_enum;
+	}
+
+	for (chan_enum = 0; chan_enum < NUM_CHANNELS; chan_enum++) {
+		chan_in_range = false;
+		if  ((low_limit_2g <= chan_enum) &&
+		     (high_limit_2g >= chan_enum))
+			chan_in_range = true;
+		if  ((low_limit_5g <= chan_enum) &&
+		     (high_limit_5g >= chan_enum))
+			chan_in_range = true;
+		if (!chan_in_range) {
+			chan_list[chan_enum].chan_flags |=
+				REGULATORY_CHAN_DISABLED;
+			chan_list[chan_enum].state =
+				CHANNEL_STATE_DISABLE;
+		}
+	}
+}
+
+/**
+ * wlan_regulatory_pdev_obj_created_notification() - PDEV obj create callback
+ * @pdev: pdev object
+ * @arg_list: Variable argument list
+ *
+ * This callback is registered with object manager during initialization to
+ * get notified when the pdev object is created.
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
+	struct wlan_objmgr_pdev *pdev, void *arg_list)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+	struct wlan_regulatory_psoc_priv_obj *psoc_priv_obj;
+	struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap_ptr;
+	struct wlan_objmgr_psoc *parent_psoc;
+	uint32_t pdev_id;
+	uint32_t cnt;
+	uint32_t range_2g_low, range_2g_high,
+		range_5g_low, range_5g_high;
+	QDF_STATUS status;
+
+	pdev_priv_obj = qdf_mem_malloc(sizeof(*pdev_priv_obj));
+	if (NULL == pdev_priv_obj) {
+		reg_alert("Mem alloc failed for pdev priv obj");
+		return QDF_STATUS_E_NOMEM;
+	}
+
+	parent_psoc = wlan_pdev_get_psoc(pdev);
+	pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev);
+
+	psoc_priv_obj = (struct wlan_regulatory_psoc_priv_obj *)
+		wlan_objmgr_psoc_get_comp_private_obj(parent_psoc,
+				     WLAN_UMAC_COMP_REGULATORY);
+
+	if (NULL == psoc_priv_obj) {
+		reg_err("reg psoc private obj is NULL");
+		return QDF_STATUS_E_FAULT;
+	}
+
+	pdev_priv_obj->pdev_ptr = pdev;
+	pdev_priv_obj->dfs_disabled = psoc_priv_obj->dfs_disabled;
+	pdev_priv_obj->set_fcc_channel = psoc_priv_obj->set_fcc_channel;
+	pdev_priv_obj->band_capability =  psoc_priv_obj->band_capability;
+	pdev_priv_obj->indoor_chan_enabled =
+		psoc_priv_obj->indoor_chan_enabled;
+
+	qdf_mem_copy(pdev_priv_obj->cur_chan_list,
+		     psoc_priv_obj->master_ch_list,
+		     NUM_CHANNELS * sizeof(struct regulatory_channel));
+
+	modify_chan_list_for_dfs_channels(pdev_priv_obj->cur_chan_list,
+					  pdev_priv_obj->dfs_disabled);
+
+	modify_chan_list_for_indoor_channels(pdev_priv_obj->cur_chan_list,
+					 pdev_priv_obj->indoor_chan_enabled);
+
+	modify_chan_list_for_band(pdev_priv_obj->cur_chan_list,
+				  pdev_priv_obj->band_capability);
+
+	modify_chan_list_for_fcc_channel(pdev_priv_obj->cur_chan_list,
+					 pdev_priv_obj->set_fcc_channel);
+
+	reg_cap_ptr = parent_psoc->ext_service_param.reg_cap;
+
+	for (cnt = 0; cnt < PSOC_MAX_PHY_REG_CAP; cnt++) {
+		if (pdev_id == reg_cap_ptr->phy_id)
+			break;
+		reg_cap_ptr++;
+	}
+
+	if (cnt == PSOC_MAX_PHY_REG_CAP) {
+		reg_err("extended capabilities not found for pdev");
+		return QDF_STATUS_E_FAULT;
+	}
+
+	range_2g_low = reg_cap_ptr->low_2ghz_chan;
+	range_2g_high = reg_cap_ptr->high_2ghz_chan;
+	range_5g_low = reg_cap_ptr->low_5ghz_chan;
+	range_5g_high = reg_cap_ptr->high_5ghz_chan;
+
+	modify_chan_list_for_freq_range(pdev_priv_obj->cur_chan_list,
+					range_2g_low, range_2g_high,
+					range_5g_low, range_5g_high);
+
+	status = wlan_objmgr_pdev_component_obj_attach(pdev,
+						     WLAN_UMAC_COMP_REGULATORY,
+						     pdev_priv_obj,
+						     QDF_STATUS_SUCCESS);
+
+	reg_debug("reg pdev obj created with status %d", status);
+
+	return status;
+}
+
+QDF_STATUS wlan_regulatory_pdev_obj_destroyed_notification(
+		struct wlan_objmgr_pdev *pdev, void *arg_list)
+{
+	QDF_STATUS status;
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	pdev_priv_obj =	wlan_objmgr_pdev_get_comp_private_obj(pdev,
+				WLAN_UMAC_COMP_REGULATORY);
+
+	if (NULL == pdev_priv_obj) {
+		reg_err("reg pdev private obj is NULL");
+		return QDF_STATUS_E_FAULT;
+	}
+
+	pdev_priv_obj->pdev_ptr = NULL;
+
+	status = wlan_objmgr_pdev_component_obj_detach(pdev,
+			WLAN_UMAC_COMP_REGULATORY,
+			pdev_priv_obj);
+
+	if (status != QDF_STATUS_SUCCESS)
+		reg_err("reg pdev private obj detach failed");
+
+	reg_debug("reg pdev obj deleted with status %d", status);
+
+	qdf_mem_free(pdev_priv_obj);
+
+	return status;
+}
+
+QDF_STATUS reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
+			  struct regulatory_channel *chan_list)
+{
+	struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj;
+
+	pdev_priv_obj =	wlan_objmgr_pdev_get_comp_private_obj(pdev,
+					WLAN_UMAC_COMP_REGULATORY);
+
+	if (NULL == pdev_priv_obj) {
+		reg_err("reg pdev private obj is NULL");
+		return QDF_STATUS_E_FAULT;
+	}
+
+	qdf_mem_copy(chan_list, pdev_priv_obj->cur_chan_list,
+		     NUM_CHANNELS * sizeof(struct regulatory_channel));
+
+	return QDF_STATUS_SUCCESS;
+}
+
+

+ 42 - 26
umac/regulatory/core/src/reg_services.h

@@ -142,6 +142,14 @@ struct channel_power {
  * @CHAN_ENUM_12:  channel number 12
  * @CHAN_ENUM_13:  channel number 13
  * @CHAN_ENUM_14:  channel number 14
+ * @CHAN_ENUM_183:  channel number 183
+ * @CHAN_ENUM_184:  channel number 184
+ * @CHAN_ENUM_185:  channel number 185
+ * @CHAN_ENUM_187:  channel number 187
+ * @CHAN_ENUM_188:  channel number 188
+ * @CHAN_ENUM_189:  channel number 189
+ * @CHAN_ENUM_192:  channel number 192
+ * @CHAN_ENUM_196:  channel number 196
  * @CHAN_ENUM_36:  channel number 36
  * @CHAN_ENUM_40:  channel number 40
  * @CHAN_ENUM_44:  channel number 44
@@ -167,14 +175,6 @@ struct channel_power {
  * @CHAN_ENUM_157:  channel number 157
  * @CHAN_ENUM_161:  channel number 161
  * @CHAN_ENUM_165:  channel number 165
- * @CHAN_ENUM_183:  channel number 183
- * @CHAN_ENUM_184:  channel number 184
- * @CHAN_ENUM_185:  channel number 185
- * @CHAN_ENUM_187:  channel number 187
- * @CHAN_ENUM_188:  channel number 188
- * @CHAN_ENUM_189:  channel number 189
- * @CHAN_ENUM_192:  channel number 192
- * @CHAN_ENUM_196:  channel number 196
  */
 enum channel_enum {
 	CHAN_ENUM_1,
@@ -192,6 +192,15 @@ enum channel_enum {
 	CHAN_ENUM_13,
 	CHAN_ENUM_14,
 
+	CHAN_ENUM_183,
+	CHAN_ENUM_184,
+	CHAN_ENUM_185,
+	CHAN_ENUM_187,
+	CHAN_ENUM_188,
+	CHAN_ENUM_189,
+	CHAN_ENUM_192,
+	CHAN_ENUM_196,
+
 	CHAN_ENUM_36,
 	CHAN_ENUM_40,
 	CHAN_ENUM_44,
@@ -220,15 +229,6 @@ enum channel_enum {
 	CHAN_ENUM_161,
 	CHAN_ENUM_165,
 
-	CHAN_ENUM_183,
-	CHAN_ENUM_184,
-	CHAN_ENUM_185,
-	CHAN_ENUM_187,
-	CHAN_ENUM_188,
-	CHAN_ENUM_189,
-	CHAN_ENUM_192,
-	CHAN_ENUM_196,
-
 	NUM_CHANNELS,
 
 	MIN_24GHZ_CHANNEL = CHAN_ENUM_1,
@@ -331,18 +331,22 @@ QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_psoc *psoc,
 void reg_read_default_country(struct wlan_objmgr_psoc *psoc,
 		uint8_t *country);
 enum channel_state reg_get_channel_state(struct wlan_objmgr_psoc *psoc,
-		uint32_t ch);
-enum channel_state reg_get_5g_bonded_channel_state(
-		struct wlan_objmgr_psoc *psoc,
-		uint8_t ch, enum phy_ch_width bw);
-enum channel_state reg_get_2g_bonded_channel_state(
-		struct wlan_objmgr_psoc *psoc,
-		uint8_t oper_ch, uint8_t sec_ch,
-		enum phy_ch_width bw);
+					 uint32_t ch);
+enum channel_state reg_get_5g_bonded_channel_state(struct wlan_objmgr_psoc
+						   *psoc,
+						   uint8_t ch,
+						   enum phy_ch_width bw);
+enum channel_state reg_get_2g_bonded_channel_state(struct wlan_objmgr_psoc
+						   *psoc,
+						   uint8_t oper_ch,
+						   uint8_t sec_ch,
+						   enum phy_ch_width bw);
+
 void reg_set_channel_params(struct wlan_objmgr_psoc *psoc,
 		uint8_t ch, struct ch_params_s *ch_params);
 void reg_get_dfs_region(struct wlan_objmgr_psoc *psoc,
-		enum dfs_reg *dfs_reg);
+			enum dfs_reg *dfs_reg);
+
 bool reg_is_dfs_ch(struct wlan_objmgr_psoc *psoc, uint8_t ch);
 
 QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info *reg_info);
@@ -355,10 +359,22 @@ QDF_STATUS  wlan_regulatory_psoc_obj_destroyed_notification(
 					    struct wlan_objmgr_psoc *psoc,
 					    void *arg_list);
 
+QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
+					    struct wlan_objmgr_pdev *pdev,
+					    void *arg_list);
+
+QDF_STATUS  wlan_regulatory_pdev_obj_destroyed_notification(
+					    struct wlan_objmgr_pdev *pdev,
+					    void *arg_list);
+
 static inline struct wlan_lmac_if_reg_tx_ops *
 get_reg_psoc_tx_ops(struct wlan_objmgr_psoc *psoc)
 {
 	return &((psoc->soc_cb.tx_ops.reg_ops));
 }
 
+QDF_STATUS reg_get_current_chan_list(struct wlan_objmgr_pdev *pdev,
+				     struct regulatory_channel
+				     *chan_list);
+
 #endif

+ 10 - 0
umac/regulatory/dispatcher/inc/reg_services_public_struct.h

@@ -115,4 +115,14 @@ struct reg_country_update {
 	uint8_t country_code[REG_ALPHA2_LEN + 1];
 };
 
+/**
+ * struct reg_freq_range
+ * @low_freq: low frequency
+ * @high_freq: high frequency
+ */
+struct reg_freq_range {
+	uint32_t low_freq;
+	uint32_t high_freq;
+};
+
 #endif

+ 12 - 0
umac/regulatory/dispatcher/inc/wlan_reg_services_api.h

@@ -136,4 +136,16 @@ QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc);
  */
 QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * wlan_reg_get_current_chan_list () - Get the current channel list
+ *
+ * @pdev: pdev ptr
+ * @chan_list: channel list to be returned
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wlan_reg_get_current_chan_list(struct wlan_objmgr_pdev
+					  *pdev,
+					  struct regulatory_channel
+					  *chan_list);
 #endif

+ 1 - 0
umac/regulatory/dispatcher/inc/wlan_reg_ucfg_api.h

@@ -28,6 +28,7 @@
 
 #include <qdf_types.h>
 #include <qdf_status.h>
+#include "../../core/src/reg_services.h"
 #include <reg_services_public_struct.h>
 
 typedef QDF_STATUS (*reg_event_cb)(void *status_struct);

+ 45 - 5
umac/regulatory/dispatcher/src/wlan_reg_services_api.c

@@ -168,7 +168,7 @@ QDF_STATUS wlan_regulatory_init(void)
 			WLAN_UMAC_COMP_REGULATORY,
 			wlan_regulatory_psoc_obj_created_notification, NULL);
 	if (status != QDF_STATUS_SUCCESS) {
-		reg_err("Failed to register reg obj create handler");
+		reg_err("failed to register reg psoc obj create handler");
 		return status;
 	}
 
@@ -176,7 +176,7 @@ QDF_STATUS wlan_regulatory_init(void)
 			WLAN_UMAC_COMP_REGULATORY,
 			wlan_regulatory_psoc_obj_destroyed_notification, NULL);
 	if (status != QDF_STATUS_SUCCESS) {
-		reg_err("Failed to register reg obj delete handler");
+		reg_err("failed to register reg psoc obj detroy handler");
 		wlan_objmgr_unregister_psoc_create_handler(
 				WLAN_UMAC_COMP_REGULATORY,
 				wlan_regulatory_psoc_obj_created_notification,
@@ -184,6 +184,26 @@ QDF_STATUS wlan_regulatory_init(void)
 		return status;
 	}
 
+	status = wlan_objmgr_register_pdev_create_handler(
+			WLAN_UMAC_COMP_REGULATORY,
+			wlan_regulatory_pdev_obj_created_notification, NULL);
+	if (status != QDF_STATUS_SUCCESS) {
+		reg_err("failed to register reg pdev obj create handler");
+		return status;
+	}
+
+	status = wlan_objmgr_register_pdev_destroy_handler(
+			WLAN_UMAC_COMP_REGULATORY,
+			wlan_regulatory_pdev_obj_destroyed_notification, NULL);
+	if (status != QDF_STATUS_SUCCESS) {
+		reg_err("failed to register reg pdev obj destroy handler");
+		wlan_objmgr_unregister_pdev_create_handler(
+				WLAN_UMAC_COMP_REGULATORY,
+				wlan_regulatory_pdev_obj_created_notification,
+				NULL);
+		return status;
+	}
+
 	reg_debug("regulatory handlers registered with obj mgr");
 
 	return QDF_STATUS_SUCCESS;
@@ -215,6 +235,22 @@ QDF_STATUS wlan_regulatory_deinit(void)
 		return status;
 	}
 
+	status = wlan_objmgr_unregister_pdev_create_handler(
+		WLAN_UMAC_COMP_REGULATORY,
+		wlan_regulatory_pdev_obj_created_notification, NULL);
+	if (status != QDF_STATUS_SUCCESS) {
+		reg_err("failed to unregister reg pdev obj create handler");
+		return status;
+	}
+
+	status = wlan_objmgr_unregister_pdev_destroy_handler(
+		WLAN_UMAC_COMP_REGULATORY,
+		wlan_regulatory_pdev_obj_destroyed_notification, NULL);
+	if (status != QDF_STATUS_SUCCESS) {
+		reg_err("failed to unregister reg pdev obj destroy handler");
+		return status;
+	}
+
 	reg_debug("deregistered callbacks with obj mgr successfully");
 
 	return QDF_STATUS_SUCCESS;
@@ -240,6 +276,10 @@ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
 	return QDF_STATUS_SUCCESS;
 };
 
-
-
-
+QDF_STATUS wlan_reg_get_current_chan_list(struct wlan_objmgr_pdev
+					  *pdev,
+					  struct regulatory_channel
+					  *chan_list)
+{
+	return reg_get_current_chan_list(pdev, chan_list);
+}

+ 0 - 1
umac/regulatory/dispatcher/src/wlan_reg_ucfg_api.c

@@ -25,7 +25,6 @@
 #include <wlan_reg_ucfg_api.h>
 #include "../../core/src/reg_services.h"
 
-
 /**
  * ucfg_reg_set_band () - set band req handler
  * @vdev_id: vdev id