Sfoglia il codice sorgente

qcacmn: Add the event handler for WMI_REG_CHAN_LIST_CC_EVENTID

Add event handler for WMI_REG_CHAN_LIST_CC_EVENTID.This handler
would be called from psoc_open object manager framework
initialization.

Change-Id: Icfd52fdb7056fdb77afdbd1be576d160719b7285
CRs-Fixed: 2002892
Amar Singhal 8 anni fa
parent
commit
e407974144

+ 4 - 0
target_if/core/src/target_if_main.c

@@ -28,6 +28,7 @@
 #ifdef WLAN_ATF_ENABLE
 #include "target_if_atf.h"
 #endif
+#include <target_if_reg.h>
 
 #ifdef CONVERGED_P2P_ENABLE
 #include "target_if_p2p.h"
@@ -146,6 +147,9 @@ QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 
 	target_if_nan_tx_ops_register(tx_ops);
 
+	/* call regulatory callback to register tx ops */
+	target_if_register_regulatory_tx_ops(tx_ops);
+
 	/* Converged UMAC components to register their TX-ops here */
 	return QDF_STATUS_SUCCESS;
 }

+ 32 - 0
target_if/regulatory/inc/target_if_reg.h

@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: target_if_reg.h
+ * This file contains regulatory target interface
+ */
+
+/**
+ * target_if_register_regulatory_tx_ops() - register regulatory tx ops
+ *
+ * @tx_ops: tx_ops pointer
+ * Return: Success or Failure
+ */
+QDF_STATUS target_if_register_regulatory_tx_ops(struct wlan_lmac_if_tx_ops
+						*tx_ops);

+ 190 - 0
target_if/regulatory/src/target_if_reg.c

