瀏覽代碼

qcacmn: Add API to retrieve component private object from psoc

Add API to retrieve component private object from psoc for respective
umac component id. In addition, the following changes are also done:
 1) Add IBSS Peer type.
 2) Define UMAC VDEV ID Max.
 3) Define Psoc, pdev, vdev create timeout values.
 3) Fix compilation issues of object manager.

Change-Id: I418dad89fe641c0b536549222eb391546975e66b
CRs-Fixed: 1097225
Selvaraj, Sridhar 8 年之前
父節點
當前提交
afd3a5b6f3

+ 8 - 4
umac/cmn_services/inc/wlan_cmn.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -40,6 +40,8 @@
 #define WLAN_UMAC_MAX_AP_PEERS WLAN_UMAC_PSOC_MAX_PEERS
 /* Max no. of peers for STA vap */
 #define WLAN_UMAC_MAX_STA_PEERS 2
+/* Max vdev_id */
+#define WLAN_UMAC_VDEV_ID_MAX 0xFF
 
 /* 802.11 cap info */
 #define WLAN_CAPINFO_ESS               0x0001
@@ -60,15 +62,15 @@
 /* Allowed time to wait for Object creation  */
 #define WLAN_VDEV_CREATE_TIMEOUT_CNT 300
  /* 25 msec */
-#define WLAN_VDEV_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1)
+#define WLAN_VDEV_CREATE_TIMEOUT 25
 
 #define WLAN_PDEV_CREATE_TIMEOUT_CNT 300
  /* 25 msec */
-#define WLAN_PDEV_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1)
+#define WLAN_PDEV_CREATE_TIMEOUT 25
 
 #define WLAN_PSOC_CREATE_TIMEOUT_CNT 300
 /* 25 msec */
-#define WLAN_PSOC_CREATE_TIMEOUT ((CONVERT_SEC_TO_SYSTEM_TIME(1)/40) + 1)
+#define WLAN_PSOC_CREATE_TIMEOUT 25
 
 /**
  * enum wlan_umac_comp_id - UMAC component id
@@ -153,6 +155,7 @@ enum wlan_phymode {
  * @WLAN_PEER_TDLS:     TDLS Peer
  * @WLAN_PEER_NAWDS:    NAWDS Peer
  * @WLAN_PEER_STA_TEMP: STA Peer Temp (its host only node)
+ * @WLAN_PEER_IBSS:     IBSS Peer
  */
 enum wlan_peer_type {
 	WLAN_PEER_SELF     = 1,
@@ -161,6 +164,7 @@ enum wlan_peer_type {
 	WLAN_PEER_TDLS     = 4,
 	WLAN_PEER_NAWDS    = 5,
 	WLAN_PEER_STA_TEMP = 6,
+	WLAN_PEER_IBSS     = 7,
 };
 
 /* MAC address length */

+ 5 - 5
umac/cmn_services/obj_mgr/inc/wlan_objmgr_global_obj.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -22,7 +22,7 @@
 #define _WLAN_OBJMGR_GLOBAL_OBJ_H_
 
 /**
- * wlan_objmgr_global_obj_create() - Creates global object
+ * wlan_objmgr_global_obj_init() - global object initialization
  *
  * Creates global object, intializes with default values
  *
@@ -30,10 +30,10 @@
  *         FAILURE  on Mem alloc failure or allocated already
  *
  */
-QDF_STATUS wlan_objmgr_global_obj_create(void);
+QDF_STATUS wlan_objmgr_global_obj_init(void);
 
 /**
- * wlan_objmgr_global_obj_delete() - Deletes global object
+ * wlan_objmgr_global_obj_deinit() - global object deinitialization
  *
  * Deletes global object
  *
@@ -41,7 +41,7 @@ QDF_STATUS wlan_objmgr_global_obj_create(void);
  *         FAILURE  on object is not found
  *
  */
-QDF_STATUS wlan_objmgr_global_obj_delete(void);
+QDF_STATUS wlan_objmgr_global_obj_deinit(void);
 
 /**
  * wlan_objmgr_global_obj_can_deleted() - Checks whether global object

+ 14 - 1
umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -745,4 +745,17 @@ static inline uint8_t *wlan_psoc_get_hw_macaddr(struct wlan_objmgr_psoc *psoc)
 		return NULL;
 	return psoc->soc_nif.soc_hw_macaddr;
 }
+
+/**
+ * wlan_objmgr_psoc_get_comp_private_obj(): API to retrieve component object
+ * @psoc: Psoc pointer
+ * @id: component id
+ *
+ * This API is used to get the component private object pointer tied to the
+ * corresponding psoc object
+ *
+ * Return: Component private object
+ */
+void *wlan_objmgr_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc,
+					enum wlan_umac_comp_id id);
 #endif /* _WLAN_OBJMGR_PSOC_OBJ_H_*/

