瀏覽代碼

qcacld-3.0: Change to include PDEV MLME component object

Changes to include PDEV MLME component object for VDEV SM.

Change-Id: I1f89e9bf5a4d5b17be7ec3c4fc52a5f8fe8f1862
CRs-Fixed: 2381858
Abhishek Singh 6 年之前
父節點
當前提交
d5cf22dffb

+ 6 - 2
Kbuild

@@ -888,12 +888,16 @@ endif
 ######## COMMON MLME ##############
 UMAC_MLME_INC := -I$(WLAN_COMMON_INC)/umac/mlme \
 		-I$(WLAN_COMMON_INC)/umac/mlme/mlme_objmgr/dispatcher/inc \
-		-I$(WLAN_COMMON_INC)/umac/mlme/vdev_mgr/dispatcher/inc
+		-I$(WLAN_COMMON_INC)/umac/mlme/vdev_mgr/dispatcher/inc \
+		-I$(WLAN_COMMON_INC)/umac/mlme/pdev_mgr/dispatcher/inc
 
 ifeq ($(CONFIG_CMN_VDEV_MLME_SM), y)
 UMAC_MLME_OBJS := $(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/core/src/vdev_mlme_sm.o \
-		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.o
+		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mlme_api.o \
+		$(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_cmn_mlme_main.o \
+		$(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_pdev_mlme_main.o \
+		$(WLAN_COMMON_ROOT)/umac/mlme/pdev_mgr/dispatcher/src/wlan_pdev_mlme_api.o
 endif
 
 ######## MLME ##############

+ 10 - 3
components/mlme/core/inc/wlan_mlme_vdev_mgr_interface.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 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
@@ -27,6 +27,14 @@
 #include "include/wlan_vdev_mlme.h"
 #include "wlan_mlme_main.h"
 
+/**
+ * mlme_register_mlme_ext_ops() - Register mlme ext ops
+ *
+ * This function is called to register mlme ext operations
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS mlme_register_mlme_ext_ops(void);
 /**
  * mlme_register_vdev_mgr_ops() - Register vdev mgr ops
  * @vdev_mlme: vdev mlme object
@@ -35,7 +43,7 @@
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS mlme_register_vdev_mgr_ops(void *mlme);
+QDF_STATUS mlme_register_vdev_mgr_ops(struct vdev_mlme_obj *vdev_mlme);
 /**
  * mlme_unregister_vdev_mgr_ops() - Unregister vdev mgr ops
  * @vdev_mlme: vdev mlme object
@@ -148,6 +156,5 @@ QDF_STATUS mlme_set_assoc_type(struct wlan_objmgr_vdev *vdev,
  * Return: associate type
  */
 enum vdev_assoc_type  mlme_get_assoc_type(struct wlan_objmgr_vdev *vdev);
-
 #endif
 #endif

+ 30 - 13
components/mlme/core/src/wlan_mlme_vdev_mgr_interface.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 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
@@ -23,9 +23,11 @@
 #include "lim_utils.h"
 #include "wma_api.h"
 #include "lim_types.h"
+#include <include/wlan_mlme_cmn.h>
 
 static struct vdev_mlme_ops sta_mlme_ops;
 static struct vdev_mlme_ops ap_mlme_ops;
+static struct mlme_ext_ops ext_ops;
 
 bool mlme_is_vdev_in_beaconning_mode(enum QDF_OPMODE vdev_opmode)
 {
@@ -40,6 +42,22 @@ bool mlme_is_vdev_in_beaconning_mode(enum QDF_OPMODE vdev_opmode)
 	}
 }
 
+/**
+ * mlme_get_global_ops() - Register ext global ops
+ *
+ * Return: ext_ops global ops
+ */
+static struct mlme_ext_ops *mlme_get_global_ops(void)
+{
+	return &ext_ops;
+}
+
+QDF_STATUS mlme_register_mlme_ext_ops(void)
+{
+	mlme_set_ops_register_cb(mlme_get_global_ops);
+	return QDF_STATUS_SUCCESS;
+}
+
 /**
  * mlme_register_vdev_mgr_ops() - Register vdev mgr ops
  * @vdev_mlme: vdev mlme object
@@ -48,10 +66,9 @@ bool mlme_is_vdev_in_beaconning_mode(enum QDF_OPMODE vdev_opmode)
  *
  * Return: QDF_STATUS
  */
-QDF_STATUS mlme_register_vdev_mgr_ops(void *mlme)
+QDF_STATUS mlme_register_vdev_mgr_ops(struct vdev_mlme_obj *vdev_mlme)
 {
 	struct wlan_objmgr_vdev *vdev;
-	struct vdev_mlme_obj *vdev_mlme = (struct vdev_mlme_obj *)mlme;
 
 	vdev = vdev_mlme->vdev;
 
@@ -690,10 +707,6 @@ static QDF_STATUS ap_vdev_dfs_cac_timer_stop(struct vdev_mlme_obj *vdev_mlme,
  *                                      MLME down operation
  * @mlme_vdev_notify_down_complete:     callback to notify VDEV MLME on moving
  *                                      to INIT state
- * @mlme_vdev_ext_hdl_create:           callback to invoke creation of legacy
- *                                      vdev object
- * @mlme_vdev_ext_hdl_destroy:          callback to invoke destroy of legacy
- *                                      vdev object
  */
 static struct vdev_mlme_ops sta_mlme_ops = {
 	.mlme_vdev_start_send = sta_mlme_vdev_start_send,
@@ -707,8 +720,6 @@ static struct vdev_mlme_ops sta_mlme_ops = {
 	.mlme_vdev_stop_continue = vdevmgr_mlme_stop_continue,
 	.mlme_vdev_down_send = vdevmgr_mlme_vdev_down_send,
 	.mlme_vdev_notify_down_complete = vdevmgr_notify_down_complete,
-	.mlme_vdev_ext_hdl_create = vdevmgr_mlme_ext_hdl_create,
-	.mlme_vdev_ext_hdl_destroy = vdevmgr_mlme_ext_hdl_destroy,
 };
 
 /**
@@ -738,10 +749,6 @@ static struct vdev_mlme_ops sta_mlme_ops = {
  *                                      MLME down operation
  * @mlme_vdev_notify_down_complete:     callback to notify VDEV MLME on moving
  *                                      to INIT state
- * @mlme_vdev_ext_hdl_create:           callback to invoke creation of legacy
- *                                      vdev object
- * @mlme_vdev_ext_hdl_destroy:          callback to invoke destroy of legacy
- *                                      vdev object
  */
 static struct vdev_mlme_ops ap_mlme_ops = {
 	.mlme_vdev_start_send = ap_mlme_vdev_start_send,
@@ -758,6 +765,16 @@ static struct vdev_mlme_ops ap_mlme_ops = {
 	.mlme_vdev_stop_continue = vdevmgr_mlme_stop_continue,
 	.mlme_vdev_down_send = vdevmgr_mlme_vdev_down_send,
 	.mlme_vdev_notify_down_complete = vdevmgr_notify_down_complete,
+};
+
+/**
+ * struct mlme_ext_ops - VDEV MLME legacy global callbacks structure
+ * @mlme_vdev_ext_hdl_create:           callback to invoke creation of legacy
+ *                                      vdev object
+ * @mlme_vdev_ext_hdl_destroy:          callback to invoke destroy of legacy
+ *                                      vdev object
+ */
+static struct mlme_ext_ops ext_ops = {
 	.mlme_vdev_ext_hdl_create = vdevmgr_mlme_ext_hdl_create,
 	.mlme_vdev_ext_hdl_destroy = vdevmgr_mlme_ext_hdl_destroy,
 };

+ 32 - 0
components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -89,6 +89,18 @@ QDF_STATUS ucfg_mlme_pdev_open(struct wlan_objmgr_pdev *pdev);
  */
 QDF_STATUS ucfg_mlme_pdev_close(struct wlan_objmgr_pdev *pdev);
 
+/**
+ * ucfg_mlme_global_init() - initialize global mlme ops and structure
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS ucfg_mlme_global_init(void);
+/**
+ * ucfg_mlme_global_deinit() - deinitialize global mlme ops and structure
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS ucfg_mlme_global_deinit(void);
 #else
 /**
  * ucfg_mlme_pdev_open() - MLME component pdev Open
@@ -115,6 +127,26 @@ static inline QDF_STATUS ucfg_mlme_pdev_close(struct wlan_objmgr_pdev *pdev)
 {
 	return QDF_STATUS_SUCCESS;
 }
+
+/**
+ * ucfg_mlme_global_init() - initialize global mlme ops and structure
+ *
+ * Return: QDF Status
+ */
+static inline QDF_STATUS ucfg_mlme_global_init(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
+/**
+ * ucfg_mlme_global_deinit() - deinitialize global mlme ops and structure
+ *
+ * Return: QDF Status
+ */
+static inline QDF_STATUS ucfg_mlme_global_deinit(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
 #endif
 
 /**

+ 24 - 1
components/mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -26,6 +26,10 @@
 #include "wlan_mlme_ucfg_api.h"
 #include "wlan_objmgr_pdev_obj.h"
 #include "wlan_mlme_vdev_mgr_interface.h"
+#ifdef CONFIG_VDEV_SM
+#include <include/wlan_pdev_mlme.h>
+#include "wlan_pdev_mlme_api.h"
+#endif
 
 #ifdef CONFIG_VDEV_SM
 static QDF_STATUS ucfg_mlme_vdev_init(void)
@@ -38,6 +42,18 @@ static QDF_STATUS ucfg_mlme_vdev_deinit(void)
 	return QDF_STATUS_SUCCESS;
 }
 
+QDF_STATUS ucfg_mlme_global_init(void)
+{
+	mlme_register_mlme_ext_ops();
+
+	return QDF_STATUS_SUCCESS;
+}
+
+QDF_STATUS ucfg_mlme_global_deinit(void)
+{
+	return QDF_STATUS_SUCCESS;
+}
+
 #else
 static QDF_STATUS ucfg_mlme_vdev_init(void)
 {
@@ -159,7 +175,14 @@ void ucfg_mlme_psoc_close(struct wlan_objmgr_psoc *psoc)
 #ifdef CONFIG_VDEV_SM
 QDF_STATUS ucfg_mlme_pdev_open(struct wlan_objmgr_pdev *pdev)
 {
-	pdev->pdev_mlme.mlme_register_ops = mlme_register_vdev_mgr_ops;
+	struct pdev_mlme_obj *pdev_mlme;
+
+	pdev_mlme = wlan_pdev_mlme_get_cmpt_obj(pdev);
+	if (!pdev_mlme) {
+		mlme_err(" PDEV MLME is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+	pdev_mlme->mlme_register_ops = mlme_register_vdev_mgr_ops;
 
 	return QDF_STATUS_SUCCESS;
 }

+ 2 - 2
components/pmo/core/src/wlan_pmo_wow.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2019 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
@@ -269,7 +269,7 @@ bool pmo_is_beaconing_vdev_up(struct wlan_objmgr_psoc *psoc)
 
 		vdev_opmode = pmo_get_vdev_opmode(vdev);
 		is_beaconing = pmo_is_vdev_in_beaconning_mode(vdev_opmode) &&
-			       wlan_vdev_is_up(vdev);
+			       QDF_IS_STATUS_SUCCESS(wlan_vdev_is_up(vdev));
 
 		pmo_vdev_put_ref(vdev);
 

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

@@ -13118,10 +13118,14 @@ static QDF_STATUS hdd_component_init(void)
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
 
-	status = dispatcher_init();
+	status = ucfg_mlme_global_init();
 	if (QDF_IS_STATUS_ERROR(status))
 		goto target_if_deinit;
 
+	status = dispatcher_init();
+	if (QDF_IS_STATUS_ERROR(status))
+		goto mlme_global_deinit;
+
 	/* initialize non-converged components */
 	status = ucfg_mlme_init();
 	if (QDF_IS_STATUS_ERROR(status))
@@ -13191,6 +13195,8 @@ mlme_deinit:
 	ucfg_mlme_deinit();
 dispatcher_deinit:
 	dispatcher_deinit();
+mlme_global_deinit:
+	ucfg_mlme_global_deinit();
 target_if_deinit:
 	target_if_deinit();
 
@@ -13219,6 +13225,7 @@ static void hdd_component_deinit(void)
 
 	/* deinitialize converged components */
 	dispatcher_deinit();
+	ucfg_mlme_global_deinit();
 	target_if_deinit();
 }
 

+ 4 - 4
core/mac/src/pe/lim/lim_process_sme_req_messages.c

@@ -2991,8 +2991,8 @@ static void lim_delete_peers_and_send_vdev_stop(struct pe_session *session)
 	struct mac_context *mac_ctx = session->mac_ctx;
 	QDF_STATUS status;
 
-	if (wlan_vdev_mlme_get_substate(session->vdev) ==
-	    WLAN_VDEV_SS_START_RESTART_PROGRESS)
+	if (QDF_IS_STATUS_SUCCESS(
+	    wlan_vdev_is_restart_progress(session->vdev)))
 		status =
 		 wlan_vdev_mlme_sm_deliver_evt(session->vdev,
 					       WLAN_VDEV_SM_EV_RESTART_REQ_FAIL,
@@ -4750,8 +4750,8 @@ QDF_STATUS lim_sta_mlme_vdev_disconnect_bss(struct vdev_mlme_obj *vdev_mlme,
 static void lim_process_disconnect_sta(struct pe_session *session,
 				       struct scheduler_msg *msg)
 {
-	if (wlan_vdev_mlme_get_substate(session->vdev) ==
-	    WLAN_VDEV_SS_START_RESTART_PROGRESS)
+	if (QDF_IS_STATUS_SUCCESS(
+	    wlan_vdev_is_restart_progress(session->vdev)))
 		wlan_vdev_mlme_sm_deliver_evt(session->vdev,
 					      WLAN_VDEV_SM_EV_RESTART_REQ_FAIL,
 					      sizeof(*msg), msg);

+ 3 - 4
core/sap/src/sap_fsm.c

@@ -2327,10 +2327,9 @@ static QDF_STATUS sap_fsm_handle_start_failure(struct sap_context *sap_ctx,
 	QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
 
 	if (msg == eSAP_HDD_STOP_INFRA_BSS &&
-	    ((wlan_vdev_mlme_get_state(sap_ctx->vdev) ==
-	      WLAN_VDEV_S_DFS_CAC_WAIT) ||
-	     (wlan_vdev_mlme_get_substate(sap_ctx->vdev) ==
-	      WLAN_VDEV_SS_START_RESTART_PROGRESS))) {
+	    (QDF_IS_STATUS_SUCCESS(wlan_vdev_is_dfs_cac_wait(sap_ctx->vdev)) ||
+	     QDF_IS_STATUS_SUCCESS(
+	     wlan_vdev_is_restart_progress(sap_ctx->vdev)))) {
 		/* Transition from SAP_STARTING to SAP_STOPPING */
 		QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH,
 			  FL("In cac wait state from state %s => %s"),

+ 1 - 2
core/sap/src/sap_internal.h

@@ -468,8 +468,7 @@ static inline bool sap_is_dfs_cac_wait_state(struct sap_context *sap_ctx)
 	if (!sap_ctx)
 		return false;
 
-	return (wlan_vdev_mlme_get_state(sap_ctx->vdev) ==
-		WLAN_VDEV_S_DFS_CAC_WAIT);
+	return  QDF_IS_STATUS_SUCCESS(wlan_vdev_is_dfs_cac_wait(sap_ctx->vdev));
 }
 #else
 static inline bool sap_is_dfs_cac_wait_state(struct sap_context *sap_ctx)

+ 1 - 1
core/wma/src/wma_utils.c

@@ -4214,7 +4214,7 @@ bool wma_is_vdev_up(uint8_t vdev_id)
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
 			WLAN_LEGACY_WMA_ID);
 	if (vdev) {
-		is_up = wlan_vdev_is_up(vdev);
+		is_up = QDF_IS_STATUS_SUCCESS(wlan_vdev_is_up(vdev));
 		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
 	}
 	return is_up;