qcacmn: Add support to find ML peer from MLD MAC

Add API to retrieve ML peer context using peer MLD address
from the list of MLDs.

Change-Id: I7136e6b9cbcc96e897457c01c187965978e85d77
CRs-Fixed: 3422684
This commit is contained in:
Rhythm Patwa
2023-03-02 01:43:19 -08:00
committed by Madan Koyyalamudi
orang tua 1bce26bfca
melakukan aa8703f473
5 mengubah file dengan 83 tambahan dan 10 penghapusan

Melihat File

@@ -886,6 +886,30 @@ uint8_t wlan_mlo_get_sta_mld_ctx_count(void);
struct wlan_mlo_dev_context struct wlan_mlo_dev_context
*wlan_mlo_get_mld_ctx_by_mldaddr(struct qdf_mac_addr *mldaddr); *wlan_mlo_get_mld_ctx_by_mldaddr(struct qdf_mac_addr *mldaddr);
/**
* wlan_mlo_list_peek_head() - Returns the head of linked list
*
* @ml_list: Pointer to the list of MLDs
*
* API to retrieve the head from the list of active MLDs
*
* Return: Pointer to mlo device context
*/
struct wlan_mlo_dev_context *wlan_mlo_list_peek_head(qdf_list_t *ml_list);
/**
* wlan_mlo_get_next_mld_ctx() - Return next mlo dev node from the list
*
* @ml_list: Pointer to the list of MLDs
* @mld_cur: Pointer to the current mlo dev node
*
* API to retrieve the next node from the list of active MLDs
*
* Return: Pointer to mlo device context
*/
struct wlan_mlo_dev_context *wlan_mlo_get_next_mld_ctx(qdf_list_t *ml_list,
struct wlan_mlo_dev_context *mld_cur);
/** /**
* wlan_mlo_check_valid_config() - Check vap config is valid for mld * wlan_mlo_check_valid_config() - Check vap config is valid for mld
* *

Melihat File

@@ -434,6 +434,19 @@ struct wlan_mlo_peer_context *wlan_mlo_get_mlpeer_by_mld_mac(
struct wlan_mlo_dev_context *ml_dev, struct wlan_mlo_dev_context *ml_dev,
struct qdf_mac_addr *mld_mac); struct qdf_mac_addr *mld_mac);
/**
* wlan_mlo_get_mlpeer_by_peer_mladdr() - Get ML peer from the list of MLD's
* using MLD MAC address
*
* @mldaddr: MAC address of the ML peer
* @mldev: Update corresponding ML dev context in which peer is found
*
* Return: Pointer to mlo peer context
*/
struct wlan_mlo_peer_context
*wlan_mlo_get_mlpeer_by_peer_mladdr(struct qdf_mac_addr *mldaddr,
struct wlan_mlo_dev_context **mldev);
/** /**
* wlan_mlo_get_mlpeer_by_aid() - find ML peer by AID * wlan_mlo_get_mlpeer_by_aid() - find ML peer by AID
* @ml_dev: MLO DEV object * @ml_dev: MLO DEV object

Melihat File

@@ -103,11 +103,16 @@ enum wlan_link_band_caps {
* is present. * is present.
* @pref_order: Preferred links in order.it is in form of hardware link id. * @pref_order: Preferred links in order.it is in form of hardware link id.
* @timeout: timeout values for all the access categories. * @timeout: timeout values for all the access categories.
* @tlt_characterization_params: Bitmask to select Tx-Link Tuple from ordered
* list.
* Bit 0-15: Each bit maps to the corresponding Link ID
* Bit 16-31: Reserved
*/ */
struct wlan_link_preference { struct wlan_link_preference {
uint8_t num_pref_links; uint8_t num_pref_links;
uint8_t pref_order[MAX_PREFERRED_LINKS]; uint8_t pref_order[MAX_PREFERRED_LINKS];
uint32_t timeout[WIFI_AC_MAX]; uint32_t timeout[WIFI_AC_MAX];
uint32_t tlt_characterization_params;
}; };
/** /**

Melihat File

@@ -179,7 +179,7 @@ QDF_STATUS wlan_mlo_mgr_deinit(void)
return status; return status;
} }
static inline struct wlan_mlo_dev_context *mlo_list_peek_head( struct wlan_mlo_dev_context *wlan_mlo_list_peek_head(
qdf_list_t *ml_list) qdf_list_t *ml_list)
{ {
struct wlan_mlo_dev_context *mld_ctx; struct wlan_mlo_dev_context *mld_ctx;
@@ -195,8 +195,7 @@ static inline struct wlan_mlo_dev_context *mlo_list_peek_head(
return mld_ctx; return mld_ctx;
} }
static inline struct wlan_mlo_dev_context *wlan_mlo_get_next_mld_ctx(qdf_list_t *ml_list,
struct wlan_mlo_dev_context *mlo_get_next_mld_ctx(qdf_list_t *ml_list,
struct wlan_mlo_dev_context *mld_cur) struct wlan_mlo_dev_context *mld_cur)
{ {
struct wlan_mlo_dev_context *mld_next; struct wlan_mlo_dev_context *mld_next;
@@ -230,13 +229,13 @@ uint8_t wlan_mlo_get_sta_mld_ctx_count(void)
ml_link_lock_acquire(mlo_mgr_ctx); ml_link_lock_acquire(mlo_mgr_ctx);
ml_list = &mlo_mgr_ctx->ml_dev_list; ml_list = &mlo_mgr_ctx->ml_dev_list;
/* Get first mld context */ /* Get first mld context */
mld_cur = mlo_list_peek_head(ml_list); mld_cur = wlan_mlo_list_peek_head(ml_list);
while (mld_cur) { while (mld_cur) {
/* get next mld node */ /* get next mld node */
if (mld_cur->sta_ctx) if (mld_cur->sta_ctx)
count++; count++;
mld_next = mlo_get_next_mld_ctx(ml_list, mld_cur); mld_next = wlan_mlo_get_next_mld_ctx(ml_list, mld_cur);
mld_cur = mld_next; mld_cur = mld_next;
} }
ml_link_lock_release(mlo_mgr_ctx); ml_link_lock_release(mlo_mgr_ctx);
@@ -258,7 +257,7 @@ struct wlan_mlo_dev_context
ml_link_lock_acquire(mlo_mgr_ctx); ml_link_lock_acquire(mlo_mgr_ctx);
ml_list = &mlo_mgr_ctx->ml_dev_list; ml_list = &mlo_mgr_ctx->ml_dev_list;
/* Get first mld context */ /* Get first mld context */
mld_cur = mlo_list_peek_head(ml_list); mld_cur = wlan_mlo_list_peek_head(ml_list);
/** /**
* Iterate through ml list, till ml mldaddr matches with * Iterate through ml list, till ml mldaddr matches with
* entry of list * entry of list
@@ -270,7 +269,7 @@ struct wlan_mlo_dev_context
return mld_cur; return mld_cur;
} }
/* get next mld node */ /* get next mld node */
mld_next = mlo_get_next_mld_ctx(ml_list, mld_cur); mld_next = wlan_mlo_get_next_mld_ctx(ml_list, mld_cur);
mld_cur = mld_next; mld_cur = mld_next;
} }
ml_link_lock_release(mlo_mgr_ctx); ml_link_lock_release(mlo_mgr_ctx);
@@ -310,7 +309,7 @@ bool mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t *peer_addr,
if (!qdf_list_size(ml_list)) if (!qdf_list_size(ml_list))
goto g_ml_ref; goto g_ml_ref;
mld_cur = mlo_list_peek_head(ml_list); mld_cur = wlan_mlo_list_peek_head(ml_list);
while (mld_cur) { while (mld_cur) {
mlo_dev_lock_acquire(mld_cur); mlo_dev_lock_acquire(mld_cur);
if (qdf_is_macaddr_equal(&mld_cur->mld_addr, if (qdf_is_macaddr_equal(&mld_cur->mld_addr,
@@ -369,7 +368,7 @@ bool mlo_mgr_ml_peer_exist_on_diff_ml_ctx(uint8_t *peer_addr,
} }
ml_peerlist_lock_release(mlo_peer_list); ml_peerlist_lock_release(mlo_peer_list);
mld_next = mlo_get_next_mld_ctx(ml_list, mld_cur); mld_next = wlan_mlo_get_next_mld_ctx(ml_list, mld_cur);
mlo_dev_lock_release(mld_cur); mlo_dev_lock_release(mld_cur);
mld_cur = mld_next; mld_cur = mld_next;
} }

Melihat File

@@ -1,6 +1,6 @@
/* /*
* Copyright (c) 2021, The Linux Foundation. All rights reserved. * Copyright (c) 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved. * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for any * Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above * purpose with or without fee is hereby granted, provided that the above
@@ -294,6 +294,38 @@ struct wlan_mlo_peer_context *wlan_mlo_get_mlpeer_by_mld_mac(
return NULL; return NULL;
} }
struct wlan_mlo_peer_context
*wlan_mlo_get_mlpeer_by_peer_mladdr(struct qdf_mac_addr *mldaddr,
struct wlan_mlo_dev_context **mldev)
{
struct wlan_mlo_dev_context *mld_cur;
struct wlan_mlo_dev_context *mld_next;
struct wlan_mlo_peer_context *ml_peer;
qdf_list_t *ml_list;
struct mlo_mgr_context *mlo_mgr_ctx = wlan_objmgr_get_mlo_ctx();
if (!mlo_mgr_ctx)
return NULL;
ml_link_lock_acquire(mlo_mgr_ctx);
ml_list = &mlo_mgr_ctx->ml_dev_list;
mld_cur = wlan_mlo_list_peek_head(ml_list);
while (mld_cur) {
ml_peer = mlo_get_mlpeer(mld_cur, mldaddr);
if (ml_peer != NULL) {
*mldev = mld_cur;
ml_link_lock_release(mlo_mgr_ctx);
return ml_peer;
}
mld_next = wlan_mlo_get_next_mld_ctx(ml_list, mld_cur);
mld_cur = mld_next;
}
ml_link_lock_release(mlo_mgr_ctx);
return NULL;
}
struct wlan_mlo_peer_context *wlan_mlo_get_mlpeer_by_ml_peerid( struct wlan_mlo_peer_context *wlan_mlo_get_mlpeer_by_ml_peerid(
struct wlan_mlo_dev_context *ml_dev, struct wlan_mlo_dev_context *ml_dev,
uint16_t ml_peerid) uint16_t ml_peerid)