From b57fbc13f4d604dffef37db5941c4e2c9bc84d1a Mon Sep 17 00:00:00 2001 From: Chaithanya Garrepalli Date: Tue, 14 Mar 2023 18:35:35 +0530 Subject: [PATCH] qcacmn: Add umac callback to get MLO chip ID Add new MLO mgr callback to return MLO chip ID Change-Id: I214b600830991f846ded208b16ed2fb1407a5a28 CRs-Fixed: 3432589 --- .../lmac_if/inc/wlan_lmac_if_def.h | 8 +++++--- umac/mlo_mgr/inc/wlan_mlo_mgr_cmn.h | 9 +++++++++ umac/mlo_mgr/src/wlan_mlo_mgr_cmn.c | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 9bb9540c2b..3f71cc31d6 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -486,9 +486,10 @@ enum wlan_mlme_cfg_id; * @vdev_mgr_rsp_timer_stop: * @get_hw_link_id: Get hw_link_id for pdev * @get_psoc_mlo_group_id: Get MLO Group ID for the psoc - * @target_if_mlo_setup_req: - * @target_if_mlo_ready: - * @target_if_mlo_teardown_req: + * @get_psoc_mlo_chip_id: Get MLO chip ID for the psoc + * @target_if_mlo_setup_req: MLO setup request + * @target_if_mlo_ready: MLO ready event + * @target_if_mlo_teardown_req: MLO teardown * @vdev_send_set_mac_addr: API to send set MAC address request to FW * @vdev_peer_set_param_send: API to send peer param to FW */ @@ -576,6 +577,7 @@ struct wlan_lmac_if_mlme_tx_ops { #if defined(WLAN_FEATURE_11BE_MLO) && defined(WLAN_MLO_MULTI_CHIP) uint16_t (*get_hw_link_id)(struct wlan_objmgr_pdev *pdev); uint8_t (*get_psoc_mlo_group_id)(struct wlan_objmgr_psoc *psoc); + uint8_t (*get_psoc_mlo_chip_id)(struct wlan_objmgr_psoc *psoc); QDF_STATUS (*target_if_mlo_setup_req)(struct wlan_objmgr_pdev **pdev, uint8_t num_pdevs, uint8_t grp_id); diff --git a/umac/mlo_mgr/inc/wlan_mlo_mgr_cmn.h b/umac/mlo_mgr/inc/wlan_mlo_mgr_cmn.h index 0182c17d0e..ffb6e92860 100644 --- a/umac/mlo_mgr/inc/wlan_mlo_mgr_cmn.h +++ b/umac/mlo_mgr/inc/wlan_mlo_mgr_cmn.h @@ -316,6 +316,7 @@ void mlo_mlme_handle_sta_csa_param(struct wlan_objmgr_vdev *vdev, #define WLAN_MLO_INVALID_NUM_LINKS (-1) #ifdef WLAN_MLO_MULTI_CHIP #define WLAN_MLO_GROUP_INVALID (-1) +#define WLAN_MLO_CHIP_ID_INVALID (-1) /** * wlan_mlo_get_max_num_links() - Get the maximum number of MLO links * possible in the system @@ -360,6 +361,14 @@ uint16_t wlan_mlo_get_pdev_hw_link_id(struct wlan_objmgr_pdev *pdev); */ uint8_t wlan_mlo_get_psoc_group_id(struct wlan_objmgr_psoc *psoc); +/** + * wlan_mlo_get_psoc_mlo_chip_id() - Get MLO chip id of psoc + * @psoc: psoc object + * + * Return: MLO group id of the psoc + */ +uint8_t wlan_mlo_get_psoc_mlo_chip_id(struct wlan_objmgr_psoc *psoc); + /** * wlan_mlo_get_psoc_capable() - Get if MLO capable psoc * @psoc: Pointer to psoc object diff --git a/umac/mlo_mgr/src/wlan_mlo_mgr_cmn.c b/umac/mlo_mgr/src/wlan_mlo_mgr_cmn.c index 7424d6afdf..cb00c60231 100644 --- a/umac/mlo_mgr/src/wlan_mlo_mgr_cmn.c +++ b/umac/mlo_mgr/src/wlan_mlo_mgr_cmn.c @@ -369,6 +369,25 @@ uint16_t wlan_mlo_get_valid_link_bitmap(uint8_t grp_id) return mlo_ctx->setup_info[grp_id].valid_link_bitmap; } +uint8_t wlan_mlo_get_psoc_mlo_chip_id(struct wlan_objmgr_psoc *psoc) +{ + struct wlan_lmac_if_tx_ops *tx_ops; + uint8_t mlo_chip_id = WLAN_MLO_CHIP_ID_INVALID; + + if (!psoc) { + qdf_err("PSOC is NULL"); + return mlo_chip_id; + } + + tx_ops = wlan_psoc_get_lmac_if_txops(psoc); + if (tx_ops && tx_ops->mops.get_psoc_mlo_chip_id) + mlo_chip_id = tx_ops->mops.get_psoc_mlo_chip_id(psoc); + + return mlo_chip_id; +} + +qdf_export_symbol(wlan_mlo_get_psoc_mlo_chip_id); + uint8_t wlan_mlo_get_psoc_group_id(struct wlan_objmgr_psoc *psoc) { struct wlan_lmac_if_tx_ops *tx_ops;