Browse Source

qcacmn: Add support for local pkt capture cfg ini

Add support for local pkt capture cfg ini.

Change-Id: I7b7e50010d71482d97de46d87ed2c70c78e74cd2
CRs-Fixed: 3415783
Srinivas Girigowda 2 years ago
parent
commit
9de0de3f01
5 changed files with 66 additions and 2 deletions
  1. 2 0
      dp/inc/cdp_txrx_cmn_struct.h
  2. 3 0
      dp/wifi3.0/dp_main.c
  3. 27 1
      wlan_cfg/cfg_dp.h
  4. 17 1
      wlan_cfg/wlan_cfg.c
  5. 17 0
      wlan_cfg/wlan_cfg.h

+ 2 - 0
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_disable_intra_bss_fwd: get intra bss fwd config
  * @cfg_dp_pktlog_buffer_size: get packet log buffer size 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_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 {
 enum cdp_dp_cfg {
 	cfg_dp_enable_data_stall,
 	cfg_dp_enable_data_stall,
@@ -2935,6 +2936,7 @@ enum cdp_dp_cfg {
 	cfg_dp_disable_intra_bss_fwd,
 	cfg_dp_disable_intra_bss_fwd,
 	cfg_dp_pktlog_buffer_size,
 	cfg_dp_pktlog_buffer_size,
 	cfg_dp_wow_check_rx_pending,
 	cfg_dp_wow_check_rx_pending,
+	cfg_dp_local_pkt_capture,
 };
 };
 
 
 /**
 /**

+ 3 - 0
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:
 	case cfg_dp_wow_check_rx_pending:
 		value = dpsoc->wlan_cfg_ctx->wow_check_rx_pending_enable;
 		value = dpsoc->wlan_cfg_ctx->wow_check_rx_pending_enable;
 		break;
 		break;
+	case cfg_dp_local_pkt_capture:
+		value = wlan_cfg_get_local_pkt_capture(dpsoc->wlan_cfg_ctx);
+		break;
 	default:
 	default:
 		value =  0;
 		value =  0;
 	}
 	}

+ 27 - 1
wlan_cfg/cfg_dp.h

@@ -771,6 +771,31 @@
 #define CFG_DP_SAWF_STATS_CONFIG
 #define CFG_DP_SAWF_STATS_CONFIG
 #endif
 #endif
 
 
+#ifdef WLAN_FEATURE_LOCAL_PKT_CAPTURE
+/*
+ * <ini>
+ * local_pkt_capture - Enable/Disable Local packet capture
+ * @Default: false
+ *
+ * This ini is used to enable/disable local packet capture.
+ *
+ * Related: None
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#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
+
 /*
 /*
  * <ini>
  * <ini>
  * dp_rx_pending_hl_threshold - High threshold of frame number to start
  * dp_rx_pending_hl_threshold - High threshold of frame number to start
@@ -2027,5 +2052,6 @@
 		CFG(CFG_DP_TXMON_SW_PEER_FILTERING) \
 		CFG(CFG_DP_TXMON_SW_PEER_FILTERING) \
 		CFG_TX_PKT_INSPECT_FOR_ILP_CFG \
 		CFG_TX_PKT_INSPECT_FOR_ILP_CFG \
 		CFG(CFG_DP_POINTER_TIMER_THRESHOLD_RX) \
 		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_ */
 #endif /* _CFG_DP_H_ */

+ 17 - 1
wlan_cfg/wlan_cfg.c

@@ -3752,6 +3752,22 @@ static void wlan_soc_tx_capt_cfg_attach(struct cdp_ctrl_objmgr_psoc *psoc,
 }
 }
 #endif
 #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
 void
 wlan_cfg_soc_update_tgt_params(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
 wlan_cfg_soc_update_tgt_params(struct wlan_cfg_dp_soc_ctxt *wlan_cfg_ctx,
 			       struct cdp_ctrl_objmgr_psoc *psoc)
 			       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 =
 	wlan_cfg_ctx->pointer_num_threshold_rx =
 			cfg_get(psoc, CFG_DP_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_tx_packet_inspect_attach(psoc, wlan_cfg_ctx);
-
+	wlan_soc_local_pkt_capture_cfg_attach(psoc, wlan_cfg_ctx);
 	return wlan_cfg_ctx;
 	return wlan_cfg_ctx;
 }
 }
 #endif
 #endif

+ 17 - 0
wlan_cfg/wlan_cfg.h

@@ -338,6 +338,7 @@ struct wlan_srng_cfg {
  *			    based ILP feature is enabled
  *			    based ILP feature is enabled
  * @pointer_timer_threshold_rx: RX REO2SW ring pointer update timer threshold
  * @pointer_timer_threshold_rx: RX REO2SW ring pointer update timer threshold
  * @pointer_num_threshold_rx: RX REO2SW ring pointer update entries 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 {
 struct wlan_cfg_dp_soc_ctxt {
 	int num_int_ctxts;
 	int num_int_ctxts;
@@ -537,6 +538,9 @@ struct wlan_cfg_dp_soc_ctxt {
 #endif
 #endif
 	uint16_t pointer_timer_threshold_rx;
 	uint16_t pointer_timer_threshold_rx;
 	uint8_t pointer_num_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
 uint8_t
 wlan_cfg_get_pointer_num_threshold_rx(struct wlan_cfg_dp_soc_ctxt *cfg);
 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*/
 #endif /*__WLAN_CFG_H*/