qcacmn: Add multi group support for MGMT Rx Reordering

Add multi group support for MGMT Rx Re-ordering.

Change-Id: I2b172d1f0db58afee06db3eefc06b618fcf9a627
CRs-Fixed: 3343170
This commit is contained in:
Surya Prakash Raajen
2022-12-20 15:09:00 +05:30
committed by Madan Koyyalamudi
parent 4d5db3f69b
commit 6ef9d4cb8e
11 changed files with 392 additions and 121 deletions

View File

@@ -1,6 +1,6 @@
/*
* 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
* purpose with or without fee is hereby granted, provided that the above
@@ -301,6 +301,7 @@ void mlo_mlme_handle_sta_csa_param(struct wlan_objmgr_vdev *vdev,
#define INVALID_HW_LINK_ID 0xFFFF
#define WLAN_MLO_INVALID_NUM_LINKS (-1)
#ifdef WLAN_MLO_MULTI_CHIP
#define WLAN_MLO_GROUP_INVALID (-1)
/**
* wlan_mlo_get_max_num_links() - Get the maximum number of MLO links
* possible in the system
@@ -337,16 +338,34 @@ uint16_t wlan_mlo_get_valid_link_bitmap(uint8_t grp_id);
*/
uint16_t wlan_mlo_get_pdev_hw_link_id(struct wlan_objmgr_pdev *pdev);
/**
* wlan_mlo_get_psoc_group_id() - Get MLO group id of psoc
* @psoc: psoc object
*
* Return: MLO group id of the psoc
*/
uint8_t wlan_mlo_get_psoc_group_id(struct wlan_objmgr_psoc *psoc);
/**
* wlan_mlo_get_psoc_capable() - Get if MLO capable psoc
* @psoc: Pointer to psoc object
*
* Return: True if MLO capable else false
*/
bool wlan_mlo_get_psoc_capable(struct wlan_objmgr_psoc *psoc);
/**
* struct hw_link_id_iterator: Argument passed in psoc/pdev iterator to
* find pdev from hw_link_id
* @hw_link_id: HW link id of pdev to find
* @mlo_grp_id: MLO Group id which it belongs to
* @dbgid: Module ref id used in iterator
* @pdev: Pointer to pdev. This will be set inside itertor callback
* if hw_link_id match is found.
*/
struct hw_link_id_iterator {
uint16_t hw_link_id;
uint8_t mlo_grp_id;
wlan_objmgr_ref_dbgid dbgid;
struct wlan_objmgr_pdev *pdev;
};
@@ -354,6 +373,7 @@ struct hw_link_id_iterator {
/**
* wlan_objmgr_get_pdev_by_hw_link_id() - Get pdev object from hw_link_id
* @hw_link_id: HW link id of the pdev
* @ml_grp_id: MLO Group id which it belongs to
* @refdbgid: dbgid of module used for taking reference to pdev object
*
* Return: Pointer to pdev object if hw_link_id is valid. Else, NULL
@@ -361,7 +381,7 @@ struct hw_link_id_iterator {
* Caller should free this reference.
*/
struct wlan_objmgr_pdev *
wlan_mlo_get_pdev_by_hw_link_id(uint16_t hw_link_id,
wlan_mlo_get_pdev_by_hw_link_id(uint16_t hw_link_id, uint8_t ml_grp_id,
wlan_objmgr_ref_dbgid refdbgid);
#else
@@ -384,7 +404,7 @@ wlan_mlo_get_valid_link_bitmap(uint8_t grp_id)
}
static inline struct wlan_objmgr_pdev *
wlan_mlo_get_pdev_by_hw_link_id(uint16_t hw_link_id,
wlan_mlo_get_pdev_by_hw_link_id(uint16_t hw_link_id, uint8_t ml_grp_id,
wlan_objmgr_ref_dbgid refdbgid)
{
return NULL;
@@ -395,6 +415,18 @@ uint16_t wlan_mlo_get_pdev_hw_link_id(struct wlan_objmgr_pdev *pdev)
{
return INVALID_HW_LINK_ID;
}
static inline
uint8_t wlan_mlo_get_psoc_group_id(struct wlan_objmgr_psoc *psoc)
{
return -EINVAL;
}
static inline
bool wlan_mlo_get_psoc_capable(struct wlan_objmgr_psoc *psoc)
{
return false;
}
#endif/*WLAN_MLO_MULTI_CHIP*/
#ifdef WLAN_FEATURE_11BE_MLO

View File

@@ -1,6 +1,6 @@
/*
* 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
* purpose with or without fee is hereby granted, provided that the above
@@ -354,6 +354,47 @@ 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_group_id(struct wlan_objmgr_psoc *psoc)
{
struct wlan_lmac_if_tx_ops *tx_ops;
uint8_t ml_grp_id = WLAN_MLO_GROUP_INVALID;
if (!psoc) {
qdf_err("PSOC is NULL");
return -EINVAL;
}
tx_ops = wlan_psoc_get_lmac_if_txops(psoc);
if (tx_ops && tx_ops->mops.get_psoc_mlo_group_id)
ml_grp_id = tx_ops->mops.get_psoc_mlo_group_id(psoc);
return ml_grp_id;
}
qdf_export_symbol(wlan_mlo_get_psoc_group_id);
bool wlan_mlo_get_psoc_capable(struct wlan_objmgr_psoc *psoc)
{
struct target_psoc_info *tgt_hdl;
if (!psoc) {
qdf_err("PSOC is NULL");
return false;
}
tgt_hdl = wlan_psoc_get_tgt_if_handle(psoc);
if (!tgt_hdl) {
target_if_err("target_psoc_info is null");
return false;
}
if ((tgt_hdl->tif_ops) &&
(tgt_hdl->tif_ops->mlo_capable))
return tgt_hdl->tif_ops->mlo_capable(psoc);
return false;
}
uint16_t wlan_mlo_get_pdev_hw_link_id(struct wlan_objmgr_pdev *pdev)
{
struct wlan_objmgr_psoc *psoc;
@@ -378,10 +419,18 @@ static void wlan_pdev_hw_link_iterator(struct wlan_objmgr_psoc *psoc,
struct hw_link_id_iterator *itr = (struct hw_link_id_iterator *)arg;
struct wlan_objmgr_pdev *pdev = (struct wlan_objmgr_pdev *)obj;
uint16_t hw_link_id;
uint8_t ml_grp_id;
if (itr->pdev)
return;
ml_grp_id = wlan_mlo_get_psoc_group_id(psoc);
if (ml_grp_id > WLAN_MAX_MLO_GROUPS)
return;
if (ml_grp_id != itr->mlo_grp_id)
return;
hw_link_id = wlan_mlo_get_pdev_hw_link_id(pdev);
if (hw_link_id == itr->hw_link_id) {
if (wlan_objmgr_pdev_try_get_ref(pdev, itr->dbgid) ==
@@ -402,13 +451,14 @@ static void wlan_mlo_find_hw_link_id(struct wlan_objmgr_psoc *psoc,
}
struct wlan_objmgr_pdev *
wlan_mlo_get_pdev_by_hw_link_id(uint16_t hw_link_id,
wlan_mlo_get_pdev_by_hw_link_id(uint16_t hw_link_id, uint8_t ml_grp_id,
wlan_objmgr_ref_dbgid refdbgid)
{
struct hw_link_id_iterator itr;
itr.hw_link_id = hw_link_id;
itr.pdev = NULL;
itr.mlo_grp_id = ml_grp_id;
itr.dbgid = refdbgid;
wlan_objmgr_iterate_psoc_list(wlan_mlo_find_hw_link_id,