From 9de0de3f018071a26accb2d315d9fb1979d6d540 Mon Sep 17 00:00:00 2001 From: Srinivas Girigowda Date: Mon, 30 Jan 2023 18:21:18 -0800 Subject: [PATCH] qcacmn: Add support for local pkt capture cfg ini Add support for local pkt capture cfg ini. Change-Id: I7b7e50010d71482d97de46d87ed2c70c78e74cd2 CRs-Fixed: 3415783 --- dp/inc/cdp_txrx_cmn_struct.h | 2 ++ dp/wifi3.0/dp_main.c | 3 +++ wlan_cfg/cfg_dp.h | 28 +++++++++++++++++++++++++++- wlan_cfg/wlan_cfg.c | 18 +++++++++++++++++- wlan_cfg/wlan_cfg.h | 17 +++++++++++++++++ 5 files changed, 66 insertions(+), 2 deletions(-) diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 12cfa2d175..9d87615ba6 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -2911,6 +2911,7 @@ struct cdp_monitor_filter { * @cfg_dp_disable_intra_bss_fwd: get intra bss fwd config * @cfg_dp_pktlog_buffer_size: get packet log buffer size config * @cfg_dp_wow_check_rx_pending: get wow rx pending frame check config + * @cfg_dp_local_pkt_capture: get local packet capture config */ enum cdp_dp_cfg { cfg_dp_enable_data_stall, @@ -2935,6 +2936,7 @@ enum cdp_dp_cfg { cfg_dp_disable_intra_bss_fwd, cfg_dp_pktlog_buffer_size, cfg_dp_wow_check_rx_pending, + cfg_dp_local_pkt_capture, }; /** diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 4d7b3bac57..f7e228fdd8 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -9852,6 +9852,9 @@ static uint32_t dp_get_cfg(struct cdp_soc_t *soc, enum cdp_dp_cfg cfg) case cfg_dp_wow_check_rx_pending: value = dpsoc->wlan_cfg_ctx->wow_check_rx_pending_enable; break; + case cfg_dp_local_pkt_capture: + value = wlan_cfg_get_local_pkt_capture(dpsoc->wlan_cfg_ctx); + break; default: value = 0; } diff --git a/wlan_cfg/cfg_dp.h b/wlan_cfg/cfg_dp.h index ee45f51dc8..5da5c948ef 100644 --- a/wlan_cfg/cfg_dp.h +++ b/wlan_cfg/cfg_dp.h @@ -771,6 +771,31 @@ #define CFG_DP_SAWF_STATS_CONFIG #endif +#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE +/* + * + * local_pkt_capture - Enable/Disable Local packet capture + * @Default: false + * + * This ini is used to enable/disable local packet capture. + * + * Related: None + * + * Usage: External + * + * + */ +#define CFG_DP_LOCAL_PKT_CAPTURE \ + CFG_INI_BOOL( \ + "local_packet_capture", \ + false, \ + "Local packet capture") + +#define CFG_DP_LOCAL_PKT_CAPTURE_CONFIG CFG(CFG_DP_LOCAL_PKT_CAPTURE) +#else +#define CFG_DP_LOCAL_PKT_CAPTURE_CONFIG +#endif + /* * * dp_rx_pending_hl_threshold - High threshold of frame number to start @@ -2027,5 +2052,6 @@ CFG(CFG_DP_TXMON_SW_PEER_FILTERING) \ CFG_TX_PKT_INSPECT_FOR_ILP_CFG \ CFG(CFG_DP_POINTER_TIMER_THRESHOLD_RX) \ - CFG(CFG_DP_POINTER_NUM_THRESHOLD_RX) + CFG(CFG_DP_POINTER_NUM_THRESHOLD_RX) \ + CFG_DP_LOCAL_PKT_CAPTURE_CONFIG #endif /* _CFG_DP_H_ */ diff --git a/wlan_cfg/wlan_cfg.c b/wlan_cfg/wlan_cfg.c index 77678b4c29..1bd0924691 100644 --- a/wlan_cfg/wlan_cfg.c +++ b/wlan_cfg/wlan_cfg.c @@ -3752,6 +3752,22 @@ static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, } #endif +#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE +static void +wlan_soc_local_pkt_capture_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ + wlan_cfg_ctx->local_pkt_capture = + cfg_get(psoc, CFG_DP_LOCAL_PKT_CAPTURE); +} +#else +static void +wlan_soc_local_pkt_capture_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc, + struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx) +{ +} +#endif + void wlan_cfg_soc_update_tgt_params(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx, struct cdp_ctrl_objmgr_psoc *psoc) @@ -4243,7 +4259,7 @@ wlan_cfg_soc_attach(struct cdp_ctrl_objmgr_psoc *psoc) wlan_cfg_ctx->pointer_num_threshold_rx = cfg_get(psoc, CFG_DP_POINTER_NUM_THRESHOLD_RX); wlan_soc_tx_packet_inspect_attach(psoc, wlan_cfg_ctx); - + wlan_soc_local_pkt_capture_cfg_attach(psoc, wlan_cfg_ctx); return wlan_cfg_ctx; } #endif diff --git a/wlan_cfg/wlan_cfg.h b/wlan_cfg/wlan_cfg.h index 66ca4cb3db..4bfb8ea8b7 100644 --- a/wlan_cfg/wlan_cfg.h +++ b/wlan_cfg/wlan_cfg.h @@ -338,6 +338,7 @@ struct wlan_srng_cfg { * based ILP feature is enabled * @pointer_timer_threshold_rx: RX REO2SW ring pointer update timer threshold * @pointer_num_threshold_rx: RX REO2SW ring pointer update entries threshold + * @local_pkt_capture: flag indicating enable/disable of local packet capture */ struct wlan_cfg_dp_soc_ctxt { int num_int_ctxts; @@ -537,6 +538,9 @@ struct wlan_cfg_dp_soc_ctxt { #endif uint16_t pointer_timer_threshold_rx; uint8_t pointer_num_threshold_rx; +#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE + bool local_pkt_capture; +#endif }; /** @@ -2502,4 +2506,17 @@ wlan_cfg_get_pointer_timer_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); uint8_t wlan_cfg_get_pointer_num_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg); +#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE +static inline +bool wlan_cfg_get_local_pkt_capture(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return cfg->local_pkt_capture; +} +#else +static inline +bool wlan_cfg_get_local_pkt_capture(struct wlan_cfg_dp_soc_ctxt *cfg) +{ + return false; +} +#endif #endif /*__WLAN_CFG_H*/