qcacmn: Introduce API to find ML peer with same MAC

Introduce an API which iterates on each MLD dev context in the
global MLO device manager and the ML peers in each dev context,
the API returns true if any entity's MLD address matches with
the MAC address received or else returns false.

Change-Id: If98fb9667b797d7d2fcfe40f66afb2a44daf4874
CRs-Fixed: 3349575
这个提交包含在:
Vinod Kumar Pirla
2022-11-30 03:14:44 -08:00
提交者 Madan Koyyalamudi
父节点 2f56148a95
当前提交 a780b76595
修改 2 个文件,包含 71 行新增0 行删除

查看文件

@@ -812,6 +812,17 @@ QDF_STATUS wlan_mlo_check_valid_config(struct wlan_mlo_dev_context *ml_dev,
struct wlan_objmgr_pdev *pdev,
enum QDF_OPMODE opmode);
/**
* mlo_mgr_ml_peer_exist() - Check if MAC address matches any MLD address
* @peer_addr: Address to search for a match
*
* The API iterates through all the ML dev ctx in the driver and checks
* if MAC address pointed by @peer_addr matches the MLD address of
* MLD dev or any of the ML peers in the ML dev ctx.
*
* Return: True if a matching entity is found else false.
*/
bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr);
#else
static inline QDF_STATUS wlan_mlo_mgr_init(void)
{
@@ -829,5 +840,11 @@ wlan_mlo_mgr_update_mld_addr(struct qdf_mac_addr *old_mac,
{
return QDF_STATUS_SUCCESS;
}
static inline
bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr)
{
return false;
}
#endif
#endif

查看文件

@@ -260,6 +260,60 @@ bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr)
return false;
}
#ifdef WLAN_FEATURE_11BE_MLO
bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr)
{
qdf_list_t *ml_list;
struct wlan_mlo_dev_context *mld_cur, *mld_next;
struct wlan_mlo_peer_list *mlo_peer_list;
bool ret_status = false;
struct mlo_mgr_context *g_mlo_ctx = wlan_objmgr_get_mlo_ctx();
if (!g_mlo_ctx || !peer_addr ||
qdf_is_macaddr_zero((struct qdf_mac_addr *)peer_addr))
return ret_status;
ml_link_lock_acquire(g_mlo_ctx);
ml_list = &g_mlo_ctx->ml_dev_list;
if (!qdf_list_size(ml_list))
goto g_ml_ref;
mld_cur = mlo_list_peek_head(ml_list);
while (mld_cur) {
mlo_dev_lock_acquire(mld_cur);
if (qdf_is_macaddr_equal(&mld_cur->mld_addr,
(struct qdf_mac_addr *)peer_addr)) {
mlo_dev_lock_release(mld_cur);
mlo_err("MLD ID %d exists with mac " QDF_MAC_ADDR_FMT,
mld_cur->mld_id, QDF_MAC_ADDR_REF(peer_addr));
ret_status = true;
goto g_ml_ref;
}
/* Check the peer list for a MAC address match */
mlo_peer_list = &mld_cur->mlo_peer_list;
ml_peerlist_lock_acquire(mlo_peer_list);
if (mlo_get_mlpeer(mld_cur, (struct qdf_mac_addr *)peer_addr)) {
ml_peerlist_lock_release(mlo_peer_list);
mlo_dev_lock_release(mld_cur);
mlo_err("MLD ID %d ML Peer exists with mac " QDF_MAC_ADDR_FMT,
mld_cur->mld_id, QDF_MAC_ADDR_REF(peer_addr));
ret_status = true;
goto g_ml_ref;
}
ml_peerlist_lock_release(mlo_peer_list);
mld_next = mlo_get_next_mld_ctx(ml_list, mld_cur);
mlo_dev_lock_release(mld_cur);
mld_cur = mld_next;
}
g_ml_ref:
ml_link_lock_release(g_mlo_ctx);
return ret_status;
}
#endif
static QDF_STATUS mlo_ap_ctx_deinit(struct wlan_mlo_dev_context *ml_dev)
{
wlan_mlo_vdev_aid_mgr_deinit(ml_dev);