qcacmn: Use txrx_intr_attach function to attach to poll and interrupt
Use appropriate reo dst ring size based on target type Change-Id: I6e26537d25b4b8d4507acc689b9d17c83aa4d27e
This commit is contained in:

committed by
nshrivas

parent
1b4476e7b6
commit
54d16a9371
@@ -21,6 +21,7 @@
|
|||||||
#include <qdf_net_types.h>
|
#include <qdf_net_types.h>
|
||||||
#include <qdf_lro.h>
|
#include <qdf_lro.h>
|
||||||
#include <qdf_module.h>
|
#include <qdf_module.h>
|
||||||
|
#include <hal_hw_headers.h>
|
||||||
#include <hal_api.h>
|
#include <hal_api.h>
|
||||||
#include <hif.h>
|
#include <hif.h>
|
||||||
#include <htt.h>
|
#include <htt.h>
|
||||||
@@ -1044,7 +1045,7 @@ static void dp_interrupt_timer(void *arg)
|
|||||||
*
|
*
|
||||||
* Return: 0 for success. nonzero for failure.
|
* Return: 0 for success. nonzero for failure.
|
||||||
*/
|
*/
|
||||||
static QDF_STATUS dp_soc_interrupt_attach_poll(void *txrx_soc)
|
static QDF_STATUS dp_soc_attach_poll(void *txrx_soc)
|
||||||
{
|
{
|
||||||
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
||||||
int i;
|
int i;
|
||||||
@@ -1077,10 +1078,16 @@ static QDF_STATUS dp_soc_interrupt_attach_poll(void *txrx_soc)
|
|||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static QDF_STATUS dp_soc_attach_poll(void *txrx_soc)
|
||||||
|
{
|
||||||
|
return -QDF_STATUS_E_NOSUPPORT;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc);
|
||||||
#if defined(CONFIG_MCL)
|
#if defined(CONFIG_MCL)
|
||||||
extern int con_mode_monitor;
|
extern int con_mode_monitor;
|
||||||
static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc);
|
|
||||||
/*
|
/*
|
||||||
* dp_soc_interrupt_attach_wrapper() - Register handlers for DP interrupts
|
* dp_soc_interrupt_attach_wrapper() - Register handlers for DP interrupts
|
||||||
* @txrx_soc: DP SOC handle
|
* @txrx_soc: DP SOC handle
|
||||||
@@ -1098,7 +1105,7 @@ static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
|||||||
con_mode_monitor == QDF_GLOBAL_MONITOR_MODE) {
|
con_mode_monitor == QDF_GLOBAL_MONITOR_MODE) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
||||||
"%s: Poll mode", __func__);
|
"%s: Poll mode", __func__);
|
||||||
return dp_soc_interrupt_attach_poll(txrx_soc);
|
return dp_soc_attach_poll(txrx_soc);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
||||||
@@ -1109,10 +1116,14 @@ static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
|||||||
#else
|
#else
|
||||||
static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
static QDF_STATUS dp_soc_interrupt_attach_wrapper(void *txrx_soc)
|
||||||
{
|
{
|
||||||
return dp_soc_interrupt_attach_poll(txrx_soc);
|
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
||||||
|
|
||||||
|
if (hif_is_polled_mode_enabled(soc->hif_handle))
|
||||||
|
return dp_soc_attach_poll(txrx_soc);
|
||||||
|
else
|
||||||
|
return dp_soc_interrupt_attach(txrx_soc);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc,
|
static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc,
|
||||||
int intr_ctx_num, int *irq_id_map, int *num_irq_r)
|
int intr_ctx_num, int *irq_id_map, int *num_irq_r)
|
||||||
@@ -1669,11 +1680,8 @@ static void dp_hw_link_desc_pool_cleanup(struct dp_soc *soc)
|
|||||||
#define WBM_RELEASE_RING_SIZE 64
|
#define WBM_RELEASE_RING_SIZE 64
|
||||||
#define TCL_CMD_RING_SIZE 32
|
#define TCL_CMD_RING_SIZE 32
|
||||||
#define TCL_STATUS_RING_SIZE 32
|
#define TCL_STATUS_RING_SIZE 32
|
||||||
#if defined(QCA_WIFI_QCA6290)
|
#define REO_DST_RING_SIZE_QCA6290 1024
|
||||||
#define REO_DST_RING_SIZE 1024
|
#define REO_DST_RING_SIZE_QCA8074 2048
|
||||||
#else
|
|
||||||
#define REO_DST_RING_SIZE 2048
|
|
||||||
#endif
|
|
||||||
#define REO_REINJECT_RING_SIZE 32
|
#define REO_REINJECT_RING_SIZE 32
|
||||||
#define RX_RELEASE_RING_SIZE 1024
|
#define RX_RELEASE_RING_SIZE 1024
|
||||||
#define REO_EXCEPTION_RING_SIZE 128
|
#define REO_EXCEPTION_RING_SIZE 128
|
||||||
@@ -2074,6 +2082,7 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
|
|||||||
struct hal_reo_params reo_params;
|
struct hal_reo_params reo_params;
|
||||||
int tx_ring_size;
|
int tx_ring_size;
|
||||||
int tx_comp_ring_size;
|
int tx_comp_ring_size;
|
||||||
|
int reo_dst_ring_size;
|
||||||
|
|
||||||
if (qdf_atomic_read(&soc->cmn_init_done))
|
if (qdf_atomic_read(&soc->cmn_init_done))
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2146,6 +2155,7 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
|
|||||||
goto fail1;
|
goto fail1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reo_dst_ring_size = wlan_cfg_get_reo_dst_ring_size(soc->wlan_cfg_ctx);
|
||||||
|
|
||||||
/* TBD: call dp_tx_init to setup Tx SW descriptors and MSDU extension
|
/* TBD: call dp_tx_init to setup Tx SW descriptors and MSDU extension
|
||||||
* descriptors
|
* descriptors
|
||||||
@@ -2160,7 +2170,7 @@ static int dp_soc_cmn_setup(struct dp_soc *soc)
|
|||||||
FL("num_reo_dest_rings %d\n"), soc->num_reo_dest_rings);
|
FL("num_reo_dest_rings %d\n"), soc->num_reo_dest_rings);
|
||||||
for (i = 0; i < soc->num_reo_dest_rings; i++) {
|
for (i = 0; i < soc->num_reo_dest_rings; i++) {
|
||||||
if (dp_srng_setup(soc, &soc->reo_dest_ring[i], REO_DST,
|
if (dp_srng_setup(soc, &soc->reo_dest_ring[i], REO_DST,
|
||||||
i, 0, REO_DST_RING_SIZE)) {
|
i, 0, reo_dst_ring_size)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP,
|
QDF_TRACE(QDF_MODULE_ID_DP,
|
||||||
QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE_LEVEL_ERROR,
|
||||||
FL("dp_srng_setup failed for reo_dest_ring[%d]"), i);
|
FL("dp_srng_setup failed for reo_dest_ring[%d]"), i);
|
||||||
@@ -2638,6 +2648,7 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
|||||||
{
|
{
|
||||||
int tx_ring_size;
|
int tx_ring_size;
|
||||||
int tx_comp_ring_size;
|
int tx_comp_ring_size;
|
||||||
|
int reo_dst_ring_size;
|
||||||
|
|
||||||
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
struct dp_soc *soc = (struct dp_soc *)txrx_soc;
|
||||||
struct dp_pdev *pdev = qdf_mem_malloc(sizeof(*pdev));
|
struct dp_pdev *pdev = qdf_mem_malloc(sizeof(*pdev));
|
||||||
@@ -2713,10 +2724,11 @@ static struct cdp_pdev *dp_pdev_attach_wifi3(struct cdp_soc_t *txrx_soc,
|
|||||||
goto fail1;
|
goto fail1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reo_dst_ring_size = wlan_cfg_get_reo_dst_ring_size(soc->wlan_cfg_ctx);
|
||||||
/* Setup per PDEV REO rings if configured */
|
/* Setup per PDEV REO rings if configured */
|
||||||
if (wlan_cfg_per_pdev_rx_ring(soc->wlan_cfg_ctx)) {
|
if (wlan_cfg_per_pdev_rx_ring(soc->wlan_cfg_ctx)) {
|
||||||
if (dp_srng_setup(soc, &soc->reo_dest_ring[pdev_id], REO_DST,
|
if (dp_srng_setup(soc, &soc->reo_dest_ring[pdev_id], REO_DST,
|
||||||
pdev_id, pdev_id, REO_DST_RING_SIZE)) {
|
pdev_id, pdev_id, reo_dst_ring_size)) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
FL("dp_srng_setup failed for reo_dest_ringn"));
|
FL("dp_srng_setup failed for reo_dest_ringn"));
|
||||||
goto fail1;
|
goto fail1;
|
||||||
@@ -7148,11 +7160,7 @@ static struct cdp_cmn_ops dp_ops_cmn = {
|
|||||||
.display_stats = dp_txrx_dump_stats,
|
.display_stats = dp_txrx_dump_stats,
|
||||||
.txrx_soc_set_nss_cfg = dp_soc_set_nss_cfg_wifi3,
|
.txrx_soc_set_nss_cfg = dp_soc_set_nss_cfg_wifi3,
|
||||||
.txrx_soc_get_nss_cfg = dp_soc_get_nss_cfg_wifi3,
|
.txrx_soc_get_nss_cfg = dp_soc_get_nss_cfg_wifi3,
|
||||||
#ifdef DP_INTR_POLL_BASED
|
|
||||||
.txrx_intr_attach = dp_soc_interrupt_attach_wrapper,
|
.txrx_intr_attach = dp_soc_interrupt_attach_wrapper,
|
||||||
#else
|
|
||||||
.txrx_intr_attach = dp_soc_interrupt_attach,
|
|
||||||
#endif
|
|
||||||
.txrx_intr_detach = dp_soc_interrupt_detach,
|
.txrx_intr_detach = dp_soc_interrupt_detach,
|
||||||
.set_pn_check = dp_set_pn_check_wifi3,
|
.set_pn_check = dp_set_pn_check_wifi3,
|
||||||
.update_config_parameters = dp_update_config_parameters,
|
.update_config_parameters = dp_update_config_parameters,
|
||||||
@@ -7499,6 +7507,7 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
|
|||||||
struct ol_if_ops *ol_ops)
|
struct ol_if_ops *ol_ops)
|
||||||
{
|
{
|
||||||
struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc));
|
struct dp_soc *soc = qdf_mem_malloc(sizeof(*soc));
|
||||||
|
int target_type;
|
||||||
|
|
||||||
if (!soc) {
|
if (!soc) {
|
||||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
|
||||||
@@ -7527,6 +7536,22 @@ void *dp_soc_attach_wifi3(void *ctrl_psoc, void *hif_handle,
|
|||||||
FL("wlan_cfg_soc_attach failed"));
|
FL("wlan_cfg_soc_attach failed"));
|
||||||
goto fail2;
|
goto fail2;
|
||||||
}
|
}
|
||||||
|
target_type = hal_get_target_type(soc->hal_soc);
|
||||||
|
switch (target_type) {
|
||||||
|
case TARGET_TYPE_QCA6290:
|
||||||
|
case TARGET_TYPE_QCA6390:
|
||||||
|
wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx,
|
||||||
|
REO_DST_RING_SIZE_QCA6290);
|
||||||
|
break;
|
||||||
|
case TARGET_TYPE_QCA8074:
|
||||||
|
wlan_cfg_set_reo_dst_ring_size(soc->wlan_cfg_ctx,
|
||||||
|
REO_DST_RING_SIZE_QCA8074);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
qdf_print("%s: Unknown tgt type %d\n", __func__, target_type);
|
||||||
|
qdf_assert_always(0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
wlan_cfg_set_rx_hash(soc->wlan_cfg_ctx, rx_hash);
|
wlan_cfg_set_rx_hash(soc->wlan_cfg_ctx, rx_hash);
|
||||||
soc->cce_disable = false;
|
soc->cce_disable = false;
|
||||||
|
@@ -1501,6 +1501,8 @@ bool hif_is_polled_mode_enabled(struct hif_opaque_softc *hif_ctx)
|
|||||||
return scn->polled_mode_on;
|
return scn->polled_mode_on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
qdf_export_symbol(hif_is_polled_mode_enabled);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hif_get_ce_handle - API to get CE handle for FastPath mode
|
* hif_get_ce_handle - API to get CE handle for FastPath mode
|
||||||
* @hif_ctx: HIF Context
|
* @hif_ctx: HIF Context
|
||||||
|
@@ -600,6 +600,17 @@ void wlan_cfg_set_num_tx_ext_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num
|
|||||||
cfg->num_tx_ext_desc_pool = num_pool;
|
cfg->num_tx_ext_desc_pool = num_pool;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||||
|
{
|
||||||
|
return cfg->reo_dst_ring_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
|
||||||
|
int reo_dst_ring_size)
|
||||||
|
{
|
||||||
|
cfg->reo_dst_ring_size = reo_dst_ring_size;
|
||||||
|
}
|
||||||
|
|
||||||
int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
|
int wlan_cfg_get_num_tx_desc(struct wlan_cfg_dp_soc_ctxt *cfg)
|
||||||
{
|
{
|
||||||
return cfg->num_tx_desc;
|
return cfg->num_tx_desc;
|
||||||
|
@@ -163,6 +163,7 @@ struct wlan_cfg_dp_soc_ctxt {
|
|||||||
uint32_t tx_flow_start_queue_offset;
|
uint32_t tx_flow_start_queue_offset;
|
||||||
#endif
|
#endif
|
||||||
uint32_t rx_defrag_min_timeout;
|
uint32_t rx_defrag_min_timeout;
|
||||||
|
int reo_dst_ring_size;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -484,6 +485,24 @@ void wlan_cfg_set_num_tx_desc_pool(struct wlan_cfg_dp_soc_ctxt *cfg, int num_poo
|
|||||||
int wlan_cfg_get_num_tx_ext_desc_pool(
|
int wlan_cfg_get_num_tx_ext_desc_pool(
|
||||||
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
|
struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wlan_cfg_get_reo_dst_ring_size() - Get REO destination ring size
|
||||||
|
*
|
||||||
|
* @wlan_cfg_ctx - Configuration Handle
|
||||||
|
*
|
||||||
|
* Return: reo_dst_ring_size
|
||||||
|
*/
|
||||||
|
int wlan_cfg_get_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* wlan_cfg_set_num_tx_desc_pool() - Set the REO Destination ring size
|
||||||
|
*
|
||||||
|
* @wlan_cfg_ctx - Configuration Handle
|
||||||
|
* @reo_dst_ring_size - REO Destination ring size
|
||||||
|
*/
|
||||||
|
void wlan_cfg_set_reo_dst_ring_size(struct wlan_cfg_dp_soc_ctxt *cfg,
|
||||||
|
int reo_dst_ring_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
|
* wlan_cfg_set_num_tx_ext_desc_pool() - Set the number of Tx MSDU ext Descriptor
|
||||||
* pools
|
* pools
|
||||||
|
Reference in New Issue
Block a user