Browse Source

qcacmn: Call channel change callback in regulatory_pdev_open

During pdev create callback, pdev reference cannot be taken. Hence,
channel change callbacks cannot be called during pdev create. So
call the callbacks during regulatory_pdev_open. Also dont check
if regulatory_pdev_open fails.

Change-Id: I9d444f952418be983e4ac2182581d03bba02b198
CRs-Fixed: 2572487
Amar Singhal 5 years ago
parent
commit
7defbc9a07

+ 12 - 0
init_deinit/dispatcher/src/dispatcher_init_deinit.c

@@ -298,6 +298,12 @@ static QDF_STATUS dispatcher_spectral_pdev_close(struct wlan_objmgr_pdev *pdev)
 }
 #endif
 
+static QDF_STATUS dispatcher_regulatory_pdev_open(struct wlan_objmgr_pdev
+						  *pdev)
+{
+	return regulatory_pdev_open(pdev);
+}
+
 static QDF_STATUS dispatcher_regulatory_pdev_close(struct wlan_objmgr_pdev
 						  *pdev)
 {
@@ -1058,6 +1064,9 @@ QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev)
 {
 	QDF_STATUS status;
 
+	if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_open(pdev))
+		goto regulatory_pdev_open_fail;
+
 	status = dispatcher_spectral_pdev_open(pdev);
 	if (status != QDF_STATUS_SUCCESS && status != QDF_STATUS_COMP_DISABLED)
 		goto spectral_pdev_open_fail;
@@ -1080,6 +1089,9 @@ mgmt_txrx_pdev_open_fail:
 cfr_pdev_open_fail:
 	dispatcher_spectral_pdev_close(pdev);
 spectral_pdev_open_fail:
+	dispatcher_regulatory_pdev_close(pdev);
+regulatory_pdev_open_fail:
+
 	return QDF_STATUS_E_FAILURE;
 }
 qdf_export_symbol(dispatcher_pdev_open);

+ 0 - 1
umac/regulatory/core/src/reg_priv_objs.c

@@ -247,7 +247,6 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification(
 	}
 
 	reg_compute_pdev_current_chan_list(pdev_priv_obj);
-	reg_send_scheduler_msg_nb(parent_psoc, pdev);
 
 	if (!psoc_priv_obj->is_11d_offloaded)
 		reg_11d_host_scan_init(parent_psoc);

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

@@ -632,6 +632,14 @@ QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc);
  */
 QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc);
 
+/**
+ * regulatory_pdev_open() - Open regulatory component
+ * @pdev: Pointer to pdev structure
+ *
+ * Return: Success or Failure
+ */
+QDF_STATUS regulatory_pdev_open(struct wlan_objmgr_pdev *pdev);
+
 /**
  * regulatory_pdev_close() - Close regulatory component
  * @pdev: Pointer to pdev structure.

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

@@ -438,6 +438,17 @@ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc)
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS regulatory_pdev_open(struct wlan_objmgr_pdev *pdev)
+{
+	struct wlan_objmgr_psoc *parent_psoc;
+
+	parent_psoc = wlan_pdev_get_psoc(pdev);
+
+	reg_send_scheduler_msg_nb(parent_psoc, pdev);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 QDF_STATUS regulatory_pdev_close(struct wlan_objmgr_pdev *pdev)
 {
 	struct wlan_objmgr_psoc *psoc;