diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index eb7d04cd7887..81e2133b5498 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -1462,6 +1462,8 @@ static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc, soc->wlan_cfg_ctx, intr_ctx_num); int host2rxdma_ring_mask = wlan_cfg_get_host2rxdma_ring_mask( soc->wlan_cfg_ctx, intr_ctx_num); + int host2rxdma_mon_ring_mask = wlan_cfg_get_host2rxdma_mon_ring_mask( + soc->wlan_cfg_ctx, intr_ctx_num); for (j = 0; j < HIF_MAX_GRP_IRQ; j++) { @@ -1487,6 +1489,12 @@ static void dp_soc_interrupt_map_calculate_integrated(struct dp_soc *soc, wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j); } + if (host2rxdma_mon_ring_mask & (1 << j)) { + irq_id_map[num_irq++] = + host2rxdma_monitor_ring1 - + wlan_cfg_get_hw_mac_idx(soc->wlan_cfg_ctx, j); + } + if (rx_mon_mask & (1 << j)) { irq_id_map[num_irq++] = ppdu_end_interrupts_mac1 - @@ -1601,7 +1609,9 @@ static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc) wlan_cfg_get_rxdma2host_ring_mask(soc->wlan_cfg_ctx, i); int host2rxdma_ring_mask = wlan_cfg_get_host2rxdma_ring_mask(soc->wlan_cfg_ctx, i); - + int host2rxdma_mon_ring_mask = + wlan_cfg_get_host2rxdma_mon_ring_mask( + soc->wlan_cfg_ctx, i); soc->intr_ctx[i].dp_intr_id = i; soc->intr_ctx[i].tx_ring_mask = tx_mask; @@ -1612,6 +1622,8 @@ static QDF_STATUS dp_soc_interrupt_attach(void *txrx_soc) soc->intr_ctx[i].host2rxdma_ring_mask = host2rxdma_ring_mask; soc->intr_ctx[i].rx_wbm_rel_ring_mask = rx_wbm_rel_ring_mask; soc->intr_ctx[i].reo_status_ring_mask = reo_status_ring_mask; + soc->intr_ctx[i].host2rxdma_mon_ring_mask = + host2rxdma_mon_ring_mask; soc->intr_ctx[i].soc = soc; @@ -1666,6 +1678,7 @@ static void dp_soc_interrupt_detach(void *txrx_soc) soc->intr_ctx[i].reo_status_ring_mask = 0; soc->intr_ctx[i].rxdma2host_ring_mask = 0; soc->intr_ctx[i].host2rxdma_ring_mask = 0; + soc->intr_ctx[i].host2rxdma_mon_ring_mask = 0; qdf_lro_deinit(soc->intr_ctx[i].lro_ctx); } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index fa64020b122c..384405a91335 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -548,6 +548,8 @@ struct dp_intr { uint8_t reo_status_ring_mask; /* REO command response ring */ uint8_t rxdma2host_ring_mask; /* RXDMA to host destination ring */ uint8_t host2rxdma_ring_mask; /* Host to RXDMA buffer ring */ + /* Host to RXDMA monitor buffer ring */ + uint8_t host2rxdma_mon_ring_mask; struct dp_soc *soc; /* Reference to SoC structure , to get DMA ring handles */ qdf_lro_ctx_t lro_ctx; diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 978aeb7c3fbf..f0242caeb29b 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -56,6 +56,14 @@ #define WLAN_CFG_RX_MON_RING_MASK_2 0x4 #define WLAN_CFG_RX_MON_RING_MASK_3 0x0 +#define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0 0x1 +#define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1 0x2 +#define WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2 0x4 + +#define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0 0x1 +#define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1 0x2 +#define WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2 0x4 + #define WLAN_CFG_RX_ERR_RING_MASK_0 0x1 #define WLAN_CFG_RX_ERR_RING_MASK_1 0x0 #define WLAN_CFG_RX_ERR_RING_MASK_2 0x0 @@ -137,6 +145,22 @@ static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { 0, 0, 0}; + +static const int host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, + WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, + WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, + WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2}; + +static const int rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, + WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, + WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, + WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2}; #else static const int tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_TX_RING_MASK_0, @@ -177,6 +201,24 @@ static const int rxdma2host_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { WLAN_CFG_RXDMA2HOST_RING_MASK_1, WLAN_CFG_RXDMA2HOST_RING_MASK_2, WLAN_CFG_RXDMA2HOST_RING_MASK_3}; + +static const int host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, + 0, + WLAN_CFG_HOST2RXDMA_MON_RING_MASK_0, + WLAN_CFG_HOST2RXDMA_MON_RING_MASK_1, + WLAN_CFG_HOST2RXDMA_MON_RING_MASK_2}; + +static const int rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { + 0, + 0, + 0, + 0, + WLAN_CFG_RXDMA2HOST_MON_RING_MASK_0, + WLAN_CFG_RXDMA2HOST_MON_RING_MASK_1, + WLAN_CFG_RXDMA2HOST_MON_RING_MASK_2}; #endif static const int rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS] = { @@ -261,6 +303,10 @@ struct wlan_cfg_dp_soc_ctxt *wlan_cfg_soc_attach(void *psoc) rxdma2host_ring_mask[i]; wlan_cfg_ctx->int_host2rxdma_ring_mask[i] = host2rxdma_ring_mask[i]; + wlan_cfg_ctx->int_host2rxdma_mon_ring_mask[i] = + host2rxdma_mon_ring_mask[i]; + wlan_cfg_ctx->int_rxdma2host_mon_ring_mask[i] = + rxdma2host_mon_ring_mask[i]; } /* This is default mapping and can be overridden by HW config @@ -375,7 +421,7 @@ void wlan_cfg_set_tx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, } void wlan_cfg_set_rx_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, - int context, int mask) + int context, int mask) { cfg->int_rx_ring_mask[context] = mask; } @@ -386,6 +432,30 @@ void wlan_cfg_set_rx_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, cfg->int_rx_mon_ring_mask[context] = mask; } +int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context) +{ + return cfg->int_host2rxdma_mon_ring_mask[context]; +} + +void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context, int mask) +{ + cfg->int_host2rxdma_mon_ring_mask[context] = mask; +} + +int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context) +{ + return cfg->int_rxdma2host_mon_ring_mask[context]; +} + +void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context, int mask) +{ + cfg->int_rxdma2host_mon_ring_mask[context] = mask; +} + void wlan_cfg_set_rxdma2host_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, int context, int mask) { @@ -723,6 +793,11 @@ int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg) return cfg->int_timer_threshold_other; } +int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->int_timer_threshold_mon; +} + int wlan_cfg_get_checksum_offload(struct wlan_cfg_dp_soc_ctxt *cfg) { return cfg->tcp_udp_checksumoffload; diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index d7392b290f31..ea9c489946aa 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -158,12 +158,15 @@ struct wlan_cfg_dp_soc_ctxt { int int_timer_threshold_rx; int int_batch_threshold_other; int int_timer_threshold_other; + int int_timer_threshold_mon; int tx_ring_size; int tx_comp_ring_size; int tx_comp_ring_size_nss; int int_tx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; int int_rx_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; int int_rx_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; + int int_host2rxdma_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; + int int_rxdma2host_mon_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; int int_ce_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; int int_rx_err_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; int int_rx_wbm_rel_ring_mask[WLAN_CFG_INT_NUM_CONTEXTS]; @@ -373,6 +376,50 @@ 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_set_host2rxdma_mon_ring_mask() - Set host2rxdma monitor ring + * interrupt mask for the given interrupt context + * @wlan_cfg_ctx - Configuration Handle + * @context - Numerical ID identifying the Interrupt/NAPI context + * + */ +void wlan_cfg_set_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context, int mask); + +/** + * wlan_cfg_get_host2rxdma_mon_ring_mask() - Return host2rxdma monitoe ring + * interrupt mask mapped to an interrupt context + * @wlan_cfg_ctx - Configuration Handle + * @context - Numerical ID identifying the Interrupt/NAPI context + * + * Return: int_host2rxdma_mon_ring_mask[context] + */ +int wlan_cfg_get_host2rxdma_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context); + +/** + * wlan_cfg_set_rxdma2host_mon_ring_mask() - Set rxdma2host monitor + * destination ring interrupt mask + * for the given interrupt context + * @wlan_cfg_ctx - Configuration Handle + * @context - Numerical ID identifying the Interrupt/NAPI context + * + */ +void wlan_cfg_set_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context, int mask); + +/** + * wlan_cfg_get_rxdma2host_mon_ring_mask() - Return rxdma2host monitor + * destination ring interrupt mask + * mapped to an interrupt context + * @wlan_cfg_ctx - Configuration Handle + * @context - Numerical ID identifying the Interrupt/NAPI context + * + * Return: int_rxdma2host_mon_ring_mask[context] + */ +int wlan_cfg_get_rxdma2host_mon_ring_mask(struct wlan_cfg_dp_soc_ctxt *cfg, + int context); + /** * wlan_cfg_set_hw_macid() - Set HW MAC Id for the given PDEV index * @@ -793,6 +840,14 @@ int wlan_cfg_get_int_batch_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); */ int wlan_cfg_get_int_timer_threshold_other(struct wlan_cfg_dp_soc_ctxt *cfg); +/* + * wlan_cfg_get_int_timer_threshold_mon - Get int mitigation cfg for mon srngs + * @wlan_cfg_soc_ctx + * + * Return: Timer threshold + */ +int wlan_cfg_get_int_timer_threshold_mon(struct wlan_cfg_dp_soc_ctxt *cfg); + /* * wlan_cfg_get_checksum_offload - Get checksum offload enable or disable status * @wlan_cfg_soc_ctx