+ 5 - 5
umac/cmn_services/obj_mgr/src/wlan_objmgr_global_obj.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -36,7 +36,7 @@ const char *wlan_umac_component_name[] = {
 /*
 ** APIs to Create/Delete Global object APIs
 */
-QDF_STATUS wlan_objmgr_global_obj_create(void)
+QDF_STATUS wlan_objmgr_global_obj_init(void)
 {
 	struct wlan_objmgr_global *umac_global_obj;
 
@@ -60,9 +60,9 @@ QDF_STATUS wlan_objmgr_global_obj_create(void)
 
 	return QDF_STATUS_SUCCESS;
 }
-EXPORT_SYMBOL(wlan_objmgr_global_obj_create);
+EXPORT_SYMBOL(wlan_objmgr_global_obj_init);
 
-QDF_STATUS wlan_objmgr_global_obj_delete(void)
+QDF_STATUS wlan_objmgr_global_obj_deinit(void)
 {
 	/* If it is already deleted */
 	if (g_umac_glb_obj == NULL) {
@@ -80,7 +80,7 @@ QDF_STATUS wlan_objmgr_global_obj_delete(void)
 	g_umac_glb_obj = NULL;
 	return QDF_STATUS_SUCCESS;
 }
-EXPORT_SYMBOL(wlan_objmgr_global_obj_delete);
+EXPORT_SYMBOL(wlan_objmgr_global_obj_deinit);
 
 /**
  ** APIs to register/unregister handlers

+ 24 - 8
umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_obj.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -440,24 +440,24 @@ QDF_STATUS wlan_objmgr_iterate_obj_list(
 	return QDF_STATUS_SUCCESS;
 }
 
-void wlan_objmgr_psoc_peer_delete(struct wlan_objmgr_psoc *psoc, void *obj,
-						 void *args)
+static void wlan_objmgr_psoc_peer_delete(struct wlan_objmgr_psoc *psoc,
+					 void *obj, void *args)
 {
 	struct wlan_objmgr_peer *peer = (struct wlan_objmgr_peer *)obj;
 
 	wlan_objmgr_peer_obj_delete(peer);
 }
 
-void wlan_objmgr_psoc_vdev_delete(struct wlan_objmgr_psoc *psoc, void *obj,
-							void *args)
+static void wlan_objmgr_psoc_vdev_delete(struct wlan_objmgr_psoc *psoc,
+					 void *obj, void *args)
 {
 	struct wlan_objmgr_vdev *vdev = (struct wlan_objmgr_vdev *)obj;
 
 	wlan_objmgr_vdev_obj_delete(vdev);
 }
 
-void wlan_objmgr_psoc_pdev_delete(struct wlan_objmgr_psoc *psoc, void *obj,
-							void *args)
+static void wlan_objmgr_psoc_pdev_delete(struct wlan_objmgr_psoc *psoc,
+					 void *obj, void *args)
 {
 	struct wlan_objmgr_pdev *pdev = (struct wlan_objmgr_pdev *)obj;
 
@@ -773,7 +773,7 @@ static QDF_STATUS wlan_obj_psoc_peerlist_remove_peer(
 	return QDF_STATUS_SUCCESS;
 }
 
-struct wlan_objmgr_peer *wlan_obj_psoc_peerlist_get_peer(
+static struct wlan_objmgr_peer *wlan_obj_psoc_peerlist_get_peer(
 				qdf_list_t *obj_list,
 				uint8_t *macaddr)
 {
@@ -878,3 +878,19 @@ struct wlan_objmgr_peer *wlan_objmgr_find_peer(
 	wlan_psoc_obj_unlock(psoc);
 	return peer;
 }
+
+void *wlan_objmgr_psoc_get_comp_private_obj(struct wlan_objmgr_psoc *psoc,
+					enum wlan_umac_comp_id id)
+{
+	void *comp_private_obj;
+
+	if (!psoc)
+		return NULL;
+
+	wlan_psoc_obj_lock(psoc);
+	comp_private_obj = psoc->soc_comp_priv_obj[id];
+	wlan_psoc_obj_unlock(psoc);
+
+	return comp_private_obj;
+}
+

+ 2 - 1
umac/cmn_services/obj_mgr/src/wlan_objmgr_vdev_obj.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2017 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
@@ -24,6 +24,7 @@
 #include <wlan_objmgr_psoc_obj.h>
 #include <wlan_objmgr_pdev_obj.h>
 #include <wlan_objmgr_vdev_obj.h>
+#include <wlan_objmgr_vdev_obj_i.h>
 #include <wlan_objmgr_peer_obj.h>
 #include <wlan_objmgr_psoc_obj_i.h>
 #include <wlan_objmgr_pdev_obj_i.h>