浏览代码

qcacmn: Cleanup dp_get_vdev_by_sta_id [PEER_ID_PHASE1]

Cleanup dp_get_vdev_by_sta_id to be peer mac address based
from local peer id based.

Also, modify the API cdp_peer_get_vdev_by_sta_id with additional
argument for peer mac address.
Rename cdp_peer_get_vdev_by_sta_id to cdp_peer_get_vdev_by_peer_addr.

Change-Id: I889538b5ea7ebac8973dcaaa5ebdad1ac495e791
CRs-Fixed: 2504569
Rakshith Suresh Patkar 5 年之前
父节点
当前提交
fb42ec3909
共有 5 个文件被更改,包括 23 次插入22 次删除
  1. 2 2
      dp/inc/cdp_txrx_ops.h
  2. 6 5
      dp/inc/cdp_txrx_peer_ops.h
  3. 2 2
      dp/wifi3.0/dp_internal.h
  4. 1 1
      dp/wifi3.0/dp_main.c
  5. 12 12
      dp/wifi3.0/dp_peer.c

+ 2 - 2
dp/inc/cdp_txrx_ops.h

@@ -1129,8 +1129,8 @@ struct cdp_peer_ops {
 			uint8_t *peer_addr,
 			enum ol_txrx_peer_state state);
 	QDF_STATUS (*get_vdevid)(void *peer, uint8_t *vdev_id);
-	struct cdp_vdev * (*get_vdev_by_sta_id)(struct cdp_pdev *pdev,
-			uint8_t sta_id);
+	struct cdp_vdev * (*get_vdev_by_peer_addr)(struct cdp_pdev *pdev,
+			struct qdf_mac_addr peer_addr);
 	QDF_STATUS (*register_ocb_peer)(uint8_t *mac_addr, uint8_t *peer_id);
 	uint8_t * (*peer_get_peer_mac_addr)(void *peer);
 	int (*get_peer_state)(void *peer);

+ 6 - 5
dp/inc/cdp_txrx_peer_ops.h

@@ -414,7 +414,7 @@ cdp_peer_get_vdevid(ol_txrx_soc_handle soc, void *peer, uint8_t *vdev_id)
  * cdp_peer_get_vdev_by_sta_id() - Get vdev instance by local peer id
  * @soc - data path soc handle
  * @pdev - data path device instance
- * @sta_id - local peer id
+ * @peer_addr - peer mac address
  *
  * Get virtual interface id by local peer id
  *
@@ -422,8 +422,8 @@ cdp_peer_get_vdevid(ol_txrx_soc_handle soc, void *peer, uint8_t *vdev_id)
  *         NULL in case cannot find
  */
 static inline struct cdp_vdev
-*cdp_peer_get_vdev_by_sta_id(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
-			     uint8_t sta_id)
+*cdp_peer_get_vdev_by_peer_addr(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
+				struct qdf_mac_addr peer_addr)
 {
 	if (!soc || !soc->ops || !soc->ops->peer_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -431,8 +431,9 @@ static inline struct cdp_vdev
 		return NULL;
 	}
 
-	if (soc->ops->peer_ops->get_vdev_by_sta_id)
-		return soc->ops->peer_ops->get_vdev_by_sta_id(pdev, sta_id);
+	if (soc->ops->peer_ops->get_vdev_by_peer_addr)
+		return soc->ops->peer_ops->get_vdev_by_peer_addr(pdev,
+								 peer_addr);
 
 	return NULL;
 }

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

@@ -798,8 +798,8 @@ void *dp_peer_find_by_local_id(struct cdp_pdev *pdev_handle, uint8_t local_id);
 QDF_STATUS dp_peer_state_update(struct cdp_pdev *pdev_handle, uint8_t *peer_mac,
 		enum ol_txrx_peer_state state);
 QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id);
-struct cdp_vdev *dp_get_vdev_by_sta_id(struct cdp_pdev *pdev_handle,
-		uint8_t sta_id);
+struct cdp_vdev *dp_get_vdev_by_peer_addr(struct cdp_pdev *pdev_handle,
+		struct qdf_mac_addr peer_addr);
 struct cdp_vdev *dp_get_vdev_for_peer(void *peer);
 uint8_t *dp_peer_get_peer_mac_addr(void *peer);
 int dp_get_peer_state(void *peer_handle);

+ 1 - 1
dp/wifi3.0/dp_main.c

@@ -9660,7 +9660,7 @@ static struct cdp_peer_ops dp_ops_peer = {
 	.peer_find_by_local_id = dp_peer_find_by_local_id,
 	.peer_state_update = dp_peer_state_update,
 	.get_vdevid = dp_get_vdevid,
-	.get_vdev_by_sta_id = dp_get_vdev_by_sta_id,
+	.get_vdev_by_peer_addr = dp_get_vdev_by_peer_addr,
 	.peer_get_peer_mac_addr = dp_peer_get_peer_mac_addr,
 	.get_vdev_for_peer = dp_get_vdev_for_peer,
 	.get_peer_state = dp_get_peer_state,

+ 12 - 12
dp/wifi3.0/dp_peer.c

@@ -3110,28 +3110,28 @@ QDF_STATUS dp_get_vdevid(void *peer_handle, uint8_t *vdev_id)
 	return QDF_STATUS_SUCCESS;
 }
 
-struct cdp_vdev *dp_get_vdev_by_sta_id(struct cdp_pdev *pdev_handle,
-				       uint8_t sta_id)
+struct cdp_vdev *
+dp_get_vdev_by_peer_addr(struct cdp_pdev *pdev_handle,
+			 struct qdf_mac_addr peer_addr)
 {
 	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 	struct dp_peer *peer = NULL;
-
-	if (sta_id >= WLAN_MAX_STA_COUNT) {
-		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
-			  "Invalid sta id passed");
-		return NULL;
-	}
+	/* peer_id to be removed PEER_ID_CLEANUP */
+	uint8_t peer_id;
 
 	if (!pdev) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
-			  "PDEV not found for sta_id [%d]", sta_id);
+			  "PDEV not found for peer_addr: ", QDF_MAC_ADDR_STR,
+			  QDF_MAC_ADDR_ARRAY(peer_addr.bytes));
 		return NULL;
 	}
 
-	peer = dp_peer_find_by_local_id((struct cdp_pdev *)pdev, sta_id);
+	peer = dp_find_peer_by_addr((struct cdp_pdev *)pdev, peer_addr.bytes,
+				    &peer_id);
 	if (!peer) {
-		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
-			  "PEER [%d] not found", sta_id);
+		QDF_TRACE(QDF_MODULE_ID_TXRX, QDF_TRACE_LEVEL_INFO_HIGH,
+			  "PDEV not found for peer_addr:" QDF_MAC_ADDR_STR,
+			  QDF_MAC_ADDR_ARRAY(peer_addr.bytes));
 		return NULL;
 	}