qcacmn: Register IRQ for near full irq

WCN7850 has support for near full indication for
the consumer srngs. This interrupt is used to take
preventive actions to avoid ring full watchdog irq
trigger.

Register for the near full irq and add the necessary
ext groups for these near-full irqs.

Change-Id: Ic16381fceabc54e6c52b34dd13abea74cad4d38c
CRs-Fixed: 2965081
此提交包含在:
Rakesh Pillai
2021-03-23 05:32:56 -07:00
提交者 Madan Koyyalamudi
父節點 cebffa806d
當前提交 37e2c6d9ed
共有 11 個檔案被更改,包括 836 行新增105 行删除

查看文件

@@ -48,15 +48,6 @@
#define WLAN_CFG_TX_RING_MASK_2 0x4
#define WLAN_CFG_TX_RING_MASK_3 0x0
#define WLAN_CFG_RX_RING_MASK_0 0x1
#define WLAN_CFG_RX_RING_MASK_1 0x2
#define WLAN_CFG_RX_RING_MASK_2 0x4
#define WLAN_CFG_RX_RING_MASK_3 0x8
#define WLAN_CFG_RX_RING_MASK_4 0x10
#define WLAN_CFG_RX_RING_MASK_5 0x20
#define WLAN_CFG_RX_RING_MASK_6 0x40
#define WLAN_CFG_RX_RING_MASK_7 0x80
#define WLAN_CFG_RX_MON_RING_MASK_0 0x1
#define WLAN_CFG_RX_MON_RING_MASK_1 0x2
@@ -107,6 +98,9 @@ struct dp_int_mask_assignment {
uint8_t rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
};
#if defined(WLAN_MAX_PDEVS) && (WLAN_MAX_PDEVS == 1)
@@ -185,6 +179,28 @@ static struct dp_int_mask_assignment dp_mask_assignment[NUM_INTERRUPT_COMBINATIO
/* reo status ring masks */
{ 0, 0, 0, 0, 0, 0,
WLAN_CFG_REO_STATUS_RING_MASK_0},
#ifdef CONFIG_BERYLLIUM
/* rx near full irq1 mask */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1,
0, 0},
/* rx near full irq2 mask */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2,
0},
/* tx near full irq mask */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK},
#else /* CONFIG_BERYLLIUM */
/* rx near full irq1 mask */
{ 0, 0, 0, 0, 0, 0, 0},
/* rx near full irq2 mask */
{ 0, 0, 0, 0, 0, 0, 0},
/* tx near full irq mask */
{ 0, 0, 0, 0, 0, 0, 0},
#endif /* CONFIG_BERYLLIUM */
},
};
@@ -889,32 +905,38 @@ void wlan_cfg_fill_interrupt_mask(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
for (i = 0; i < WLAN_CFG_INT_NUM_CONTEXTS; i++) {
wlan_cfg_ctx->int_tx_ring_mask[i] =
dp_mask_assignment[interrupt_index].tx_ring_mask[i];
wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
wlan_cfg_ctx->int_rx_err_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
wlan_cfg_ctx->int_reo_status_ring_mask[i] =
dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
if (is_monitor_mode) {
wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
} else {
wlan_cfg_ctx->int_rx_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_ring_mask[i];
wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
}
wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
wlan_cfg_ctx->int_tx_ring_mask[i] =
dp_mask_assignment[interrupt_index].tx_ring_mask[i];
wlan_cfg_ctx->int_rx_mon_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_mon_ring_mask[i];
wlan_cfg_ctx->int_rx_err_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_err_ring_mask[i];
wlan_cfg_ctx->int_rx_wbm_rel_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_wbm_rel_ring_mask[i];
wlan_cfg_ctx->int_reo_status_ring_mask[i] =
dp_mask_assignment[interrupt_index].reo_status_ring_mask[i];
if (is_monitor_mode) {
wlan_cfg_ctx->int_rx_ring_mask[i] = 0;
wlan_cfg_ctx->int_rxdma2host_ring_mask[i] = 0;
} else {
wlan_cfg_ctx->int_rx_ring_mask[i] =
dp_mask_assignment[interrupt_index].rx_ring_mask[i];
wlan_cfg_ctx->int_rxdma2host_ring_mask[i] =
dp_mask_assignment[interrupt_index].rxdma2host_ring_mask[i];
}
wlan_cfg_ctx->int_host2rxdma_ring_mask[i] =
dp_mask_assignment[interrupt_index].host2rxdma_ring_mask[i];
wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] =
dp_mask_assignment[interrupt_index].host2rxdma_mon_ring_mask[i];
wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] =
dp_mask_assignment[interrupt_index].rxdma2host_mon_ring_mask[i];
wlan_cfg_ctx->int_rx_ring_near_full_irq_1_mask[i] =
dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_1_mask[i];
wlan_cfg_ctx->int_rx_ring_near_full_irq_2_mask[i] =
dp_mask_assignment[interrupt_index].rx_ring_near_full_irq_2_mask[i];
wlan_cfg_ctx->int_tx_ring_near_full_irq_mask[i] =
dp_mask_assignment[interrupt_index].tx_ring_near_full_irq_mask[i];
}
}
#ifdef IPA_OFFLOAD
@@ -1280,6 +1302,24 @@ int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
return cfg->int_host2rxdma_ring_mask[context];
}
int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context)
{
return cfg->int_rx_ring_near_full_irq_1_mask[context];
}
int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context)
{
return cfg->int_rx_ring_near_full_irq_2_mask[context];
}
int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context)
{
return cfg->int_tx_ring_near_full_irq_mask[context];
}
void wlan_cfg_set_hw_mac_idx(struct wlan_cfg_dp_soc_ctxt *cfg, int pdev_idx,
int hw_macid)
{

查看文件

@@ -27,7 +27,7 @@
#define WLAN_CFG_DST_RING_CACHED_DESC 0
#define MAX_PDEV_CNT 1
#ifdef CONFIG_BERYLLIUM
#define WLAN_CFG_INT_NUM_CONTEXTS 11
#define WLAN_CFG_INT_NUM_CONTEXTS 14
#else
#define WLAN_CFG_INT_NUM_CONTEXTS 7
#endif
@@ -54,7 +54,7 @@
#endif
#define WLAN_CFG_INT_NUM_CONTEXTS_MAX 11
#define WLAN_CFG_INT_NUM_CONTEXTS_MAX 14
/* Tx configuration */
#define MAX_LINK_DESC_BANKS 8
@@ -92,6 +92,41 @@
#define INVALID_PDEV_ID 0xFF
#define WLAN_CFG_RX_RING_MASK_0 0x1
#define WLAN_CFG_RX_RING_MASK_1 0x2
#define WLAN_CFG_RX_RING_MASK_2 0x4
#define WLAN_CFG_RX_RING_MASK_3 0x8
#define WLAN_CFG_RX_RING_MASK_4 0x10
#define WLAN_CFG_RX_RING_MASK_5 0x20
#define WLAN_CFG_RX_RING_MASK_6 0x40
#define WLAN_CFG_RX_RING_MASK_7 0x80
#ifdef WLAN_FEATURE_NEAR_FULL_IRQ
#ifdef IPA_OFFLOAD
#define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \
WLAN_CFG_RX_RING_MASK_1 | \
WLAN_CFG_RX_RING_MASK_2)
#define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \
WLAN_CFG_RX_RING_MASK_5 | \
WLAN_CFG_RX_RING_MASK_6)
#define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0)
#else
#define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_1 (WLAN_CFG_RX_RING_MASK_0 | \
WLAN_CFG_RX_RING_MASK_1 | \
WLAN_CFG_RX_RING_MASK_2 | \
WLAN_CFG_RX_RING_MASK_3)
#define WLAN_CFG_RX_NEAR_FULL_IRQ_MASK_2 (WLAN_CFG_RX_RING_MASK_4 | \
WLAN_CFG_RX_RING_MASK_5 | \
WLAN_CFG_RX_RING_MASK_6 | \
WLAN_CFG_RX_RING_MASK_7)
#define WLAN_CFG_TX_RING_NEAR_FULL_IRQ_MASK (WLAN_CFG_TX_RING_MASK_0)
#endif
#endif
struct wlan_cfg_dp_pdev_ctxt;
/**
@@ -135,6 +170,14 @@ struct wlan_srng_cfg {
* NAPI/Intr context
* @int_reo_status_ring_mask: Bitmap of reo status ring interrupts mapped to
* each NAPI/Intr context
* @int_rxdma2host_ring_mask:
* @int_host2rxdma_ring_mask:
* @int_rx_ring_near_full_irq_1_mask: Bitmap of REO DST ring near full interrupt
* mapped to each NAPI/INTR context
* @int_rx_ring_near_full_irq_2_mask: Bitmap of REO DST ring near full interrupt
* mapped to each NAPI/INTR context
* @int_tx_ring_near_full_irq_mask: Bitmap of Tx completion ring near full
* interrupt mapped to each NAPI/INTR context
* @int_ce_ring_mask: Bitmap of CE interrupts mapped to each NAPI/Intr context
* @lro_enabled: enable/disable lro feature
* @rx_hash: Enable hash based steering of rx packets
@@ -246,6 +289,9 @@ struct wlan_cfg_dp_soc_ctxt {
uint8_t int_reo_status_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t int_rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t int_host2rxdma_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t int_rx_ring_near_full_irq_1_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t int_rx_ring_near_full_irq_2_mask[WLAN_CFG_INT_NUM_CONTEXTS];
uint8_t int_tx_ring_near_full_irq_mask[WLAN_CFG_INT_NUM_CONTEXTS];
int hw_macid[MAX_PDEV_CNT];
int hw_macid_pdev_id_map[MAX_NUM_LMAC_HW];
int base_hw_macid;
@@ -527,6 +573,38 @@ void wlan_cfg_set_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int wlan_cfg_get_host2rxdma_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context);
/**
* wlan_cfg_get_rx_near_full_grp_1_mask() - Return REO near full interrupt mask
* mapped to an interrupt context
* @cfg: Configuration Handle
* @context - Numerical ID identifying the Interrupt/NAPI context
*
* Return: REO near full interrupt mask[context]
*/
int wlan_cfg_get_rx_near_full_grp_1_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context);
/**
* wlan_cfg_get_rx_near_full_grp_2_mask() - Return REO near full interrupt mask
* mapped to an interrupt context
* @cfg: Configuration Handle
* @context - Numerical ID identifying the Interrupt/NAPI context
*
* Return: REO near full interrupt mask[context]
*/
int wlan_cfg_get_rx_near_full_grp_2_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context);
/**
* wlan_cfg_get_tx_ring_near_full_mask() - Return tx completion ring near full
* interrupt mask mapped to an interrupt context
* @cfg: Configuration Handle
* @context - Numerical ID identifying the Interrupt/NAPI context
*
* Return: tx completion near full interrupt mask[context]
*/
int wlan_cfg_get_tx_ring_near_full_mask(struct wlan_cfg_dp_soc_ctxt *cfg,
int context);
/**
* wlan_cfg_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring
* interrupt mask for the given interrupt context