@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ *
+ *
+ * Permission to use, copy, modify, and/or distribute this software for
+ * any purpose with or without fee is hereby granted, provided that the
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+ /**
+ * DOC: target_if_reg.c
+ * This file contains regulatory target interface
+ */
+
+
+#include <wmi_unified_api.h>
+#include <wmi.h>
+#include <osdep.h>
+#include <reg_services_public_struct.h>
+#include <wlan_reg_tgt_api.h>
+#include <target_if.h>
+#include <target_if_reg.h>
+
+static struct cur_reg_rule
+*create_reg_rules_from_wmi(uint32_t num_reg_rules,
+			   wmi_regulatory_rule_struct *wmi_reg_rule)
+{
+	struct cur_reg_rule *reg_rule_ptr;
+	uint32_t count;
+
+	reg_rule_ptr = qdf_mem_malloc(num_reg_rules * sizeof(*reg_rule_ptr));
+
+	if (NULL == reg_rule_ptr) {
+		target_if_err("memory allocation failure");
+		return NULL;
+	}
+
+	for (count = 0; count < num_reg_rules; count++) {
+		reg_rule_ptr[count].start_freq =
+			WMI_REG_RULE_START_FREQ_GET(
+				wmi_reg_rule[count].freq_info);
+		reg_rule_ptr[count].end_freq =
+			WMI_REG_RULE_END_FREQ_GET(
+				wmi_reg_rule[count].freq_info);
+		reg_rule_ptr[count].max_bw =
+			WMI_REG_RULE_MAX_BW_GET(
+				wmi_reg_rule[count].bw_info);
+		reg_rule_ptr[count].reg_power =
+			WMI_REG_RULE_REG_POWER_GET(
+				wmi_reg_rule[count].bw_info);
+		reg_rule_ptr[count].flags =
+			WMI_REG_RULE_FLAGS_GET(
+				wmi_reg_rule[count].power_flag_info);
+	}
+
+	return reg_rule_ptr;
+}
+
+
+/**
+ * reg_chan_list_update_handler() - function to update channel list
+ * @handle: wma handle
+ * @event_buf: event buffer
+ * @len: length of buffer
+ *
+ * Return: 0 for success or error code
+ */
+static int reg_chan_list_update_handler(ol_scn_t handle, uint8_t *event_buf,
+				 uint32_t len)
+{
+	WMI_REG_CHAN_LIST_CC_EVENTID_param_tlvs *param_buf;
+	struct cur_regulatory_info *reg_info;
+	wmi_reg_chan_list_cc_event_fixed_param *chan_list_event_hdr;
+	wmi_regulatory_rule_struct *wmi_reg_rule;
+	uint32_t num_2g_reg_rules, num_5g_reg_rules;
+	struct wlan_objmgr_psoc *psoc;
+	QDF_STATUS status;
+
+	target_if_info("processing regulatory channel list");
+
+	param_buf = (WMI_REG_CHAN_LIST_CC_EVENTID_param_tlvs *)event_buf;
+	if (!param_buf) {
+		target_if_err("invalid channel list event buf");
+		return -EINVAL;
+	}
+
+	chan_list_event_hdr = param_buf->fixed_param;
+
+	reg_info = qdf_mem_malloc(sizeof(*reg_info));
+
+	if (NULL == reg_info) {
+		target_if_err("memory allocation failure");
+		return -ENOMEM;
+	}
+
+	psoc = target_if_get_psoc_from_scn_hdl(handle);
+
+	reg_info->psoc = psoc;
+	reg_info->num_2g_reg_rules = chan_list_event_hdr->num_2g_reg_rules;
+	reg_info->num_5g_reg_rules = chan_list_event_hdr->num_5g_reg_rules;
+	qdf_mem_copy(reg_info->alpha2, &(chan_list_event_hdr->alpha2),
+		     REG_ALPHA2_LEN);
+	reg_info->dfs_region = chan_list_event_hdr->dfs_region;
+	reg_info->phybitmap = chan_list_event_hdr->phybitmap;
+	reg_info->min_bw_2g = chan_list_event_hdr->min_bw_2g;
+	reg_info->max_bw_2g = chan_list_event_hdr->max_bw_2g;
+	reg_info->min_bw_5g = chan_list_event_hdr->min_bw_5g;
+	reg_info->max_bw_5g = chan_list_event_hdr->max_bw_5g;
+
+	num_2g_reg_rules = reg_info->num_2g_reg_rules;
+	num_5g_reg_rules = reg_info->num_5g_reg_rules;
+
+	wmi_reg_rule = (wmi_regulatory_rule_struct *)(chan_list_event_hdr
+			    + sizeof(wmi_reg_chan_list_cc_event_fixed_param));
+
+	reg_info->reg_rules_2g_ptr = create_reg_rules_from_wmi(num_2g_reg_rules,
+							       wmi_reg_rule);
+	wmi_reg_rule += num_2g_reg_rules;
+
+	reg_info->reg_rules_5g_ptr = create_reg_rules_from_wmi(num_5g_reg_rules,
+							       wmi_reg_rule);
+
+	status = psoc->soc_cb.rx_ops.reg_rx_ops.master_list_handler(reg_info);
+
+	if (status != QDF_STATUS_SUCCESS) {
+		target_if_err("component could not process regulatory message");
+		qdf_mem_free(reg_info->reg_rules_2g_ptr);
+		qdf_mem_free(reg_info->reg_rules_5g_ptr);
+		qdf_mem_free(reg_info);
+		return -EFAULT;
+	}
+
+	qdf_mem_free(reg_info->reg_rules_2g_ptr);
+	qdf_mem_free(reg_info->reg_rules_5g_ptr);
+	qdf_mem_free(reg_info);
+
+	target_if_debug("processed regulatory channel list");
+
+	return 0;
+}
+
+
+static QDF_STATUS tgt_if_regulatory_register_master_list_handler(
+	struct wlan_objmgr_psoc *psoc, void *arg)
+{
+	wmi_unified_t wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc);
+
+	return wmi_unified_register_event_handler(wmi_handle,
+						  WMI_REG_CHAN_LIST_CC_EVENTID,
+						  reg_chan_list_update_handler,
+						  WMI_RX_UMAC_CTX);
+
+}
+
+static QDF_STATUS tgt_if_regulatory_unregister_master_list_handler(
+	struct wlan_objmgr_psoc *psoc, void *arg)
+{
+	wmi_unified_t wmi_handle = GET_WMI_HDL_FROM_PSOC(psoc);
+
+	return wmi_unified_unregister_event_handler(wmi_handle,
+					    WMI_REG_CHAN_LIST_CC_EVENTID);
+
+}
+
+QDF_STATUS target_if_register_regulatory_tx_ops(struct wlan_lmac_if_tx_ops
+						*tx_ops)
+{
+	struct wlan_lmac_if_reg_tx_ops *reg_ops = &tx_ops->reg_ops;
+
+	reg_ops->register_master_handler =
+		tgt_if_regulatory_register_master_list_handler;
+
+	reg_ops->unregister_master_handler =
+		tgt_if_regulatory_unregister_master_list_handler;
+
+	return QDF_STATUS_SUCCESS;
+}
+
+
+

