qcacmn: Support same link/mld peer mac address
Currently, if mld and link peer has the same mac address, the peer cannot distinguished with just the mac address as the search argument. Hence to support same mld/link peer mac address, cdp_peer APIs that uses both link and mld peers, are also given peer_type info. This helps to perform the operations on the correct peer. Change-Id: If646755facc8f9a4d9fed2f31c5cc6618fa9a952 CRs-Fixed: 3043428
This commit is contained in:

committed by
Madan Koyyalamudi

parent
9738cd5a32
commit
dc6a757028
@@ -1221,6 +1221,68 @@ dp_link_peer_hash_find_by_chip_id(struct dp_soc *soc,
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* dp_mld_peer_find_hash_find() - returns mld peer from mld peer_hash_table
|
||||
* matching mac_address
|
||||
* @soc: soc handle
|
||||
* @peer_mac_addr: mld peer mac address
|
||||
* @mac_addr_is_aligned: is mac addr alligned
|
||||
* @vdev_id: vdev_id
|
||||
* @mod_id: id of module requesting reference
|
||||
*
|
||||
* return: peer in sucsess
|
||||
* NULL in failure
|
||||
*/
|
||||
static inline
|
||||
struct dp_peer *dp_mld_peer_find_hash_find(struct dp_soc *soc,
|
||||
uint8_t *peer_mac_addr,
|
||||
int mac_addr_is_aligned,
|
||||
uint8_t vdev_id,
|
||||
enum dp_mod_id mod_id)
|
||||
{
|
||||
if (soc->arch_ops.mlo_peer_find_hash_find)
|
||||
return soc->arch_ops.mlo_peer_find_hash_find(soc,
|
||||
peer_mac_addr,
|
||||
mac_addr_is_aligned,
|
||||
mod_id, vdev_id);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_peer_hash_find_wrapper() - find link peer or mld per according to
|
||||
peer_type
|
||||
* @soc: DP SOC handle
|
||||
* @peer_info: peer information for hash find
|
||||
* @mod_id: ID of module requesting reference
|
||||
*
|
||||
* Return: peer hanlde
|
||||
*/
|
||||
static inline
|
||||
struct dp_peer *dp_peer_hash_find_wrapper(struct dp_soc *soc,
|
||||
struct cdp_peer_info *peer_info,
|
||||
enum dp_mod_id mod_id)
|
||||
{
|
||||
struct dp_peer *peer = NULL;
|
||||
|
||||
if (peer_info->peer_type == CDP_LINK_PEER_TYPE ||
|
||||
peer_info->peer_type == CDP_WILD_PEER_TYPE) {
|
||||
peer = dp_peer_find_hash_find(soc, peer_info->mac_addr,
|
||||
peer_info->mac_addr_is_aligned,
|
||||
peer_info->vdev_id,
|
||||
mod_id);
|
||||
if (peer)
|
||||
return peer;
|
||||
}
|
||||
if (peer_info->peer_type == CDP_MLD_PEER_TYPE ||
|
||||
peer_info->peer_type == CDP_WILD_PEER_TYPE)
|
||||
peer = dp_mld_peer_find_hash_find(
|
||||
soc, peer_info->mac_addr,
|
||||
peer_info->mac_addr_is_aligned,
|
||||
peer_info->vdev_id,
|
||||
mod_id);
|
||||
return peer;
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_link_peer_add_mld_peer() - add mld peer pointer to link peer,
|
||||
increase mld peer ref_cnt
|
||||
@@ -1471,8 +1533,7 @@ uint16_t dp_get_link_peer_id_by_lmac_id(struct dp_soc *soc, uint16_t peer_id,
|
||||
}
|
||||
|
||||
/**
|
||||
* dp_peer_get_tgt_peer_hash_find() - get MLD dp_peer handle
|
||||
for processing
|
||||
* dp_peer_get_tgt_peer_hash_find() - get dp_peer handle
|
||||
* @soc: soc handle
|
||||
* @peer_mac_addr: peer mac address
|
||||
* @mac_addr_is_aligned: is mac addr alligned
|
||||
@@ -1513,6 +1574,9 @@ struct dp_peer *dp_peer_get_tgt_peer_hash_find(struct dp_soc *soc,
|
||||
/* mlo MLD peer or non-mlo link peer */
|
||||
ta_peer = peer;
|
||||
}
|
||||
} else {
|
||||
dp_peer_err("fail to find peer:" QDF_MAC_ADDR_FMT,
|
||||
QDF_MAC_ADDR_REF(peer_mac));
|
||||
}
|
||||
|
||||
return ta_peer;
|
||||
@@ -1736,6 +1800,17 @@ dp_tgt_txrx_peer_get_ref_by_id(struct dp_soc *soc,
|
||||
#define IS_MLO_DP_MLD_PEER(_peer) false
|
||||
#define DP_GET_MLD_PEER_FROM_PEER(link_peer) NULL
|
||||
|
||||
static inline
|
||||
struct dp_peer *dp_peer_hash_find_wrapper(struct dp_soc *soc,
|
||||
struct cdp_peer_info *peer_info,
|
||||
enum dp_mod_id mod_id)
|
||||
{
|
||||
return dp_peer_find_hash_find(soc, peer_info->mac_addr,
|
||||
peer_info->mac_addr_is_aligned,
|
||||
peer_info->vdev_id,
|
||||
mod_id);
|
||||
}
|
||||
|
||||
static inline
|
||||
struct dp_peer *dp_peer_get_tgt_peer_hash_find(struct dp_soc *soc,
|
||||
uint8_t *peer_mac,
|
||||
|
Reference in New Issue
Block a user