Prechádzať zdrojové kódy

qcacld-3.0: remove hdd_objmgr_get/put_vdev api

Remove hdd_objmgr_get/put_vdev api and use new
hdd_objmgr_get/put_vdev_by_user api to take reference of vdev with
component dbg id.

Change-Id: Ic0174a02e7d8d74506b03e04a4ae0aa7f28dad5e
CRs-Fixed: 2846706
Liangwei Dong 4 rokov pred
rodič
commit
172164c67d

+ 1 - 78
core/hdd/src/wlan_hdd_object_manager.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 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
@@ -218,83 +218,6 @@ int hdd_objmgr_release_and_destroy_pdev(struct hdd_context *hdd_ctx)
 	return qdf_status_to_os_return(status);
 }
 
-#ifdef WLAN_OBJMGR_REF_ID_TRACE
-struct wlan_objmgr_vdev *__hdd_objmgr_get_vdev(struct hdd_adapter *adapter,
-					       const char *func,
-					       int line)
-{
-	struct wlan_objmgr_vdev *vdev = NULL;
-	QDF_STATUS status;
-
-	if (!adapter) {
-		hdd_err("Adapter is NULL (via %s)", func);
-		return NULL;
-	}
-
-	qdf_spin_lock_bh(&adapter->vdev_lock);
-	vdev = adapter->vdev;
-	if (vdev) {
-		status = wlan_objmgr_vdev_try_get_ref_debug(vdev, WLAN_OSIF_ID,
-							    func, line);
-		if (QDF_IS_STATUS_ERROR(status))
-			vdev = NULL;
-	}
-	qdf_spin_unlock_bh(&adapter->vdev_lock);
-
-	if (!vdev)
-		hdd_debug("VDEV is NULL (via %s)", func);
-
-	return vdev;
-}
-
-void __hdd_objmgr_put_vdev(struct wlan_objmgr_vdev *vdev, const char *func,
-			   int line)
-{
-	if (!vdev) {
-		hdd_err("VDEV is NULL (via %s)", func);
-		return;
-	}
-
-	wlan_objmgr_vdev_release_ref_debug(vdev, WLAN_OSIF_ID, func, line);
-}
-#else
-struct wlan_objmgr_vdev *__hdd_objmgr_get_vdev(struct hdd_adapter *adapter,
-					       const char *func)
-{
-	struct wlan_objmgr_vdev *vdev = NULL;
-	QDF_STATUS status;
-
-	if (!adapter) {
-		hdd_err("Adapter is NULL (via %s)", func);
-		return NULL;
-	}
-
-	qdf_spin_lock_bh(&adapter->vdev_lock);
-	vdev = adapter->vdev;
-	if (vdev) {
-		status = wlan_objmgr_vdev_try_get_ref(vdev, WLAN_OSIF_ID);
-		if (QDF_IS_STATUS_ERROR(status))
-			vdev = NULL;
-	}
-	qdf_spin_unlock_bh(&adapter->vdev_lock);
-
-	if (!vdev)
-		hdd_debug("VDEV is NULL (via %s)", func);
-
-	return vdev;
-}
-
-void __hdd_objmgr_put_vdev(struct wlan_objmgr_vdev *vdev, const char *func)
-{
-	if (!vdev) {
-		hdd_err("VDEV is NULL (via %s)", func);
-		return;
-	}
-
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_OSIF_ID);
-}
-#endif
-
 int hdd_objmgr_set_peer_mlme_auth_state(struct wlan_objmgr_vdev *vdev,
 					bool is_authenticated)
 {

+ 1 - 42
core/hdd/src/wlan_hdd_object_manager.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2021 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
@@ -109,47 +109,6 @@ int hdd_objmgr_create_and_store_pdev(struct hdd_context *hdd_ctx);
  */
 int hdd_objmgr_release_and_destroy_pdev(struct hdd_context *hdd_ctx);
 
-/**
- * hdd_objmgr_get_vdev() - Get reference of vdev from adapter
- * @adapter: hdd adapter
- *
- * This API gets vdev object reference from hdd adapter
- *
- * Return: pointer to vdev object for success, NULL for failure
- */
-#ifdef WLAN_OBJMGR_REF_ID_TRACE
-#define hdd_objmgr_get_vdev(adapter) \
-	__hdd_objmgr_get_vdev(adapter, __func__, __LINE__)
-struct wlan_objmgr_vdev *__hdd_objmgr_get_vdev(struct hdd_adapter *adapter,
-					       const char *func,
-					       int line);
-#else
-#define hdd_objmgr_get_vdev(adapter) \
-	__hdd_objmgr_get_vdev(adapter, __func__)
-struct wlan_objmgr_vdev *__hdd_objmgr_get_vdev(struct hdd_adapter *adapter,
-					       const char *func);
-#endif
-
-/**
- * hdd_objmgr_put_vdev() - Release reference of vdev object
- * @vdev: pointer to vdev object
- *
- * This API releases vdev object reference which was acquired using
- * hdd_objmgr_get_vdev().
- *
- * Return: void
- */
-#ifdef WLAN_OBJMGR_REF_ID_TRACE
-#define hdd_objmgr_put_vdev(vdev) \
-	__hdd_objmgr_put_vdev(vdev, __func__, __LINE__)
-void __hdd_objmgr_put_vdev(struct wlan_objmgr_vdev *vdev, const char *func,
-			   int line);
-#else
-#define hdd_objmgr_put_vdev(vdev) \
-	__hdd_objmgr_put_vdev(vdev, __func__)
-void __hdd_objmgr_put_vdev(struct wlan_objmgr_vdev *vdev, const char *func);
-#endif
-
 /**
  * hdd_objmgr_set_peer_mlme_auth_state() - set the peer mlme auth state
  * @vdev: vdev pointer