Prechádzať zdrojové kódy

qcacld-3.0: Add Component APIs for required ucfg APIs in DP component

When component dependent functions calling from higher
modules or any other components, it uses ucfg APIs pattern.
Calling ucfg dependent APIs is acceptable for higher modules
like HDD, OSIF but for another components like DP to avoid
using ucfg APIs here, implementing component APIs for existing
ucfg APIs to other components like NAN, vdev_mgr in DP
component module.

Change-Id: Ia5431c7de7fc944aacf5c8a328072a8ec31e8f3f
CRs-Fixed: 3351496
Roopavathi Lingampalli 2 rokov pred
rodič
commit
38bf757799

+ 2 - 0
Kbuild

@@ -1540,6 +1540,7 @@ UMAC_MLME_OBJS := $(WLAN_COMMON_ROOT)/umac/mlme/mlme_objmgr/dispatcher/src/wlan_
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_ucfg_api.o \
+		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_api.o \
 		$(WLAN_COMMON_ROOT)/umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_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 \
@@ -2515,6 +2516,7 @@ ifeq ($(CONFIG_QCACLD_FEATURE_NAN), y)
 WLAN_NAN_OBJS := $(NAN_CORE_DIR)/nan_main.o \
 		 $(NAN_CORE_DIR)/nan_api.o \
 		 $(NAN_UCFG_DIR)/nan_ucfg_api.o \
+		 $(NAN_UCFG_DIR)/wlan_nan_api.o \
 		 $(NAN_UCFG_DIR)/cfg_nan.o \
 		 $(NAN_TGT_DIR)/target_if_nan.o \
 		 $(NAN_OS_IF_DIR)/os_if_nan.o

+ 2 - 2
components/dp/core/src/wlan_dp_nud_tracking.c

@@ -28,7 +28,7 @@
 #include "wlan_cm_roam_ucfg_api.h"
 #include <wlan_cm_api.h>
 #include "wlan_dp_nud_tracking.h"
-#include "wlan_vdev_mgr_ucfg_api.h"
+#include "wlan_vdev_mgr_api.h"
 
 #ifdef WLAN_NUD_TRACKING
 /**
@@ -216,7 +216,7 @@ static bool dp_nud_honour_failure(struct wlan_dp_intf *dp_intf)
 	vdev = dp_objmgr_get_vdev_by_user(dp_intf, WLAN_DP_ID);
 	if (!vdev)
 		goto fail;
-	ucfg_wlan_vdev_mgr_get_param_bssid(vdev, bssid);
+	wlan_vdev_mgr_get_param_bssid(vdev, bssid);
 	dp_objmgr_put_vdev_by_user(vdev, WLAN_DP_ID);
 
 	tx_transmitted = nud_tracking->tx_rx_stats.post_tx_packets -

+ 3 - 3
components/dp/core/src/wlan_dp_txrx.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. 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
@@ -35,7 +35,7 @@
 #include "wlan_dp_fisa_rx.h"
 #endif
 #include "nan_public_structs.h"
-#include "nan_ucfg_api.h"
+#include "wlan_nan_api_i.h"
 #include <wlan_cm_api.h>
 #include <enet.h>
 #include <cds_utils.h>
@@ -422,7 +422,7 @@ void dp_get_transmit_mac_addr(struct wlan_dp_intf *dp_intf,
 
 	switch (dp_intf->device_mode) {
 	case QDF_NDI_MODE:
-		state = ucfg_nan_get_ndi_state(dp_intf->vdev);
+		state = wlan_nan_get_ndi_state(dp_intf->vdev);
 		if (state == NAN_DATA_NDI_CREATED_STATE ||
 		    state == NAN_DATA_CONNECTED_STATE ||
 		    state == NAN_DATA_CONNECTING_STATE ||

+ 43 - 0
components/nan/dispatcher/inc/wlan_nan_api_i.h

@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: contains prototypes for NAN component
+ */
+
+#ifndef _WLAN_NAN_API_I_H_
+#define _WLAN_NAN_API_I_H_
+
+#include "wlan_objmgr_cmn.h"
+#include "nan_public_structs.h"
+
+#ifdef WLAN_FEATURE_NAN
+/**
+ * wlan_nan_get_ndi_state: get ndi state from vdev obj
+ * @vdev: pointer to vdev object
+ *
+ * Return: ndi state
+ */
+enum nan_datapath_state wlan_nan_get_ndi_state(struct wlan_objmgr_vdev *vdev);
+
+#else
+static inline
+enum nan_datapath_state wlan_nan_get_ndi_state(struct wlan_objmgr_vdev *vdev)
+{
+	return NAN_DATA_INVALID_STATE;
+}
+#endif /*WLAN_FEATURE_NAN */
+#endif /*_WLAN_NAN_API_I_H_ */

+ 3 - 14
components/nan/dispatcher/src/nan_ucfg_api.c

@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
- * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. 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
@@ -36,6 +36,7 @@
 #include "wlan_mlme_api.h"
 #include "cfg_nan_api.h"
 #include "wlan_tdls_ucfg_api.h"
+#include "wlan_nan_api_i.h"
 
 struct wlan_objmgr_psoc;
 struct wlan_objmgr_vdev;
@@ -154,19 +155,7 @@ inline QDF_STATUS __ucfg_nan_set_ndi_state(struct wlan_objmgr_vdev *vdev,
 inline enum nan_datapath_state ucfg_nan_get_ndi_state(
 					struct wlan_objmgr_vdev *vdev)
 {
-	enum nan_datapath_state val;
-	struct nan_vdev_priv_obj *priv_obj = nan_get_vdev_priv_obj(vdev);
-
-	if (!priv_obj) {
-		nan_err("priv_obj is null");
-		return NAN_DATA_INVALID_STATE;
-	}
-
-	qdf_spin_lock_bh(&priv_obj->lock);
-	val = priv_obj->state;
-	qdf_spin_unlock_bh(&priv_obj->lock);
-
-	return val;
+	return wlan_nan_get_ndi_state(vdev);
 }
 
 inline QDF_STATUS ucfg_nan_set_active_peers(struct wlan_objmgr_vdev *vdev,

+ 43 - 0
components/nan/dispatcher/src/wlan_nan_api.c

@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. 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: contains definitions for NAN component
+ */
+
+#include "nan_public_structs.h"
+#include "wlan_nan_api.h"
+#include "../../core/src/nan_main_i.h"
+#include "wlan_objmgr_vdev_obj.h"
+#include "wlan_nan_api_i.h"
+
+inline enum nan_datapath_state wlan_nan_get_ndi_state(
+					struct wlan_objmgr_vdev *vdev)
+{
+	enum nan_datapath_state val;
+	struct nan_vdev_priv_obj *priv_obj = nan_get_vdev_priv_obj(vdev);
+
+	if (!priv_obj) {
+		nan_err("priv_obj is null");
+		return NAN_DATA_INVALID_STATE;
+	}
+
+	qdf_spin_lock_bh(&priv_obj->lock);
+	val = priv_obj->state;
+	qdf_spin_unlock_bh(&priv_obj->lock);
+
+	return val;
+}