Parcourir la source

qcacmn: Add DP handle member to psoc/pdev/vdev/peer objects

This change provides inline APIs to access dp handle
These set/reset APIs will be invoked by legacy code

Change-Id: I47f87cfc56b91766d21190bb3c34f018c4704269
CRs-Fixed: 2148247
Srinivas Pitla il y a 7 ans
Parent
commit
6a5c6a4c2f

+ 39 - 2
umac/cmn_services/obj_mgr/inc/wlan_objmgr_pdev_obj.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 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
@@ -173,7 +173,8 @@ struct wlan_objmgr_pdev_objmgr {
  * @pdev_comp_priv_obj[]:   component's private object array
  * @obj_status[]:      object status of each component object
  * @obj_state:         object state
- * @tgt_if_handle      Target interface handle
+ * @tgt_if_handle:     Target interface handle
+ * @dp_handle:         DP module handle
  * @pdev_lock:         lock to protect object
 */
 struct wlan_objmgr_pdev {
@@ -185,6 +186,7 @@ struct wlan_objmgr_pdev {
 	QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS];
 	WLAN_OBJ_STATE obj_state;
 	void *tgt_if_handle;
+	void *dp_handle;
 	qdf_spinlock_t pdev_lock;
 };
 
@@ -865,4 +867,39 @@ static inline uint8_t wlan_pdev_get_vdev_count(struct wlan_objmgr_pdev *pdev)
 {
 	return pdev->pdev_objmgr.wlan_vdev_count;
 }
+
+/**
+ * wlan_pdev_set_dp_handle() - set dp handle
+ * @pdev: pdev object pointer
+ * @dp_handle: Data path module handle
+ *
+ * Return: void
+ */
+static inline void wlan_pdev_set_dp_handle(struct wlan_objmgr_pdev *pdev,
+		void *dp_handle)
+{
+	if (qdf_unlikely(!pdev)) {
+		QDF_BUG(0);
+		return;
+	}
+
+	pdev->dp_handle = dp_handle;
+}
+
+/**
+ * wlan_pdev_get_dp_handle() - get dp handle
+ * @pdev: pdev object pointer
+ *
+ * Return: dp handle
+ */
+static inline void *wlan_pdev_get_dp_handle(struct wlan_objmgr_pdev *pdev)
+{
+	if (qdf_unlikely(!pdev)) {
+		QDF_BUG(0);
+		return NULL;
+	}
+
+	return pdev->dp_handle;
+}
+
 #endif /* _WLAN_OBJMGR_PDEV_H_*/

+ 37 - 1
umac/cmn_services/obj_mgr/inc/wlan_objmgr_peer_obj.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018 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
@@ -169,6 +169,7 @@ struct wlan_peer_activity {  /*TODO */
  * @peer_comp_priv_obj[]:  Component's private object pointers
  * @obj_status[]:     status of each component object
  * @obj_state:        Status of Peer object
+ * @dp_handle:        DP module handle
  * @peer_lock:        Lock for access/update peer contents
  */
 struct wlan_objmgr_peer {
@@ -181,6 +182,7 @@ struct wlan_objmgr_peer {
 	void *peer_comp_priv_obj[WLAN_UMAC_MAX_COMPONENTS];
 	QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS];
 	WLAN_OBJ_STATE obj_state;
+	void *dp_handle;
 	qdf_spinlock_t peer_lock;
 };
 
@@ -812,4 +814,38 @@ static inline void wlan_peer_mlme_reset_seq_num(
 	peer->peer_mlme.seq_num = 0;
 }
 
+/**
+ * wlan_peer_set_dp_handle() - set dp handle
+ * @peer: peer object pointer
+ * @dp_handle: Data path module handle
+ *
+ * Return: void
+ */
+static inline void wlan_peer_set_dp_handle(struct wlan_objmgr_peer *peer,
+		void *dp_handle)
+{
+	if (qdf_unlikely(!peer)) {
+		QDF_BUG(0);
+		return;
+	}
+
+	peer->dp_handle = dp_handle;
+}
+
+/**
+ * wlan_peer_get_dp_handle() - get dp handle
+ * @peer: peer object pointer
+ *
+ * Return: dp handle
+ */
+static inline void *wlan_peer_get_dp_handle(struct wlan_objmgr_peer *peer)
+{
+	if (qdf_unlikely(!peer)) {
+		QDF_BUG(0);
+		return NULL;
+	}
+
+	return peer->dp_handle;
+}
+
 #endif /* _WLAN_OBJMGR_PEER_OBJ_H_*/

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

@@ -278,10 +278,11 @@ struct wlan_soc_timer {
  * @obj_status[]:          component object status
  * @obj_state:             object state
  * @tgt_if_handle:         target interface handle
+ *    For OL based target it points to wmi handle
  * @total_mac_phy:         number of mac/phy supported by HW
  * @service_param:         FW service capability info
  * @ext_service_param:     extended FW service capability info
- *    For OL based target it points to wmi handle
+ * @dp_handle:             DP module handle
  * @psoc_lock:             psoc lock
  */
 struct wlan_objmgr_psoc {
@@ -299,6 +300,7 @@ struct wlan_objmgr_psoc {
 	uint8_t total_mac_phy;
 	struct wlan_objmgr_psoc_service_ready_param service_param;
 	struct wlan_objmgr_psoc_ext_service_ready_param ext_service_param;
+	void *dp_handle;
 	qdf_spinlock_t psoc_lock;
 };
 
@@ -1265,6 +1267,40 @@ static inline uint8_t wlan_objmgr_psoc_get_band_capability(
 	return psoc->soc_nif.user_config.band_capability;
 }
 
+/**
+ * wlan_psoc_set_dp_handle() - set dp handle
+ * @psoc: psoc object pointer
+ * @dp_handle: Data path module handle
+ *
+ * Return: void
+ */
+static inline void wlan_psoc_set_dp_handle(struct wlan_objmgr_psoc *psoc,
+		void *dp_handle)
+{
+	if (qdf_unlikely(!psoc)) {
+		QDF_BUG(0);
+		return;
+	}
+
+	psoc->dp_handle = dp_handle;
+}
+
+/**
+ * wlan_psoc_get_dp_handle() - get dp handle
+ * @psoc: psoc object pointer
+ *
+ * Return: dp handle
+ */
+static inline void *wlan_psoc_get_dp_handle(struct wlan_objmgr_psoc *psoc)
+{
+	if (qdf_unlikely(!psoc)) {
+		QDF_BUG(0);
+		return NULL;
+	}
+
+	return psoc->dp_handle;
+}
+
 struct wlan_logically_del_peer {
 	qdf_list_node_t list;
 	struct wlan_objmgr_peer *peer;

+ 36 - 0
umac/cmn_services/obj_mgr/inc/wlan_objmgr_vdev_obj.h

@@ -351,6 +351,7 @@ struct wlan_objmgr_vdev_objmgr {
  * @vdev_comp_priv_obj[]:Component's private objects list
  * @obj_status[]:   Component object status
  * @obj_state:      VDEV object state
+ * @dp_handle:      DP module handle
  * @vdev_lock:      VDEV lock
  */
 struct wlan_objmgr_vdev {
@@ -361,6 +362,7 @@ struct wlan_objmgr_vdev {
 	void *vdev_comp_priv_obj[WLAN_UMAC_MAX_COMPONENTS];
 	QDF_STATUS obj_status[WLAN_UMAC_MAX_COMPONENTS];
 	WLAN_OBJ_STATE obj_state;
+	void *dp_handle;
 	qdf_spinlock_t vdev_lock;
 };
 
@@ -1458,4 +1460,38 @@ static inline uint16_t wlan_vdev_get_max_peer_count(
  */
 bool wlan_vdev_is_connected(struct wlan_objmgr_vdev *vdev);
 
+/**
+ * wlan_vdev_set_dp_handle() - set dp handle
+ * @vdev: vdev object pointer
+ * @dp_handle: Data path module handle
+ *
+ * Return: void
+ */
+static inline void wlan_vdev_set_dp_handle(struct wlan_objmgr_vdev *vdev,
+		void *dp_handle)
+{
+	if (qdf_unlikely(!vdev)) {
+		QDF_BUG(0);
+		return;
+	}
+
+	vdev->dp_handle = dp_handle;
+}
+
+/**
+ * wlan_vdev_get_dp_handle() - get dp handle
+ * @vdev: vdev object pointer
+ *
+ * Return: dp handle
+ */
+static inline void *wlan_vdev_get_dp_handle(struct wlan_objmgr_vdev *vdev)
+{
+	if (qdf_unlikely(!vdev)) {
+		QDF_BUG(0);
+		return NULL;
+	}
+
+	return vdev->dp_handle;
+}
+
 #endif /* _WLAN_OBJMGR_VDEV_OBJ_H_*/