qcacmn: Define API to get the link peer_id using peer_id and lmac_id
Define API to get the link peer_id using peer_id and lmac_id. This is required in Rx monitor path for stats updation as Rx monitor provides MLD peer id, whereas stats updation is done for link peer. Change-Id: Ib1c9e2729ccaea2e28272b7d175b3ef7fba9fd7a CRs-Fixed: 3133003
This commit is contained in:

committed by
Madan Koyyalamudi

parent
f94ac12152
commit
c4f3ae13ee
@@ -1397,6 +1397,56 @@ void dp_release_link_peers_ref(
|
|||||||
mld_link_peers->num_links = 0;
|
mld_link_peers->num_links = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_get_link_peer_id_by_lmac_id() - Get link peer id using peer id and lmac id
|
||||||
|
* @soc: Datapath soc handle
|
||||||
|
* @peer_id: peer id
|
||||||
|
* @lmac_id: lmac id to find the link peer on given lmac
|
||||||
|
*
|
||||||
|
* Return: peer_id of link peer if found
|
||||||
|
* else return HTT_INVALID_PEER
|
||||||
|
*/
|
||||||
|
static inline
|
||||||
|
uint16_t dp_get_link_peer_id_by_lmac_id(struct dp_soc *soc, uint16_t peer_id,
|
||||||
|
uint8_t lmac_id)
|
||||||
|
{
|
||||||
|
uint8_t i;
|
||||||
|
struct dp_peer *peer;
|
||||||
|
struct dp_peer *link_peer;
|
||||||
|
struct dp_soc *link_peer_soc;
|
||||||
|
struct dp_mld_link_peers link_peers_info;
|
||||||
|
uint16_t link_peer_id = HTT_INVALID_PEER;
|
||||||
|
|
||||||
|
peer = dp_peer_get_ref_by_id(soc, peer_id, DP_MOD_ID_CDP);
|
||||||
|
|
||||||
|
if (!peer)
|
||||||
|
return HTT_INVALID_PEER;
|
||||||
|
|
||||||
|
if (IS_MLO_DP_MLD_PEER(peer)) {
|
||||||
|
/* get link peers with reference */
|
||||||
|
dp_get_link_peers_ref_from_mld_peer(soc, peer, &link_peers_info,
|
||||||
|
DP_MOD_ID_CDP);
|
||||||
|
|
||||||
|
for (i = 0; i < link_peers_info.num_links; i++) {
|
||||||
|
link_peer = link_peers_info.link_peers[i];
|
||||||
|
link_peer_soc = link_peer->vdev->pdev->soc;
|
||||||
|
if ((link_peer_soc == soc) &&
|
||||||
|
(link_peer->vdev->pdev->lmac_id == lmac_id)) {
|
||||||
|
link_peer_id = link_peer->peer_id;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* release link peers reference */
|
||||||
|
dp_release_link_peers_ref(&link_peers_info, DP_MOD_ID_CDP);
|
||||||
|
} else {
|
||||||
|
link_peer_id = peer_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
dp_peer_unref_delete(peer, DP_MOD_ID_CDP);
|
||||||
|
|
||||||
|
return link_peer_id;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dp_peer_get_tgt_peer_hash_find() - get MLD dp_peer handle
|
* dp_peer_get_tgt_peer_hash_find() - get MLD dp_peer handle
|
||||||
for processing
|
for processing
|
||||||
@@ -1783,6 +1833,12 @@ dp_tgt_txrx_peer_get_ref_by_id(struct dp_soc *soc,
|
|||||||
return dp_txrx_peer_get_ref_by_id(soc, peer_id, handle, mod_id);
|
return dp_txrx_peer_get_ref_by_id(soc, peer_id, handle, mod_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline
|
||||||
|
uint16_t dp_get_link_peer_id_by_lmac_id(struct dp_soc *soc, uint16_t peer_id,
|
||||||
|
uint8_t lmac_id)
|
||||||
|
{
|
||||||
|
return peer_id;
|
||||||
|
}
|
||||||
#endif /* WLAN_FEATURE_11BE_MLO */
|
#endif /* WLAN_FEATURE_11BE_MLO */
|
||||||
|
|
||||||
#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
|
#if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP)
|
||||||
|
Reference in New Issue
Block a user