+ 24 - 0
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -27,6 +27,7 @@
 #ifdef WLAN_ATF_ENABLE
 #include "wlan_atf_utils_defs.h"
 #endif
+#include <reg_services_public_struct.h>
 
 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
 #include "wlan_crypto_global_def.h"
@@ -345,6 +346,19 @@ struct wlan_lmac_if_nan_tx_ops {
 };
 #endif
 
+/**
+ * struct wlan_lmac_reg_if_tx_ops - structure of tx function
+ *                  pointers for regulatory component
+ * @register_master_handler: pointer to register event handler
+ * @unregister_master_handler:  pointer to unregister event handler
+ */
+struct wlan_lmac_if_reg_tx_ops {
+	QDF_STATUS (*register_master_handler)(struct wlan_objmgr_psoc *psoc,
+					      void *arg);
+	QDF_STATUS (*unregister_master_handler)(struct wlan_objmgr_psoc *psoc,
+						void *arg);
+};
+
 /**
  * struct wlan_lmac_if_tx_ops - south bound tx function pointers
  * @mgmt_txrx_tx_ops: mgmt txrx tx ops
@@ -369,18 +383,22 @@ struct wlan_lmac_if_tx_ops {
 #ifdef CONVERGED_P2P_ENABLE
 	struct wlan_lmac_if_p2p_tx_ops p2p;
 #endif
+
 #ifdef WLAN_ATF_ENABLE
 	struct wlan_lmac_if_atf_tx_ops atf_tx_ops;
 #endif
+
 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
 	struct wlan_lmac_if_crypto_tx_ops crypto_tx_ops;
 #endif
+
 #ifdef WIFI_POS_CONVERGED
 	struct wlan_lmac_if_wifi_pos_tx_ops wifi_pos_tx_ops;
 #endif
 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
 	struct wlan_lmac_if_nan_tx_ops nan_tx_ops;
 #endif
+	struct wlan_lmac_if_reg_tx_ops reg_ops;
 };
 
 /**
@@ -432,6 +450,10 @@ struct wlan_lmac_if_pmo_rx_ops {
 			struct pmo_lphb_rsp *rsp_param);
 };
 #endif
+struct wlan_lmac_if_reg_rx_ops {
+	QDF_STATUS (*master_list_handler)(struct cur_regulatory_info
+					  *reg_info);
+};
 
 #ifdef CONVERGED_P2P_ENABLE
 
@@ -593,6 +615,7 @@ struct wlan_lmac_if_rx_ops {
 #ifdef CONVERGED_P2P_ENABLE
 	struct wlan_lmac_if_p2p_rx_ops p2p;
 #endif
+
 #ifdef WLAN_ATF_ENABLE
 	struct wlan_lmac_if_atf_rx_ops atf_rx_ops;
 #endif
@@ -605,6 +628,7 @@ struct wlan_lmac_if_rx_ops {
 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
 	struct wlan_lmac_if_nan_rx_ops nan_rx_ops;
 #endif
+	struct wlan_lmac_if_reg_rx_ops reg_rx_ops;
 };
 
 /* Function pointer to call legacy tx_ops registration in OL/WMA.

+ 6 - 0
umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c

@@ -31,6 +31,7 @@
 #ifdef WLAN_FEATURE_NAN_CONVERGENCE
 #include "target_if_nan.h"
 #endif /* WLAN_FEATURE_NAN_CONVERGENCE */
