qcacmn: Add an API to get number of station mld device contexts

Add an API to get number of station mld device contexts

Change-Id: I91bdbfda36e596b7456482f5f0480a341d4e6ed5
CRs-Fixed: 3361088
This commit is contained in:
Neha Bisht
2022-12-15 10:54:10 +05:30
zatwierdzone przez Madan Koyyalamudi
rodzic c811b9d544
commit f27e31059b
2 zmienionych plików z 43 dodań i 0 usunięć

Wyświetl plik

@@ -784,6 +784,15 @@ QDF_STATUS wlan_mlo_mgr_update_mld_addr(struct qdf_mac_addr *old_mac,
*/
bool wlan_mlo_is_mld_ctx_exist(struct qdf_mac_addr *mldaddr);
/**
* wlan_mlo_get_sta_mld_ctx_count() - Get number of sta mld device context
*
* API to get number of sta mld device context
*
* Return: number of sta mld device context
*/
uint8_t wlan_mlo_get_sta_mld_ctx_count(void);
/**
* wlan_mlo_get_mld_ctx_by_mldaddr() - Get mld device context using mld
* MAC address
@@ -846,5 +855,11 @@ bool mlo_mgr_ml_peer_exist(uint8_t *peer_addr)
{
return false;
}
static inline
uint8_t wlan_mlo_get_sta_mld_ctx_count(void)
{
return 0;
}
#endif
#endif

Wyświetl plik

@@ -216,6 +216,34 @@ struct wlan_mlo_dev_context *mlo_get_next_mld_ctx(qdf_list_t *ml_list,
return mld_next;
}
uint8_t wlan_mlo_get_sta_mld_ctx_count(void)
{
struct wlan_mlo_dev_context *mld_cur;
struct wlan_mlo_dev_context *mld_next;
qdf_list_t *ml_list;
struct mlo_mgr_context *mlo_mgr_ctx = wlan_objmgr_get_mlo_ctx();
uint8_t count = 0;
if (!mlo_mgr_ctx)
return count;
ml_link_lock_acquire(mlo_mgr_ctx);
ml_list = &mlo_mgr_ctx->ml_dev_list;
/* Get first mld context */
mld_cur = mlo_list_peek_head(ml_list);
while (mld_cur) {
/* get next mld node */
if (mld_cur->sta_ctx)
count++;
mld_next = mlo_get_next_mld_ctx(ml_list, mld_cur);
mld_cur = mld_next;
}
ml_link_lock_release(mlo_mgr_ctx);
return count;
}
struct wlan_mlo_dev_context
*wlan_mlo_get_mld_ctx_by_mldaddr(struct qdf_mac_addr *mldaddr)
{