Pārlūkot izejas kodu

qcacmn: Compile out MTRACE feature

Fix to disabled MTRACE feature

Change-Id: I3cc30b47a9ba9dc9f99bf1185f99f0ae621f5f31
CRs-Fixed: 2189886
Rachit Kankane 7 gadi atpakaļ
vecāks
revīzija
9cc217ab6a
2 mainītis faili ar 38 papildinājumiem un 12 dzēšanām
  1. 34 8
      qdf/inc/qdf_trace.h
  2. 4 4
      qdf/linux/src/qdf_trace.c

+ 34 - 8
qdf/inc/qdf_trace.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014-2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
  *
  * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  *
@@ -77,10 +77,6 @@ typedef int (qdf_abstract_print)(void *priv, const char *fmt, ...);
 #define DPTRACE(p)
 #endif
 
-#ifdef CONFIG_MCL
-void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data);
-#endif
-
 /* By default Data Path module will have all log levels enabled, except debug
  * log level. Debug level will be left up to the framework or user space modules
  * to be enabled when issue is detected
@@ -115,12 +111,12 @@ void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data);
 #ifdef TRACE_RECORD
 
 #define MTRACE(p) p
-#define NO_SESSION 0xFF
 
 #else
-#define MTRACE(p) {  }
+#define MTRACE(p) do { } while (0)
 
 #endif
+#define NO_SESSION 0xFF
 
 /**
  * typedef struct qdf_trace_record_s - keep trace record
@@ -455,12 +451,42 @@ void qdf_register_debug_callback(QDF_MODULE_ID module_id,
 					tp_qdf_state_info_cb qdf_state_infocb);
 QDF_STATUS qdf_state_info_dump_all(char *buf, uint16_t size,
 			uint16_t *driver_dump_size);
+#ifdef TRACE_RECORD
 void qdf_trace_register(QDF_MODULE_ID, tp_qdf_trace_cb);
-QDF_STATUS qdf_trace_spin_lock_init(void);
 void qdf_trace_init(void);
+void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data);
 void qdf_trace_enable(uint32_t, uint8_t enable);
 void qdf_trace_dump_all(void *, uint8_t, uint8_t, uint32_t, uint32_t);
+QDF_STATUS qdf_trace_spin_lock_init(void);
+#else
+#ifdef CONFIG_MCL
+static inline
+void qdf_trace_init(void)
+{
+}
 
+static inline
+void qdf_trace_enable(uint32_t bitmask_of_module_id, uint8_t enable)
+{
+}
+static inline
+void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data)
+{
+}
+
+static inline
+void qdf_trace_dump_all(void *p_mac, uint8_t code, uint8_t session,
+			uint32_t count, uint32_t bitmask_of_module)
+{
+}
+
+static inline
+QDF_STATUS qdf_trace_spin_lock_init(void)
+{
+	return QDF_STATUS_E_INVAL;
+}
+#endif
+#endif
 
 #ifdef CONFIG_DP_TRACE
 void qdf_dp_set_proto_bitmap(uint32_t val);

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

@@ -92,6 +92,7 @@ module_trace_info g_qdf_trace_info[QDF_MODULE_ID_MAX] = {
 	[QDF_MODULE_ID_REGULATORY] = {QDF_DEFAULT_TRACE_LEVEL, "REG"},
 };
 
+#ifdef TRACE_RECORD
 /* Static and Global variables */
 static spinlock_t ltrace_lock;
 
@@ -108,6 +109,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];
+#endif
 static tp_qdf_state_info_cb qdf_state_info_table[QDF_MODULE_ID_MAX];
 
 #ifdef CONFIG_DP_TRACE
@@ -374,6 +376,7 @@ EXPORT_SYMBOL(qdf_trace_hex_dump);
 
 #endif
 
+#ifdef TRACE_RECORD
 /**
  * qdf_trace_enable() - Enable MTRACE for specific modules
  * @bitmask_of_module_id: Bitmask according to enum of the modules.
@@ -458,8 +461,6 @@ void qdf_trace_init(void)
 }
 EXPORT_SYMBOL(qdf_trace_init);
 
-#ifdef CONFIG_MCL
-
 /**
  * qdf_trace() - puts the messages in to ring-buffer
  * @module: Enum of module, basically module id.
@@ -529,8 +530,6 @@ void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data)
 }
 EXPORT_SYMBOL(qdf_trace);
 
-#endif
-
 /**
  * qdf_trace_spin_lock_init() - initializes the lock variable before use
  *
@@ -669,6 +668,7 @@ void qdf_trace_dump_all(void *p_mac, uint8_t code, uint8_t session,
 	}
 }
 EXPORT_SYMBOL(qdf_trace_dump_all);
+#endif
 
 /**
  * qdf_register_debugcb_init() - initializes debug callbacks