+#include "wlan_reg_tgt_api.h"
 
 #ifdef WLAN_CONV_CRYPTO_SUPPORTED
 #include "wlan_crypto_global_api.h"
@@ -171,8 +172,10 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 			tgt_mgmt_txrx_get_peer_from_desc_id;
 	mgmt_txrx_rx_ops->mgmt_txrx_get_vdev_id_from_desc_id =
 			tgt_mgmt_txrx_get_vdev_id_from_desc_id;
+
 	/* scan rx ops */
 	rx_ops->scan.scan_ev_handler = tgt_scan_event_handler;
+
 	wlan_lmac_if_atf_rx_ops_register(rx_ops);
 
 	wlan_lmac_if_crypto_rx_ops_register(rx_ops);
@@ -181,6 +184,9 @@ wlan_lmac_if_umac_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops)
 
 	wlan_lmac_if_register_nan_rx_ops(rx_ops);
 
+	rx_ops->reg_rx_ops.master_list_handler =
+		tgt_reg_process_master_chan_list;
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 18 - 16
umac/regulatory/core/src/reg_services.c

@@ -543,6 +543,7 @@ void reg_set_channel_params(struct wlan_objmgr_psoc *psoc,
 			break;
 		}
 	}
+
 	if (CH_WIDTH_160MHZ == ch_params->ch_width) {
 		ch_params->center_freq_seg1 = ch_params->center_freq_seg0;
 		chan_state = reg_get_5g_bonded_channel(psoc, ch,
@@ -552,9 +553,10 @@ void reg_set_channel_params(struct wlan_objmgr_psoc *psoc,
 				(bonded_chan_ptr->start_ch +
 				 bonded_chan_ptr->end_ch)/2;
 	}
-	reg_info("ch %d ch_wd %d freq0 %d freq1 %d", ch,
-			ch_params->ch_width, ch_params->center_freq_seg0,
-			ch_params->center_freq_seg1);
+
+	reg_debug("ch %d ch_wd %d freq0 %d freq1 %d", ch,
+		  ch_params->ch_width, ch_params->center_freq_seg0,
+		  ch_params->center_freq_seg1);
 }
 
 /**
@@ -588,7 +590,7 @@ bool reg_is_dfs_ch(struct wlan_objmgr_psoc *psoc, uint8_t ch)
 
 
 static void reg_fill_channel_info(enum channel_enum chan_enum,
-				  struct regulatory_rule *reg_rule,
+				  struct cur_reg_rule *reg_rule,
 				  struct regulatory_channel *master_list,
 				  uint16_t min_bw)
 {
@@ -632,13 +634,13 @@ static void reg_fill_channel_info(enum channel_enum chan_enum,
 
 static void populate_band_channels(enum channel_enum start_chan,
 				   enum channel_enum end_chan,
-				   struct regulatory_rule *rule_start_ptr,
+				   struct cur_reg_rule *rule_start_ptr,
 				   uint32_t num_reg_rules,
 				   uint16_t min_bw,
 				   struct regulatory_channel *mas_chan_list)
 {
-	struct regulatory_rule *found_rule_ptr;
-	struct regulatory_rule *cur_rule_ptr;
+	struct cur_reg_rule *found_rule_ptr;
+	struct cur_reg_rule *cur_rule_ptr;
 	struct regulatory_channel;
 	enum channel_enum chan_enum;
 	uint32_t rule_num, bw;
@@ -674,7 +676,7 @@ static void populate_band_channels(enum channel_enum start_chan,
 }
 
 static void update_max_bw_per_rule(uint32_t num_reg_rules,
-				   struct regulatory_rule *reg_rule_start,
+				   struct cur_reg_rule *reg_rule_start,
 				   uint16_t max_bw)
 {
 	uint32_t count;
@@ -685,7 +687,7 @@ static void update_max_bw_per_rule(uint32_t num_reg_rules,
 }
 
 static void do_auto_bw_correction(uint32_t num_reg_rules,
-				  struct regulatory_rule *reg_rule_ptr,
+				  struct cur_reg_rule *reg_rule_ptr,
 				  uint16_t max_bw)
 {
 	uint32_t count;
@@ -710,7 +712,7 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
 {
 	struct wlan_regulatory_psoc_priv_obj *soc_reg;
 	uint32_t num_2g_reg_rules, num_5g_reg_rules;
-	struct regulatory_rule *reg_rule_2g, *reg_rule_5g;
+	struct cur_reg_rule *reg_rule_2g, *reg_rule_5g;
 	uint16_t min_bw_2g, max_bw_2g, min_bw_5g, max_bw_5g;
 	struct regulatory_channel *mas_chan_list, *cur_chan_list;
 
@@ -765,10 +767,6 @@ QDF_STATUS reg_process_master_chan_list(struct cur_regulatory_info
 	qdf_mem_copy((void *)cur_chan_list, (void *)mas_chan_list,
 		     NUM_CHANNELS * sizeof(struct regulatory_channel));
 
-	qdf_mem_free(regulat_info->reg_rules_2g_ptr);
-	qdf_mem_free(regulat_info->reg_rules_5g_ptr);
-	qdf_mem_free(regulat_info);
-
 	return QDF_STATUS_SUCCESS;
 }
 
@@ -818,7 +816,8 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 	status = wlan_objmgr_psoc_component_obj_attach(psoc,
 			WLAN_UMAC_COMP_REGULATORY, soc_reg_obj,
 			QDF_STATUS_SUCCESS);
-	reg_info("reg psoc obj created with status %d", status);
+
+	reg_debug("reg psoc obj created with status %d", status);
 
 	return status;
 }
@@ -840,6 +839,7 @@ QDF_STATUS  wlan_regulatory_psoc_obj_destroyed_notification(
 	struct wlan_regulatory_psoc_priv_obj *soc_reg =
 		wlan_objmgr_psoc_get_comp_private_obj(psoc,
 				WLAN_UMAC_COMP_REGULATORY);
+
 	if (NULL == soc_reg) {
 		reg_err("reg psoc private obj is NULL");
 		return QDF_STATUS_E_FAULT;
@@ -852,7 +852,9 @@ QDF_STATUS  wlan_regulatory_psoc_obj_destroyed_notification(
 			soc_reg);
 	if (status != QDF_STATUS_SUCCESS)
 		reg_err("soc_reg private obj detach failed");
-	reg_info("reg psoc obj deleted with status %d", status);
+
+	reg_debug("reg psoc obj deleted with status %d", status);
+
 	qdf_mem_free(soc_reg);
 
 	return status;

+ 7 - 4
umac/regulatory/core/src/reg_services.h

@@ -59,6 +59,7 @@ typedef enum {
 	REGDOMAIN_COUNT
 } v_REGDOMAIN_t;
 
+
 /**
  * enum phy_ch_width - channel width
  * @CH_WIDTH_20MHZ: 20 mhz width
@@ -83,7 +84,6 @@ enum phy_ch_width {
 	CH_WIDTH_MAX
 };
 
-
 /**
  * struct ch_params
  * @ch_width: channel width
@@ -126,7 +126,6 @@ struct channel_power {
 	uint32_t tx_power;
 };
 
-
 /**
  * enum channel_enum - channel enumeration
  * @CHAN_ENUM_1:  channel number 1
@@ -323,7 +322,6 @@ enum ht_sec_ch_offset {
 };
 
 
-
 extern const struct chan_map channel_map[NUM_CHANNELS];
 
 QDF_STATUS reg_get_channel_list_with_power(struct wlan_objmgr_psoc *psoc,
@@ -353,9 +351,14 @@ QDF_STATUS wlan_regulatory_psoc_obj_created_notification(
 					    struct wlan_objmgr_psoc *psoc,
 					    void *arg_list);
 
-
 QDF_STATUS  wlan_regulatory_psoc_obj_destroyed_notification(
 					    struct wlan_objmgr_psoc *psoc,
 					    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));
+}
+
 #endif

+ 21 - 3
umac/regulatory/dispatcher/inc/reg_services_public_struct.h

@@ -26,11 +26,29 @@
 
 #include "../../core/src/reg_db.h"
 
+/**
+ * struct cur_reg_rule
+ * @start_freq: start frequency
+ * @end_freq: end frequency
+ * @max_bw: maximum bandwidth
+ * @reg_power: regulatory power
+ * @ant_gain: antenna gain
+ * @flags: regulatory flags
+ */
+struct cur_reg_rule {
+	uint16_t start_freq;
+	uint16_t end_freq;
+	uint16_t max_bw;
+	uint8_t reg_power;
+	uint8_t ant_gain;
+	uint16_t flags;
+};
+
 /**
  * struct cur_regulatory_info
  * @psoc: psoc ptr
  * @alpha2: country alpha2
- * @dfs_region: dfs region
+ * @dfs_reg: dfs region
  * @phybitmap: phy bit map
  * @min_bw_2g: minimum 2G bw
  * @max_bw_2g: maximum 2G bw
@@ -52,8 +70,8 @@ struct cur_regulatory_info {
 	uint32_t max_bw_5g;
 	uint32_t num_2g_reg_rules;
 	uint32_t num_5g_reg_rules;
-	struct regulatory_rule *reg_rules_2g_ptr;
-	struct regulatory_rule *reg_rules_5g_ptr;
+	struct cur_reg_rule *reg_rules_2g_ptr;
+	struct cur_reg_rule *reg_rules_5g_ptr;
 };
 
 /**

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

@@ -121,4 +121,19 @@ QDF_STATUS wlan_regulatory_init(void);
  */
 QDF_STATUS wlan_regulatory_deinit(void);
 
+/**
+ * regulatory_psoc_open() - open regulatory component
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc);
+
+
+/**
+ * regulatory_psoc_close() - close regulatory component
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc);
+
 #endif

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

@@ -184,7 +184,7 @@ QDF_STATUS wlan_regulatory_init(void)
 		return status;
 	}
 
-	reg_info("regulatory handlers registered with obj mgr");
+	reg_debug("regulatory handlers registered with obj mgr");
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -214,9 +214,32 @@ QDF_STATUS wlan_regulatory_deinit(void)
 				status);
 		return status;
 	}
-	reg_alert("deregistered callbacks with obj mgr successfully");
+
+	reg_debug("deregistered callbacks with obj mgr successfully");
 
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_lmac_if_reg_tx_ops *tx_ops;
+
+	tx_ops = get_reg_psoc_tx_ops(psoc);
+	tx_ops->register_master_handler(psoc, NULL);
+
+	return QDF_STATUS_SUCCESS;
+};
+
+QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
+{
+	struct wlan_lmac_if_reg_tx_ops *tx_ops;
+
+	tx_ops = get_reg_psoc_tx_ops(psoc);
+	tx_ops->unregister_master_handler(psoc, NULL);
+
+	return QDF_STATUS_SUCCESS;
+};
+
+
+