mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacmn: Create flow control pools on vdev start
As many as 5 vdevs can be created, which is defined by MAX_SME_SESSIONS. But flow control pools are only valid for active TxRx capable vdevs. which is 3 active vdevs. So attach flow pool creation to vdev_start instead of vdev_attach. Change-Id: I137676ba618aa3a6684c7d17ef7d9263c4df6efe CRs-Fixed: 2220079
This commit is contained in:
parent
afb889318f
commit
38205cc1b7
5 changed files with 88 additions and 13 deletions
|
|
@ -113,6 +113,62 @@ cdp_vdev_attach(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
|
|||
return soc->ops->cmn_drv_ops->txrx_vdev_attach(pdev,
|
||||
vdev_mac_addr, vdev_id, op_mode);
|
||||
}
|
||||
#ifndef CONFIG_WIN
|
||||
/**
|
||||
* cdp_flow_pool_map() - Create flow pool for vdev
|
||||
* @soc - data path soc handle
|
||||
* @pdev
|
||||
* @vdev_id - vdev_id corresponding to vdev start
|
||||
*
|
||||
* Create per vdev flow pool.
|
||||
*
|
||||
* return none
|
||||
*/
|
||||
static inline QDF_STATUS cdp_flow_pool_map(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance:", __func__);
|
||||
QDF_BUG(0);
|
||||
return QDF_STATUS_E_INVAL;
|
||||
}
|
||||
|
||||
if (!soc->ops->flowctl_ops ||
|
||||
!soc->ops->flowctl_ops->flow_pool_map_handler)
|
||||
return QDF_STATUS_E_INVAL;
|
||||
|
||||
return soc->ops->flowctl_ops->flow_pool_map_handler(soc, pdev, vdev_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* cdp_flow_pool_unmap() - Delete flow pool
|
||||
* @soc - data path soc handle
|
||||
* @pdev
|
||||
* @vdev_id - vdev_id corresponding to vdev start
|
||||
*
|
||||
* Delete flow pool
|
||||
*
|
||||
* return none
|
||||
*/
|
||||
static inline void cdp_flow_pool_unmap(ol_txrx_soc_handle soc,
|
||||
struct cdp_pdev *pdev, uint8_t vdev_id)
|
||||
{
|
||||
if (!soc || !soc->ops) {
|
||||
QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
|
||||
"%s: Invalid Instance:", __func__);
|
||||
QDF_BUG(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!soc->ops->flowctl_ops ||
|
||||
!soc->ops->flowctl_ops->flow_pool_unmap_handler)
|
||||
return;
|
||||
|
||||
return soc->ops->flowctl_ops->flow_pool_unmap_handler(soc, pdev,
|
||||
vdev_id);
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
cdp_vdev_detach(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
|
||||
|
|
|
|||
|
|
@ -868,9 +868,16 @@ struct cdp_cfg_ops {
|
|||
* @dump_flow_pool_info:
|
||||
*/
|
||||
struct cdp_flowctl_ops {
|
||||
QDF_STATUS (*flow_pool_map_handler)(struct cdp_soc_t *soc,
|
||||
struct cdp_pdev *pdev,
|
||||
uint8_t vdev_id);
|
||||
void (*flow_pool_unmap_handler)(struct cdp_soc_t *soc,
|
||||
struct cdp_pdev *pdev,
|
||||
uint8_t vdev_id);
|
||||
QDF_STATUS (*register_pause_cb)(struct cdp_soc_t *soc,
|
||||
tx_pause_callback);
|
||||
void (*set_desc_global_pool_size)(uint32_t num_msdu_desc);
|
||||
|
||||
void (*dump_flow_pool_info)(void *);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3257,7 +3257,6 @@ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev,
|
|||
struct dp_pdev *pdev = (struct dp_pdev *)txrx_pdev;
|
||||
struct dp_soc *soc = pdev->soc;
|
||||
struct dp_vdev *vdev = qdf_mem_malloc(sizeof(*vdev));
|
||||
int tx_ring_size;
|
||||
|
||||
if (!vdev) {
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||
|
|
@ -3292,7 +3291,6 @@ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev,
|
|||
vdev->rx_decap_type = wlan_cfg_pkt_type(soc->wlan_cfg_ctx);
|
||||
vdev->dscp_tid_map_id = 0;
|
||||
vdev->mcast_enhancement_en = 0;
|
||||
tx_ring_size = wlan_cfg_tx_ring_size(soc->wlan_cfg_ctx);
|
||||
|
||||
/* TODO: Initialize default HTT meta data that will be used in
|
||||
* TCL descriptors for packets transmitted from this VDEV
|
||||
|
|
@ -3306,10 +3304,6 @@ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev,
|
|||
|
||||
dp_tx_vdev_attach(vdev);
|
||||
|
||||
if (QDF_STATUS_SUCCESS != dp_tx_flow_pool_map_handler(pdev, vdev_id,
|
||||
FLOW_TYPE_VDEV, vdev_id, tx_ring_size))
|
||||
goto fail1;
|
||||
|
||||
|
||||
if ((soc->intr_mode == DP_INTR_POLL) &&
|
||||
wlan_cfg_get_num_contexts(soc->wlan_cfg_ctx) != 0) {
|
||||
|
|
@ -3337,9 +3331,6 @@ static struct cdp_vdev *dp_vdev_attach_wifi3(struct cdp_pdev *txrx_pdev,
|
|||
|
||||
return (struct cdp_vdev *)vdev;
|
||||
|
||||
fail1:
|
||||
dp_tx_vdev_detach(vdev);
|
||||
qdf_mem_free(vdev);
|
||||
fail0:
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -3476,8 +3467,6 @@ static void dp_vdev_detach_wifi3(struct cdp_vdev *vdev_handle,
|
|||
}
|
||||
qdf_spin_unlock_bh(&soc->peer_ref_mutex);
|
||||
|
||||
dp_tx_flow_pool_unmap_handler(pdev, vdev->vdev_id, FLOW_TYPE_VDEV,
|
||||
vdev->vdev_id);
|
||||
dp_tx_vdev_detach(vdev);
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO_HIGH,
|
||||
FL("deleting vdev object %pK (%pM)"), vdev, vdev->mac_addr.raw);
|
||||
|
|
@ -7033,6 +7022,8 @@ static struct cdp_misc_ops dp_ops_misc = {
|
|||
static struct cdp_flowctl_ops dp_ops_flowctl = {
|
||||
/* WIFI 3.0 DP implement as required. */
|
||||
#ifdef QCA_LL_TX_FLOW_CONTROL_V2
|
||||
.flow_pool_map_handler = dp_tx_flow_pool_map,
|
||||
.flow_pool_unmap_handler = dp_tx_flow_pool_unmap,
|
||||
.register_pause_cb = dp_txrx_register_pause_cb,
|
||||
.dump_flow_pool_info = dp_tx_dump_flow_pool_info,
|
||||
#endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2016-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2018 The Linux Foundation. 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
|
||||
|
|
@ -69,6 +69,10 @@ void dp_tx_flow_control_deinit(struct dp_soc *);
|
|||
|
||||
QDF_STATUS dp_txrx_register_pause_cb(struct cdp_soc_t *soc,
|
||||
tx_pause_callback pause_cb);
|
||||
QDF_STATUS dp_tx_flow_pool_map(struct cdp_soc_t *soc, struct cdp_pdev *pdev,
|
||||
uint8_t vdev_id);
|
||||
void dp_tx_flow_pool_unmap(struct cdp_soc_t *soc, struct cdp_pdev *pdev,
|
||||
uint8_t vdev_id);
|
||||
void dp_tx_clear_flow_pool_stats(struct dp_soc *soc);
|
||||
struct dp_tx_desc_pool_s *dp_tx_create_flow_pool(struct dp_soc *soc,
|
||||
uint8_t flow_pool_id, uint16_t flow_pool_size);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2017 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2018 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
|
||||
*
|
||||
|
|
@ -417,3 +417,20 @@ QDF_STATUS dp_txrx_register_pause_cb(struct cdp_soc_t *handle,
|
|||
|
||||
return QDF_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
QDF_STATUS dp_tx_flow_pool_map(struct cdp_soc_t *handle, struct cdp_pdev *pdev,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
struct dp_soc *soc = (struct dp_soc *)handle;
|
||||
int tx_ring_size = wlan_cfg_tx_ring_size(soc->wlan_cfg_ctx);
|
||||
|
||||
return (dp_tx_flow_pool_map_handler((struct dp_pdev *)pdev, vdev_id,
|
||||
FLOW_TYPE_VDEV, vdev_id, tx_ring_size));
|
||||
}
|
||||
|
||||
void dp_tx_flow_pool_unmap(struct cdp_soc_t *soc, struct cdp_pdev *pdev,
|
||||
uint8_t vdev_id)
|
||||
{
|
||||
return(dp_tx_flow_pool_unmap_handler((struct dp_pdev *)pdev, vdev_id,
|
||||
FLOW_TYPE_VDEV, vdev_id));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue