瀏覽代碼

qcacld-3.0: Featurize dp trace

Featurize dp trace to compile out cleanly.

Change-Id: I23b86459af605baa257af4ef62497f010b864215
CRs-Fixed: 2228465
Nirav Shah 7 年之前
父節點
當前提交
d21a2e3d6c

+ 16 - 5
core/dp/txrx/ol_txrx.c

@@ -1253,6 +1253,7 @@ static void ol_txrx_tso_stats_clear(ol_txrx_pdev_handle pdev)
 }
 #endif /* defined(FEATURE_TSO) && defined(FEATURE_TSO_DEBUG) */
 
+#if defined(CONFIG_DP_TRACE) && defined(WLAN_DEBUGFS)
 /**
  * ol_txrx_read_dpt_buff_debugfs() - read dp trace buffer
  * @file: file to read
@@ -1329,6 +1330,21 @@ static int ol_txrx_debugfs_init(struct ol_txrx_pdev_t *pdev)
 	return 0;
 }
 
+static void ol_txrx_debugfs_exit(ol_txrx_pdev_handle pdev)
+{
+	qdf_debugfs_remove_dir_recursive(pdev->dpt_stats_log_dir);
+}
+#else
+static inline int ol_txrx_debugfs_init(struct ol_txrx_pdev_t *pdev)
+{
+	return 0;
+}
+
+static inline void ol_txrx_debugfs_exit(ol_txrx_pdev_handle pdev)
+{
+}
+#endif
+
 /**
  * ol_txrx_pdev_attach() - allocate txrx pdev
  * @ctrl_pdev: cfg pdev
@@ -2150,11 +2166,6 @@ static void ol_txrx_pdev_pre_detach(struct cdp_pdev *ppdev, int force)
 #endif
 }
 
-static void ol_txrx_debugfs_exit(ol_txrx_pdev_handle pdev)
-{
-	qdf_debugfs_remove_dir_recursive(pdev->dpt_stats_log_dir);
-}
-
 /**
  * ol_txrx_pdev_detach() - delete the data SW state
  * @ppdev - the data physical device object being removed

+ 4 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -9750,6 +9750,7 @@ enum dot11p_mode {
 #define CFG_ENABLE_TX_SCHED_WRR_BK_NAME     "gEnableTxSchedWrrBK"
 #define CFG_ENABLE_TX_SCHED_WRR_BK_DEFAULT  ""
 
+#ifdef CONFIG_DP_TRACE
 /*
  * Enable/disable DPTRACE
  * Enabling this might have performace impact.
@@ -9820,6 +9821,7 @@ enum dot11p_mode {
  */
 #define CFG_ENABLE_DP_TRACE_CONFIG		"gDptraceConfig"
 #define CFG_ENABLE_DP_TRACE_CONFIG_DEFAULT	"1, 8, 1, 126"
+#endif
 
 /*
  * This parameter will set the weight to calculate the average low pass
@@ -14910,8 +14912,10 @@ struct hdd_config {
 
 	bool enable_fatal_event;
 	bool bpf_enabled;
+#ifdef CONFIG_DP_TRACE
 	bool enable_dp_trace;
 	uint8_t dp_trace_config[DP_TRACE_CONFIG_STRING_LENGTH];
+#endif
 	bool adaptive_dwell_mode_enabled;
 	enum scan_dwelltime_adaptive_mode scan_adaptive_dwell_mode;
 	enum scan_dwelltime_adaptive_mode scan_adaptive_dwell_mode_nc;

+ 6 - 0
core/hdd/inc/wlan_hdd_main.h

@@ -3068,7 +3068,13 @@ static inline void hdd_dev_setup_destructor(struct net_device *dev)
  *
  * Return: NONE
  */
+#ifdef CONFIG_DP_TRACE
 void hdd_dp_trace_init(struct hdd_config *config);
+#else
+static inline
+void hdd_dp_trace_init(struct hdd_config *config) {}
+#endif
+
 void hdd_set_rx_mode_rps(bool enable);
 
 /**

+ 7 - 0
core/hdd/inc/wlan_hdd_wext.h

@@ -295,4 +295,11 @@ int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2)
 }
 #endif
 
+#ifdef CONFIG_DP_TRACE
+void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count);
+#else
+static inline
+void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count) {}
+#endif
+
 #endif /* __WEXT_IW_H__ */

+ 22 - 6
core/hdd/src/wlan_hdd_cfg.c

@@ -4047,6 +4047,7 @@ struct reg_table_entry g_registry_table[] = {
 		CFG_USER_ACS_DFS_LTE_DISABLE,
 		CFG_USER_ACS_DFS_LTE_ENABLE),
 
