Ver Fonte

qcacld-3.0: Initialize osif and legacy callbacks for connection manager

Initialize osif callbacks to connection manager and add
legacy callbacks to osif and initialize these legacy callbacks
for connection manager.

Change-Id: I27b3ccf61fdac0ceee938264320feb1331460ba2
CRs-Fixed: 2797475
Ashish Kumar Dhanotiya há 4 anos atrás
pai
commit
ded421b741
3 ficheiros alterados com 121 adições e 1 exclusões
  1. 33 0
      core/hdd/inc/wlan_hdd_assoc.h
  2. 45 0
      core/hdd/src/wlan_hdd_assoc.c
  3. 43 1
      core/hdd/src/wlan_hdd_main.c

+ 33 - 0
core/hdd/inc/wlan_hdd_assoc.h

@@ -478,4 +478,37 @@ void hdd_roam_profile_init(struct hdd_adapter *adapter);
  */
 bool hdd_any_valid_peer_present(struct hdd_adapter *adapter);
 
+#ifdef FEATURE_CM_ENABLE
+/**
+ * hdd_cm_register_cb() - Sets legacy callbacks to osif
+ *
+ * API to set legacy callbacks to osif
+ * Context: Any context.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS hdd_cm_register_cb(void);
+
+/**
+ * void hdd_cm_unregister_cb(void)() - Resets legacy callbacks to osif
+ *
+ * API to reset legacy callbacks to osif
+ * Context: Any context.
+ *
+ * Return: QDF_STATUS
+ */
+
+void hdd_cm_unregister_cb(void);
+
+#else
+static inline QDF_STATUS hdd_cm_register_cb(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static inline void hdd_cm_unregister_cb(void)
+{
+}
+#endif
+
 #endif

+ 45 - 0
core/hdd/src/wlan_hdd_assoc.c

@@ -82,6 +82,9 @@
 #include "wlan_if_mgr_ucfg_api.h"
 #include "wlan_if_mgr_public_struct.h"
 #endif
+#include "wlan_cm_public_struct.h"
+#include "osif_cm_util.h"
+
 
 /* These are needed to recognize WPA and RSN suite types */
 #define HDD_WPA_OUI_SIZE 4
@@ -5614,3 +5617,45 @@ void hdd_roam_profile_init(struct hdd_adapter *adapter)
 
 	hdd_exit();
 }
+
+#ifdef FEATURE_CM_ENABLE
+static QDF_STATUS hdd_cm_connect_complete(struct wlan_objmgr_vdev *vdev,
+					  struct wlan_cm_connect_rsp *rsp,
+					  enum osif_cb_type type)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS hdd_cm_disconnect_complete(struct wlan_objmgr_vdev *vdev,
+					     struct wlan_cm_discon_rsp *rsp,
+					     enum osif_cb_type type)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS hdd_cm_netif_queue_control(struct wlan_objmgr_vdev *vdev,
+					     enum netif_action_type action,
+					     enum netif_reason_type reason)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+struct osif_cm_ops osif_ops = {
+	.connect_complete_cb = hdd_cm_connect_complete,
+	.disconnect_complete_cb = hdd_cm_disconnect_complete,
+	.netif_queue_control_cb = hdd_cm_netif_queue_control,
+};
+
+QDF_STATUS hdd_cm_register_cb(void)
+{
+	osif_cm_set_legacy_cb(&osif_ops);
+
+	return osif_cm_register_cb();
+}
+
+void hdd_cm_unregister_cb(void)
+{
+	osif_cm_reset_legacy_cb();
+}
+#endif
+

+ 43 - 1
core/hdd/src/wlan_hdd_main.c

@@ -196,6 +196,7 @@
 #include <cdp_txrx_ctrl.h>
 #include "qdf_lock.h"
 #include "wlan_hdd_thermal.h"
+#include "osif_cm_util.h"
 
 #ifdef MODULE
 #define WLAN_MODULE_NAME  module_name(THIS_MODULE)
@@ -5400,6 +5401,7 @@ int hdd_vdev_destroy(struct hdd_adapter *adapter)
 	qdf_spin_lock_bh(&adapter->vdev_lock);
 	adapter->vdev = NULL;
 	qdf_spin_unlock_bh(&adapter->vdev_lock);
+	osif_cm_osif_priv_deinit(vdev);
 
 	/* Release the hdd reference */
 	wlan_objmgr_vdev_release_ref(vdev, WLAN_HDD_ID_OBJ_MGR);
@@ -5525,6 +5527,8 @@ int hdd_vdev_create(struct hdd_adapter *adapter)
 	adapter->vdev = vdev;
 	qdf_spin_unlock_bh(&adapter->vdev_lock);
 
+	osif_cm_osif_priv_init(vdev);
+
 	set_bit(SME_SESSION_OPENED, &adapter->event_flags);
 	status = sme_vdev_post_vdev_create_setup(hdd_ctx->mac_handle, vdev);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -16069,6 +16073,33 @@ static void wlan_hdd_state_ctrl_param_destroy(void)
 	pr_info("Device node unregistered");
 }
 
+/**
+ * hdd_component_cb_init() - Initialize component callbacks
+ *
+ * This function initializes hdd callbacks to different
+ * components
+ *
+ * Context: Any context.
+ * Return: QDF_STATUS
+ */
+static QDF_STATUS hdd_component_cb_init(void)
+{
+	return hdd_cm_register_cb();
+}
+
+/**
+ * hdd_component_cb_deinit() - De-initialize component callbacks
+ *
+ * This function de-initializes hdd callbacks with different components
+ *
+ * Context: Any context.
+ * Return: None`
+ */
+static void hdd_component_cb_deinit(void)
+{
+	return hdd_cm_unregister_cb();
+}
+
 /**
  * hdd_component_init() - Initialize all components
  *
@@ -16079,6 +16110,7 @@ static QDF_STATUS hdd_component_init(void)
 	QDF_STATUS status;
 
 	/* initialize converged components */
+
 	status = ucfg_mlme_global_init();
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
@@ -16790,11 +16822,18 @@ int hdd_driver_load(void)
 		goto trans_stop;
 	}
 
+	status = hdd_component_cb_init();
+	if (QDF_IS_STATUS_ERROR(status)) {
+		hdd_err("Failed to init component cb; status:%u", status);
+		errno = qdf_status_to_os_return(status);
+		goto hdd_deinit;
+	}
+
 	status = hdd_component_init();
 	if (QDF_IS_STATUS_ERROR(status)) {
 		hdd_err("Failed to init components; status:%u", status);
 		errno = qdf_status_to_os_return(status);
-		goto hdd_deinit;
+		goto comp_cb_deinit;
 	}
 
 	status = qdf_wake_lock_create(&wlan_wake_lock, "wlan");
@@ -16859,6 +16898,8 @@ wakelock_destroy:
 	qdf_wake_lock_destroy(&wlan_wake_lock);
 comp_deinit:
 	hdd_component_deinit();
+comp_cb_deinit:
+	hdd_component_cb_deinit();
 hdd_deinit:
 	hdd_deinit();
 trans_stop:
@@ -16947,6 +16988,7 @@ void hdd_driver_unload(void)
 	hdd_set_conparam(0);
 	qdf_wake_lock_destroy(&wlan_wake_lock);
 	hdd_component_deinit();
+	hdd_component_cb_deinit();
 	hdd_deinit();
 
 	osif_driver_sync_trans_stop(driver_sync);