qcacmn: Add vdev_id to vdev_handle map in dp
Add a vdev_id to vdev_handle map in dp for faster retrieval of vdev using vdev_id. Change-Id: Ie19e09dd2e2b3d99317146d1b4cecdb5147a3cdd
This commit is contained in:

committed by
nshrivas

parent
0336eb937e
commit
5d3171d70e
@@ -1502,4 +1502,22 @@ void dp_rx_fst_detach(struct dp_soc *soc, struct dp_pdev *pdev)
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
|
#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dp_get_vdev_from_soc_vdev_id_wifi3() - Returns vdev object given the vdev id
|
||||||
|
* @soc: core DP soc context
|
||||||
|
* @vdev_id: vdev id from vdev object can be retrieved
|
||||||
|
*
|
||||||
|
* Return: struct dp_vdev*: Pointer to DP vdev object
|
||||||
|
*/
|
||||||
|
static inline struct dp_vdev *
|
||||||
|
dp_get_vdev_from_soc_vdev_id_wifi3(struct dp_soc *soc,
|
||||||
|
uint8_t vdev_id)
|
||||||
|
{
|
||||||
|
if (qdf_unlikely(vdev_id >= MAX_VDEV_CNT))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return soc->vdev_id_map[vdev_id];
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* #ifndef _DP_INTERNAL_H_ */
|
#endif /* #ifndef _DP_INTERNAL_H_ */
|
||||||
|
@@ -4757,6 +4757,8 @@ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev,
|
|||||||
qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS);
|
qdf_timer_mod(&soc->int_timer, DP_INTR_POLL_TIMER_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
soc->vdev_id_map[vdev_id] = vdev;
|
||||||
|
|
||||||
if (wlan_op_mode_monitor == vdev->opmode) {
|
if (wlan_op_mode_monitor == vdev->opmode) {
|
||||||
pdev->monitor_vdev = vdev;
|
pdev->monitor_vdev = vdev;
|
||||||
return (struct cdp_vdev *)vdev;
|
return (struct cdp_vdev *)vdev;
|
||||||
@@ -4982,6 +4984,8 @@ static void dp_vdev_detach_wifi3(struct cdp_vdev *vdev_handle,
|
|||||||
pdev = vdev->pdev;
|
pdev = vdev->pdev;
|
||||||
soc = pdev->soc;
|
soc = pdev->soc;
|
||||||
|
|
||||||
|
soc->vdev_id_map[vdev->vdev_id] = NULL;
|
||||||
|
|
||||||
if (wlan_op_mode_monitor == vdev->opmode)
|
if (wlan_op_mode_monitor == vdev->opmode)
|
||||||
goto free_vdev;
|
goto free_vdev;
|
||||||
|
|
||||||
@@ -5854,6 +5858,8 @@ static void dp_delete_pending_vdev(struct dp_pdev *pdev, struct dp_vdev *vdev,
|
|||||||
FLOW_TYPE_VDEV, vdev_id);
|
FLOW_TYPE_VDEV, vdev_id);
|
||||||
dp_tx_vdev_detach(vdev);
|
dp_tx_vdev_detach(vdev);
|
||||||
|
|
||||||
|
pdev->soc->vdev_id_map[vdev_id] = NULL;
|
||||||
|
|
||||||
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
||||||
TAILQ_REMOVE(&pdev->vdev_list, vdev, vdev_list_elem);
|
TAILQ_REMOVE(&pdev->vdev_list, vdev, vdev_list_elem);
|
||||||
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
||||||
@@ -9383,10 +9389,10 @@ static QDF_STATUS dp_runtime_resume(struct cdp_pdev *opaque_pdev)
|
|||||||
static uint32_t dp_tx_get_success_ack_stats(struct cdp_pdev *pdev,
|
static uint32_t dp_tx_get_success_ack_stats(struct cdp_pdev *pdev,
|
||||||
uint8_t vdev_id)
|
uint8_t vdev_id)
|
||||||
{
|
{
|
||||||
struct dp_vdev *vdev =
|
|
||||||
(struct dp_vdev *)dp_get_vdev_from_vdev_id_wifi3(pdev,
|
|
||||||
vdev_id);
|
|
||||||
struct dp_soc *soc = ((struct dp_pdev *)pdev)->soc;
|
struct dp_soc *soc = ((struct dp_pdev *)pdev)->soc;
|
||||||
|
struct dp_vdev *vdev =
|
||||||
|
(struct dp_vdev *)dp_get_vdev_from_soc_vdev_id_wifi3(soc,
|
||||||
|
vdev_id);
|
||||||
struct cdp_vdev_stats *vdev_stats = NULL;
|
struct cdp_vdev_stats *vdev_stats = NULL;
|
||||||
uint32_t tx_success;
|
uint32_t tx_success;
|
||||||
|
|
||||||
@@ -9728,6 +9734,7 @@ dp_soc_attach(struct cdp_ctrl_objmgr_psoc *ctrl_psoc, HTC_HANDLE htc_handle,
|
|||||||
soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_MAPS;
|
soc->num_hw_dscp_tid_map = HAL_MAX_HW_DSCP_TID_MAPS;
|
||||||
|
|
||||||
wlan_set_srng_cfg(&soc->wlan_srng_cfg);
|
wlan_set_srng_cfg(&soc->wlan_srng_cfg);
|
||||||
|
qdf_mem_zero(&soc->vdev_id_map, sizeof(soc->vdev_id_map));
|
||||||
|
|
||||||
soc->wlan_cfg_ctx = wlan_cfg_soc_attach(soc->ctrl_psoc);
|
soc->wlan_cfg_ctx = wlan_cfg_soc_attach(soc->ctrl_psoc);
|
||||||
if (!soc->wlan_cfg_ctx) {
|
if (!soc->wlan_cfg_ctx) {
|
||||||
|
@@ -148,41 +148,6 @@ void dp_peer_free_hmwds_cb(struct cdp_ctrl_objmgr_psoc *ctrl_psoc,
|
|||||||
void dp_peer_ast_hash_remove(struct dp_soc *soc,
|
void dp_peer_ast_hash_remove(struct dp_soc *soc,
|
||||||
struct dp_ast_entry *ase);
|
struct dp_ast_entry *ase);
|
||||||
|
|
||||||
/*
|
|
||||||
* dp_get_vdev_from_soc_vdev_id_wifi3() -
|
|
||||||
* Returns vdev object given the vdev id
|
|
||||||
* vdev id is unique across pdev's
|
|
||||||
*
|
|
||||||
* @soc : core DP soc context
|
|
||||||
* @vdev_id : vdev id from vdev object can be retrieved
|
|
||||||
*
|
|
||||||
* Return: struct dp_vdev*: Pointer to DP vdev object
|
|
||||||
*/
|
|
||||||
static inline struct dp_vdev *
|
|
||||||
dp_get_vdev_from_soc_vdev_id_wifi3(struct dp_soc *soc,
|
|
||||||
uint8_t vdev_id)
|
|
||||||
{
|
|
||||||
struct dp_pdev *pdev = NULL;
|
|
||||||
struct dp_vdev *vdev = NULL;
|
|
||||||
int i;
|
|
||||||
|
|
||||||
for (i = 0; i < MAX_PDEV_CNT && soc->pdev_list[i]; i++) {
|
|
||||||
pdev = soc->pdev_list[i];
|
|
||||||
qdf_spin_lock_bh(&pdev->vdev_list_lock);
|
|
||||||
TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
|
|
||||||
if (vdev->vdev_id == vdev_id) {
|
|
||||||
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
|
||||||
return vdev;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qdf_spin_unlock_bh(&pdev->vdev_list_lock);
|
|
||||||
}
|
|
||||||
dp_err("Failed to find vdev for vdev_id %d", vdev_id);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* dp_peer_find_by_id_exist - check if peer exists for given id
|
* dp_peer_find_by_id_exist - check if peer exists for given id
|
||||||
* @soc: core DP soc context
|
* @soc: core DP soc context
|
||||||
|
@@ -78,6 +78,13 @@
|
|||||||
#define MAX_PDEV_CNT 3
|
#define MAX_PDEV_CNT 3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Max no. of VDEV per PSOC */
|
||||||
|
#ifdef WLAN_PSOC_MAX_VDEVS
|
||||||
|
#define MAX_VDEV_CNT WLAN_PSOC_MAX_VDEVS
|
||||||
|
#else
|
||||||
|
#define MAX_VDEV_CNT 51
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAX_LINK_DESC_BANKS 8
|
#define MAX_LINK_DESC_BANKS 8
|
||||||
#define MAX_TXDESC_POOLS 4
|
#define MAX_TXDESC_POOLS 4
|
||||||
#define MAX_RXDESC_POOLS 4
|
#define MAX_RXDESC_POOLS 4
|
||||||
@@ -982,6 +989,9 @@ struct dp_soc {
|
|||||||
|
|
||||||
uint32_t wbm_idle_scatter_buf_size;
|
uint32_t wbm_idle_scatter_buf_size;
|
||||||
|
|
||||||
|
/* VDEVs on this SOC */
|
||||||
|
struct dp_vdev *vdev_id_map[MAX_VDEV_CNT];
|
||||||
|
|
||||||
/* Tx H/W queues lock */
|
/* Tx H/W queues lock */
|
||||||
qdf_spinlock_t tx_queue_lock[MAX_TX_HW_QUEUES];
|
qdf_spinlock_t tx_queue_lock[MAX_TX_HW_QUEUES];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user