+#ifdef CONFIG_DP_TRACE
 	REG_VARIABLE(CFG_ENABLE_DP_TRACE, WLAN_PARAM_Integer,
 		struct hdd_config, enable_dp_trace,
 		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -4059,6 +4060,7 @@ struct reg_table_entry g_registry_table[] = {
 			struct hdd_config, dp_trace_config,
 			VAR_FLAGS_OPTIONAL,
 			(void *) CFG_ENABLE_DP_TRACE_CONFIG_DEFAULT),
+#endif
 
 	REG_VARIABLE(CFG_ADAPTIVE_SCAN_DWELL_MODE_NAME, WLAN_PARAM_Integer,
 		struct hdd_config, scan_adaptive_dwell_mode,
@@ -6340,6 +6342,23 @@ static void hdd_cfg_print_sae(struct hdd_context *hdd_ctx)
 }
 #endif
 
+
+#ifdef CONFIG_DP_TRACE
+static void hdd_cfg_print_dp_trace_params(struct hdd_context *hdd_ctx)
+{
+	hdd_info("Name = [%s] Value = [%u]",
+		 CFG_ENABLE_DP_TRACE,
+		 hdd_ctx->config->enable_dp_trace);
+	hdd_debug("Name = [%s] Value = [%s]",
+		  CFG_ENABLE_DP_TRACE_CONFIG,
+		  hdd_ctx->config->dp_trace_config);
+}
+#else
+static void hdd_cfg_print_dp_trace_params(struct hdd_context *hdd_ctx)
+{
+}
+#endif
+
 /**
  * hdd_cgf_print_11k_offload_params() - Print 11k offload related parameters
  * @hdd_ctx: Pointer to HDD context
@@ -7023,12 +7042,9 @@ void hdd_cfg_print(struct hdd_context *hdd_ctx)
 	hdd_debug("Name = [%s] Value = [%s]",
 		CFG_ENABLE_TX_SCHED_WRR_BE_NAME,
 		hdd_ctx->config->tx_sched_wrr_be);
-	hdd_info("Name = [%s] Value = [%u]",
-		CFG_ENABLE_DP_TRACE,
-		hdd_ctx->config->enable_dp_trace);
-	hdd_debug("Name = [%s] Value = [%s]",
-		CFG_ENABLE_DP_TRACE_CONFIG,
-		hdd_ctx->config->dp_trace_config);
+
+	hdd_cfg_print_dp_trace_params(hdd_ctx);
+
 	hdd_debug("Name = [%s] Value = [%u]",
 		CFG_ADAPTIVE_SCAN_DWELL_MODE_NAME,
 		hdd_ctx->config->scan_adaptive_dwell_mode);

+ 5 - 11
core/hdd/src/wlan_hdd_hostapd.c

@@ -3060,17 +3060,7 @@ static int __iw_softap_set_two_ints_getnone(struct net_device *dev,
 		break;
 
 	case QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL:
-		hdd_debug("WE_DUMP_DP_TRACE: %d %d",
-		       value[1], value[2]);
-		if (value[1] == DUMP_DP_TRACE)
-			qdf_dp_trace_dump_all(value[2],
-				QDF_TRACE_DEFAULT_PDEV_ID);
-		else if (value[1] == ENABLE_DP_TRACE_LIVE_MODE)
-			qdf_dp_trace_enable_live_mode();
-		else if (value[1] == CLEAR_DP_TRACE_BUFFER)
-			qdf_dp_trace_clear_buffer();
-		else if (value[1] == DISABLE_DP_TRACE_LIVE_MODE)
-			qdf_dp_trace_disable_live_mode();
+		hdd_set_dump_dp_trace(value[1], value[2]);
 		break;
 
 	case QCSAP_ENABLE_FW_PROFILE:
@@ -5830,12 +5820,14 @@ static const struct iw_priv_args hostapd_private_args[] = {
 		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "setsapchannels"
 	}
 	,
+#ifdef CONFIG_DP_TRACE
 	/* handlers for sub-ioctl */
 	{
 		WE_SET_DP_TRACE,
 		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3, 0, "set_dp_trace"
 	}
 	,
+#endif
 	/* handlers for main ioctl */
 	{
 		QCSAP_IOCTL_PRIV_SET_VAR_INT_GET_NONE,
@@ -5925,6 +5917,7 @@ static const struct iw_priv_args hostapd_private_args[] = {
 		0,  "setRadarDbg"
 	}
 	,
+#ifdef CONFIG_DP_TRACE
 	/* dump dp trace - descriptor or dp trace records */
 	{
 		QCSAP_IOCTL_DUMP_DP_TRACE_LEVEL,
@@ -5932,6 +5925,7 @@ static const struct iw_priv_args hostapd_private_args[] = {
 		0, "dump_dp_trace"
 	}
 	,
+#endif
 	{
 		QCSAP_ENABLE_FW_PROFILE,
 		IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,

+ 9 - 2
core/hdd/src/wlan_hdd_main.c

@@ -10615,6 +10615,7 @@ static void wlan_init_bug_report_lock(void)
 	qdf_spinlock_create(&p_cds_context->bug_report_lock);
 }
 
+#ifdef CONFIG_DP_TRACE
 void hdd_dp_trace_init(struct hdd_config *config)
 {
 
@@ -10627,6 +10628,11 @@ void hdd_dp_trace_init(struct hdd_config *config)
 	uint8_t num_entries = 0;
 	uint32_t bw_compute_interval;
 
+	if (!config->enable_dp_trace) {
+		hdd_err("dp trace is disabled from ini");
+		return;
+	}
+
 	hdd_string_to_u8_array(config->dp_trace_config, config_params,
 				&num_entries, sizeof(config_params));
 
@@ -10663,6 +10669,8 @@ void hdd_dp_trace_init(struct hdd_config *config)
 			verbosity, proto_bitmap);
 
 }
+#endif
+
 /**
  * hdd_wlan_startup() - HDD init function
  * @dev:	Pointer to the underlying device
@@ -10725,8 +10733,7 @@ int hdd_wlan_startup(struct device *dev)
 		goto err_stop_modules;
 	}
 
-	if (hdd_ctx->config->enable_dp_trace)
-		hdd_dp_trace_init(hdd_ctx->config);
+	hdd_dp_trace_init(hdd_ctx->config);
 
 	hdd_initialize_mac_address(hdd_ctx);
 

+ 1 - 2
core/hdd/src/wlan_hdd_power.c

@@ -1375,8 +1375,7 @@ QDF_STATUS hdd_wlan_re_init(void)
 	if (!adapter)
 		hdd_err("Failed to get adapter");
 
-	if (hdd_ctx->config->enable_dp_trace)
-		hdd_dp_trace_init(hdd_ctx->config);
+	hdd_dp_trace_init(hdd_ctx->config);
 
 	hdd_bus_bandwidth_init(hdd_ctx);
 

+ 21 - 12
core/hdd/src/wlan_hdd_wext.c

@@ -6258,7 +6258,6 @@ static int __iw_set_three_ints_getnone(struct net_device *dev,
 	case WE_SET_DP_TRACE:
 		qdf_dp_trace_set_value(value[1], value[2], value[3]);
 		break;
-
 	/* value[3] the acs band is not required as start and end channels are
 	 * enough but this cmd is maintained under set three ints for historic
 	 * reasons.
@@ -9033,6 +9032,22 @@ int hdd_crash_inject(struct hdd_adapter *adapter, uint32_t v1, uint32_t v2)
 }
 #endif
 
+#ifdef CONFIG_DP_TRACE
+void hdd_set_dump_dp_trace(uint16_t cmd_type, uint16_t count)
+{
+	hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d",
+		  cmd_type, count);
+	if (cmd_type == DUMP_DP_TRACE)
+		qdf_dp_trace_dump_all(count, QDF_TRACE_DEFAULT_PDEV_ID);
+	else if (cmd_type == ENABLE_DP_TRACE_LIVE_MODE)
+		qdf_dp_trace_enable_live_mode();
+	else if (cmd_type == CLEAR_DP_TRACE_BUFFER)
+		qdf_dp_trace_clear_buffer();
+	else if (cmd_type == DISABLE_DP_TRACE_LIVE_MODE)
+		qdf_dp_trace_disable_live_mode();
+}
+#endif
+
 static int __iw_set_two_ints_getnone(struct net_device *dev,
 				     struct iw_request_info *info,
 				     union iwreq_data *wrqu, char *extra)
@@ -9112,17 +9127,7 @@ static int __iw_set_two_ints_getnone(struct net_device *dev,
 			value[1], value[2]);
 		break;
 	case WE_DUMP_DP_TRACE_LEVEL:
-		hdd_debug("WE_DUMP_DP_TRACE_LEVEL: %d %d",
-		       value[1], value[2]);
-		if (value[1] == DUMP_DP_TRACE)
-			qdf_dp_trace_dump_all(value[2],
-					QDF_TRACE_DEFAULT_PDEV_ID);
-		else if (value[1] == ENABLE_DP_TRACE_LIVE_MODE)
-			qdf_dp_trace_enable_live_mode();
-		else if (value[1] == CLEAR_DP_TRACE_BUFFER)
-			qdf_dp_trace_clear_buffer();
-		else if (value[1] == DISABLE_DP_TRACE_LIVE_MODE)
-			qdf_dp_trace_disable_live_mode();
+		hdd_set_dump_dp_trace(value[1], value[2]);
 		break;
 	case WE_SET_MON_MODE_CHAN:
 		ret = wlan_hdd_set_mon_chan(adapter, value[1], value[2]);
@@ -9962,11 +9967,13 @@ static const struct iw_priv_args we_private_args[] = {
 	 0,
 	 "setwlandbg"},
 
+#ifdef CONFIG_DP_TRACE
 	/* handlers for sub-ioctl */
 	{WE_SET_DP_TRACE,
 	IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,
 	0,
 	"set_dp_trace"},
+#endif
 
 	{WE_SET_SAP_CHANNELS,
 	IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 3,
@@ -10345,10 +10352,12 @@ static const struct iw_priv_args we_private_args[] = {
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 0, "set_fw_mode_cfg"}
 	,
+#ifdef CONFIG_DP_TRACE
 	{WE_DUMP_DP_TRACE_LEVEL,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 0, "dump_dp_trace"}
 	,
+#endif
 	{WE_SET_MON_MODE_CHAN,
 	 IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 2,
 	 0, "setMonChan"}