Prechádzať zdrojové kódy

qcacmn: Add ini support for DPTRACE

Add ini support and feature flag for
DPTRACE to enable/disable as per requirement.

Change-Id: I22c614460f4c95539e9183935be0d2057379c6d4
CRs-Fixed: 1008087
Nirav Shah 9 rokov pred
rodič
commit
ae6a0b31d2
2 zmenil súbory, kde vykonal 36 pridanie a 3 odobranie
  1. 32 2
      qdf/inc/qdf_trace.h
  2. 4 1
      qdf/linux/src/qdf_trace.c

+ 32 - 2
qdf/inc/qdf_trace.h

@@ -154,7 +154,11 @@ typedef struct s_qdf_trace_data {
 #define CASE_RETURN_STRING(str) case ((str)): return (uint8_t *)(# str);
 
 /* DP Trace Implementation */
+#ifdef FEATURE_DP_TRACE
 #define DPTRACE(p) p
+#else
+#define DPTRACE(p)
+#endif
 
 #define MAX_QDF_DP_TRACE_RECORDS       4000
 #define QDF_DP_TRACE_RECORD_SIZE       16
@@ -333,8 +337,12 @@ void qdf_trace_init(void);
 void qdf_trace_enable(uint32_t, uint8_t enable);
 void qdf_trace_dump_all(void *, uint8_t, uint8_t, uint32_t, uint32_t);
 
-void qdf_dp_trace_spin_lock_init(void);
+
+#ifdef FEATURE_DP_TRACE
+void qdf_dp_trace_log_pkt(uint8_t session_id, struct sk_buff *skb,
+				uint8_t event_type);
 void qdf_dp_trace_init(void);
+void qdf_dp_trace_spin_lock_init(void);
 void qdf_dp_trace_set_value(uint8_t proto_bitmap, uint8_t no_of_records,
 			 uint8_t verbosity);
 void qdf_dp_trace_set_track(qdf_nbuf_t nbuf);
@@ -356,8 +364,30 @@ qdf_dp_trace_proto_pkt(enum QDF_DP_TRACE_ID code, uint8_t vdev_id,
 		enum qdf_proto_subtype subtype, enum qdf_proto_dir dir);
 void qdf_dp_display_proto_pkt(struct qdf_dp_trace_record_s *record,
 				uint16_t index);
+#else
+static inline
 void qdf_dp_trace_log_pkt(uint8_t session_id, struct sk_buff *skb,
-				uint8_t event_type);
+				uint8_t event_type)
+{
+}
+static inline
+void qdf_dp_trace_init(void)
+{
+}
+static inline
+void qdf_dp_trace_set_track(qdf_nbuf_t nbuf)
+{
+}
+static inline
+void qdf_dp_trace_set_value(uint8_t proto_bitmap, uint8_t no_of_records,
+			 uint8_t verbosity)
+{
+}
+static inline
+void qdf_dp_trace_dump_all(uint32_t count)
+{
+}
+#endif
 
 
 /**

+ 4 - 1
qdf/linux/src/qdf_trace.c

@@ -103,6 +103,7 @@ static t_qdf_trace_data g_qdf_trace_data;
 static tp_qdf_trace_cb qdf_trace_cb_table[QDF_MODULE_ID_MAX];
 static tp_qdf_trace_cb qdf_trace_restore_cb_table[QDF_MODULE_ID_MAX];
 
+#ifdef FEATURE_DP_TRACE
 /* Static and Global variables */
 static spinlock_t l_dp_trace_lock;
 
@@ -119,7 +120,7 @@ static struct s_qdf_dp_trace_data g_qdf_dp_trace_data;
  * are stored in qdf_dp_trace_cb_table, callbacks are initialized during init
  */
 static tp_qdf_dp_trace_cb qdf_dp_trace_cb_table[QDF_DP_TRACE_MAX];
-
+#endif
 /**
  * qdf_trace_set_level() - Set the trace level for a particular module
  * @module: Module id
@@ -715,6 +716,7 @@ void qdf_trace_dump_all(void *p_mac, uint8_t code, uint8_t session,
 }
 EXPORT_SYMBOL(qdf_trace_dump_all);
 
+#ifdef FEATURE_DP_TRACE
 /**
  * qdf_dp_trace_init() - enables the DP trace
  * Called during driver load and it enables DP trace
@@ -1510,3 +1512,4 @@ void qdf_dp_trace_dump_all(uint32_t count)
 	}
 }
 EXPORT_SYMBOL(qdf_dp_trace_dump_all);
+#endif