Explorar el Código

qcacmn: Cleanup dp_clear_peer [PEER_ID_PHASE1]

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

Also, modify the API cdp_clear_peer with addition argument
for peer mac address.

Change-Id: I1bd3fab1b9510b5f1d4476e11b617fcb6417f2c4
CRs-Fixed: 2503774
Rakshith Suresh Patkar hace 5 años
padre
commit
0375108ffa
Se han modificado 4 ficheros con 15 adiciones y 8 borrados
  1. 2 1
      dp/inc/cdp_txrx_ops.h
  2. 4 3
      dp/inc/cdp_txrx_peer_ops.h
  3. 2 1
      dp/wifi3.0/dp_internal.h
  4. 7 3
      dp/wifi3.0/dp_peer.c

+ 2 - 1
dp/inc/cdp_txrx_ops.h

@@ -1102,7 +1102,8 @@ struct cdp_ocb_ops {
 struct cdp_peer_ops {
 	QDF_STATUS (*register_peer)(struct cdp_pdev *pdev,
 			struct ol_txrx_desc_type *sta_desc);
-	QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev, uint8_t sta_id);
+	QDF_STATUS (*clear_peer)(struct cdp_pdev *pdev,
+				 struct qdf_mac_addr peer_addr);
 	QDF_STATUS (*change_peer_state)(uint8_t sta_id,
 			enum ol_txrx_peer_state sta_state,
 			bool roam_synch_in_progress);

+ 4 - 3
dp/inc/cdp_txrx_peer_ops.h

@@ -57,7 +57,7 @@ cdp_peer_register(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
  * cdp_clear_peer() - remove peer from physical device
  * @soc - data path soc handle
  * @pdev - data path device instance
- * @sta_id - local peer id
+ * @peer_addr - peer mac address
  *
  * remove peer from physical device
  *
@@ -65,7 +65,8 @@ cdp_peer_register(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
  *         QDF_STATUS_E_NOSUPPORT not support this feature
  */
 static inline QDF_STATUS
-cdp_clear_peer(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, uint8_t sta_id)
+cdp_clear_peer(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,
@@ -74,7 +75,7 @@ cdp_clear_peer(ol_txrx_soc_handle soc, struct cdp_pdev *pdev, uint8_t sta_id)
 	}
 
 	if (soc->ops->peer_ops->clear_peer)
-		return soc->ops->peer_ops->clear_peer(pdev, sta_id);
+		return soc->ops->peer_ops->clear_peer(pdev, peer_addr);
 
 	return QDF_STATUS_E_NOSUPPORT;
 }

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

@@ -788,7 +788,8 @@ extern struct dp_peer *dp_peer_find_hash_find(struct dp_soc *soc,
 #ifdef DP_PEER_EXTENDED_API
 QDF_STATUS dp_register_peer(struct cdp_pdev *pdev_handle,
 		struct ol_txrx_desc_type *sta_desc);
-QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle, uint8_t local_id);
+QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle,
+			 struct qdf_mac_addr peer_addr);
 void *dp_find_peer_by_addr_and_vdev(struct cdp_pdev *pdev_handle,
 		struct cdp_vdev *vdev,
 		uint8_t *peer_addr, uint8_t *local_id);

+ 7 - 3
dp/wifi3.0/dp_peer.c

@@ -2949,19 +2949,23 @@ QDF_STATUS dp_register_peer(struct cdp_pdev *pdev_handle,
 /**
  * dp_clear_peer() - remove peer from physical device
  * @pdev - data path device instance
- * @sta_id - local peer id
+ * @peer_addr - peer mac address
  *
  * remove peer from physical device
  *
  * Return: QDF_STATUS_SUCCESS registration success
  *         QDF_STATUS_E_FAULT peer not found
  */
-QDF_STATUS dp_clear_peer(struct cdp_pdev *pdev_handle, uint8_t local_id)
+QDF_STATUS
+dp_clear_peer(struct cdp_pdev *pdev_handle, struct qdf_mac_addr peer_addr)
 {
 	struct dp_peer *peer;
 	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+	/* peer_id to be removed */
+	uint8_t peer_id;
 
-	peer = dp_peer_find_by_local_id((struct cdp_pdev *)pdev, local_id);
+	peer = dp_find_peer_by_addr((struct cdp_pdev *)pdev, peer_addr.bytes,
+				    &peer_id);
 	if (!peer)
 		return QDF_STATUS_E_FAULT;