Browse Source

qcacmn: Add an api to get pdev from pdev_id

Add an API to fetch pdev using pdev_id from soc.

Change-Id: Id9f480d8e3546cde3930c9f1179d60d470e17051
Pavankumar Nandeshwar 5 years ago
parent
commit
2e435f1452
1 changed files with 17 additions and 0 deletions
  1. 17 0
      dp/wifi3.0/dp_internal.h

+ 17 - 0
dp/wifi3.0/dp_internal.h

@@ -1520,4 +1520,21 @@ dp_get_vdev_from_soc_vdev_id_wifi3(struct dp_soc *soc,
 	return soc->vdev_id_map[vdev_id];
 }
 
+/**
+ * dp_get_pdev_from_soc_pdev_id_wifi3() - Returns pdev object given the pdev id
+ * @soc: core DP soc context
+ * @pdev_id: pdev id from pdev object can be retrieved
+ *
+ * Return: struct dp_pdev*: Pointer to DP pdev object
+ */
+static inline struct dp_pdev *
+dp_get_pdev_from_soc_pdev_id_wifi3(struct dp_soc *soc,
+				   uint8_t pdev_id)
+{
+	if (qdf_unlikely(pdev_id >= MAX_PDEV_CNT))
+		return NULL;
+
+	return soc->pdev_list[pdev_id];
+}
+
 #endif /* #ifndef _DP_INTERNAL_H_ */