qdf_trace.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. /*
  2. * Copyright (c) 2014-2016 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. #if !defined(__QDF_TRACE_H)
  27. #define __QDF_TRACE_H
  28. /**
  29. * DOC: qdf_trace
  30. * QCA driver framework trace APIs
  31. * Trace, logging, and debugging definitions and APIs
  32. */
  33. /* Include Files */
  34. #include <qdf_types.h> /* For QDF_MODULE_ID... */
  35. #include <stdarg.h> /* For va_list... */
  36. #include <qdf_status.h>
  37. #include <qdf_nbuf.h>
  38. #include <i_qdf_types.h>
  39. /* Type declarations */
  40. #define FL(x) "%s: %d: " x, __func__, __LINE__
  41. /**
  42. * typedef enum QDF_TRACE_LEVEL - Debug Trace level
  43. * @QDF_TRACE_LEVEL_NONE: no trace will be logged. This value is in place
  44. * for the qdf_trace_setlevel() to allow the user to turn off all traces
  45. * @QDF_TRACE_LEVEL_FATAL: enable trace for fatal Error
  46. * @QDF_TRACE_LEVEL_ERROR: enable trace for errors
  47. * @QDF_TRACE_LEVEL_WARN: enable trace for warnings
  48. * @QDF_TRACE_LEVEL_INFO: enable trace for information
  49. * @QDF_TRACE_LEVEL_INFO_HIGH: enable high level trace information
  50. * @QDF_TRACE_LEVEL_INFO_MED: enable middle level trace information
  51. * @QDF_TRACE_LEVEL_INFO_LOW: enable low level trace information
  52. * @QDF_TRACE_LEVEL_DEBUG: enable trace for debugging
  53. * @QDF_TRACE_LEVEL_ALL: enable all trace
  54. * @QDF_TRACE_LEVEL_MAX: enable max level trace
  55. */
  56. typedef enum {
  57. QDF_TRACE_LEVEL_NONE = 0,
  58. QDF_TRACE_LEVEL_FATAL,
  59. QDF_TRACE_LEVEL_ERROR,
  60. QDF_TRACE_LEVEL_WARN,
  61. QDF_TRACE_LEVEL_INFO,
  62. QDF_TRACE_LEVEL_INFO_HIGH,
  63. QDF_TRACE_LEVEL_INFO_MED,
  64. QDF_TRACE_LEVEL_INFO_LOW,
  65. QDF_TRACE_LEVEL_DEBUG,
  66. QDF_TRACE_LEVEL_ALL,
  67. QDF_TRACE_LEVEL_MAX
  68. } QDF_TRACE_LEVEL;
  69. /*
  70. * Log levels
  71. */
  72. #define QDF_DEBUG_FUNCTRACE 0x01
  73. #define QDF_DEBUG_LEVEL0 0x02
  74. #define QDF_DEBUG_LEVEL1 0x04
  75. #define QDF_DEBUG_LEVEL2 0x08
  76. #define QDF_DEBUG_LEVEL3 0x10
  77. #define QDF_DEBUG_ERROR 0x20
  78. #define QDF_DEBUG_CFG 0x40
  79. #ifdef CONFIG_MCL
  80. /* By default Data Path module will have all log levels enabled, except debug
  81. * log level. Debug level will be left up to the framework or user space modules
  82. * to be enabled when issue is detected
  83. */
  84. #define QDF_DATA_PATH_TRACE_LEVEL \
  85. ((1 << QDF_TRACE_LEVEL_FATAL) | (1 << QDF_TRACE_LEVEL_ERROR) | \
  86. (1 << QDF_TRACE_LEVEL_WARN) | (1 << QDF_TRACE_LEVEL_INFO) | \
  87. (1 << QDF_TRACE_LEVEL_INFO_HIGH) | (1 << QDF_TRACE_LEVEL_INFO_MED) | \
  88. (1 << QDF_TRACE_LEVEL_INFO_LOW))
  89. /* Preprocessor definitions and constants */
  90. #define ASSERT_BUFFER_SIZE (512)
  91. #define MAX_QDF_TRACE_RECORDS 4000
  92. #define INVALID_QDF_TRACE_ADDR 0xffffffff
  93. #define DEFAULT_QDF_TRACE_DUMP_COUNT 0
  94. #include <i_qdf_trace.h>
  95. #define DUMP_DP_TRACE 0
  96. #define ENABLE_DP_TRACE_LIVE_MODE 1
  97. #ifdef TRACE_RECORD
  98. #define MTRACE(p) p
  99. #define NO_SESSION 0xFF
  100. #else
  101. #define MTRACE(p) { }
  102. #endif
  103. /**
  104. * typedef struct qdf_trace_record_s - keep trace record
  105. * @time: timestamp
  106. * @module: module name
  107. * @code: hold record of code
  108. * @session: hold record of session
  109. * @data: hold data
  110. * @pid: hold pid of the process
  111. */
  112. typedef struct qdf_trace_record_s {
  113. uint64_t time;
  114. uint8_t module;
  115. uint8_t code;
  116. uint16_t session;
  117. uint32_t data;
  118. uint32_t pid;
  119. } qdf_trace_record_t, *tp_qdf_trace_record;
  120. /**
  121. * typedef struct s_qdf_trace_data - MTRACE logs are stored in ring buffer
  122. * @head: position of first record
  123. * @tail: position of last record
  124. * @num: count of total record
  125. * @num_since_last_dump: count from last dump
  126. * @enable: config for controlling the trace
  127. * @dump_count: Dump after number of records reach this number
  128. */
  129. typedef struct s_qdf_trace_data {
  130. uint32_t head;
  131. uint32_t tail;
  132. uint32_t num;
  133. uint16_t num_since_last_dump;
  134. uint8_t enable;
  135. uint16_t dump_count;
  136. } t_qdf_trace_data;
  137. #define CASE_RETURN_STRING(str) case ((str)): return (uint8_t *)(# str);
  138. /* DP Trace Implementation */
  139. #ifdef FEATURE_DP_TRACE
  140. #define DPTRACE(p) p
  141. #else
  142. #define DPTRACE(p)
  143. #endif
  144. #define MAX_QDF_DP_TRACE_RECORDS 4000
  145. #define QDF_DP_TRACE_RECORD_SIZE 16
  146. #define INVALID_QDF_DP_TRACE_ADDR 0xffffffff
  147. #define QDF_DP_TRACE_VERBOSITY_HIGH 3
  148. #define QDF_DP_TRACE_VERBOSITY_MEDIUM 2
  149. #define QDF_DP_TRACE_VERBOSITY_LOW 1
  150. #define QDF_DP_TRACE_VERBOSITY_DEFAULT 0
  151. /**
  152. * enum QDF_DP_TRACE_ID - Generic ID to identify various events in data path
  153. * @QDF_DP_TRACE_INVALID - invalid
  154. * @QDF_DP_TRACE_DROP_PACKET_RECORD - record drop packet
  155. * @QDF_DP_TRACE_EAPOL_PACKET_RECORD - record EAPOL packet
  156. * @QDF_DP_TRACE_DHCP_PACKET_RECORD - record DHCP packet
  157. * @QDF_DP_TRACE_ARP_PACKET_RECORD - record ARP packet
  158. * @QDF_DP_TRACE_MGMT_PACKET_RECORD - record MGMT pacekt
  159. * @QDF_DP_TRACE_DEFAULT_VERBOSITY - below this are part of default verbosity
  160. * @QDF_DP_TRACE_HDD_TX_TIMEOUT - HDD tx timeout
  161. * @QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT- SOFTAP HDD tx timeout
  162. * @QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD - HDD layer ptr record
  163. * @QDF_DP_TRACE_CE_PACKET_PTR_RECORD - CE layer ptr record
  164. * @QDF_DP_TRACE_CE_FAST_PACKET_PTR_RECORD- CE fastpath ptr record
  165. * @QDF_DP_TRACE_FREE_PACKET_PTR_RECORD - tx completion ptr record
  166. * @QDF_DP_TRACE_RX_HTT_PACKET_PTR_RECORD - HTT RX record
  167. * @QDF_DP_TRACE_RX_OFFLOAD_HTT_PACKET_PTR_RECORD- HTT RX offload record
  168. * @QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD - HDD RX record
  169. * @QDF_DP_TRACE_LOW_VERBOSITY - below this are part of low verbosity
  170. * @QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD -tx queue ptr record
  171. * @QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD - txrx packet ptr record
  172. * @QDF_DP_TRACE_TXRX_FAST_PACKET_PTR_RECORD - txrx fast path record
  173. * @QDF_DP_TRACE_HTT_PACKET_PTR_RECORD - htt packet ptr record
  174. * @QDF_DP_TRACE_HTC_PACKET_PTR_RECORD - htc packet ptr record
  175. * @QDF_DP_TRACE_HIF_PACKET_PTR_RECORD - hif packet ptr record
  176. * @QDF_DP_TRACE_RX_TXRX_PACKET_PTR_RECORD - txrx packet ptr record
  177. * @QDF_DP_TRACE_MED_VERBOSITY - below this are part of med verbosity
  178. * @QDF_DP_TRACE_HDD_TX_PACKET_RECORD - record 32 bytes at HDD
  179. * @QDF_DP_TRACE_HIGH_VERBOSITY - below this are part of high verbosity
  180. */
  181. enum QDF_DP_TRACE_ID {
  182. QDF_DP_TRACE_INVALID,
  183. QDF_DP_TRACE_DROP_PACKET_RECORD,
  184. QDF_DP_TRACE_EAPOL_PACKET_RECORD,
  185. QDF_DP_TRACE_DHCP_PACKET_RECORD,
  186. QDF_DP_TRACE_ARP_PACKET_RECORD,
  187. QDF_DP_TRACE_MGMT_PACKET_RECORD,
  188. QDF_DP_TRACE_DEFAULT_VERBOSITY,
  189. QDF_DP_TRACE_HDD_TX_TIMEOUT,
  190. QDF_DP_TRACE_HDD_SOFTAP_TX_TIMEOUT,
  191. QDF_DP_TRACE_HDD_TX_PACKET_PTR_RECORD,
  192. QDF_DP_TRACE_CE_PACKET_PTR_RECORD,
  193. QDF_DP_TRACE_CE_FAST_PACKET_PTR_RECORD,
  194. QDF_DP_TRACE_FREE_PACKET_PTR_RECORD,
  195. QDF_DP_TRACE_RX_HTT_PACKET_PTR_RECORD,
  196. QDF_DP_TRACE_RX_OFFLOAD_HTT_PACKET_PTR_RECORD,
  197. QDF_DP_TRACE_RX_HDD_PACKET_PTR_RECORD,
  198. QDF_DP_TRACE_LOW_VERBOSITY,
  199. QDF_DP_TRACE_TXRX_QUEUE_PACKET_PTR_RECORD,
  200. QDF_DP_TRACE_TXRX_PACKET_PTR_RECORD,
  201. QDF_DP_TRACE_TXRX_FAST_PACKET_PTR_RECORD,
  202. QDF_DP_TRACE_HTT_PACKET_PTR_RECORD,
  203. QDF_DP_TRACE_HTC_PACKET_PTR_RECORD,
  204. QDF_DP_TRACE_HIF_PACKET_PTR_RECORD,
  205. QDF_DP_TRACE_RX_TXRX_PACKET_PTR_RECORD,
  206. QDF_DP_TRACE_MED_VERBOSITY,
  207. QDF_DP_TRACE_HDD_TX_PACKET_RECORD,
  208. QDF_DP_TRACE_HIGH_VERBOSITY,
  209. QDF_DP_TRACE_MAX
  210. };
  211. /**
  212. * qdf_proto_type - protocol type
  213. * @QDF_PROTO_TYPE_DHCP - DHCP
  214. * @QDF_PROTO_TYPE_EAPOL - EAPOL
  215. * @QDF_PROTO_TYPE_ARP - ARP
  216. * @QDF_PROTO_TYPE_MGMT - MGMT
  217. */
  218. enum qdf_proto_type {
  219. QDF_PROTO_TYPE_DHCP,
  220. QDF_PROTO_TYPE_EAPOL,
  221. QDF_PROTO_TYPE_ARP,
  222. QDF_PROTO_TYPE_MGMT,
  223. QDF_PROTO_TYPE_MAX
  224. };
  225. /**
  226. * qdf_proto_subtype - subtype of packet
  227. * @QDF_PROTO_EAPOL_M1 - EAPOL 1/4
  228. * @QDF_PROTO_EAPOL_M2 - EAPOL 2/4
  229. * @QDF_PROTO_EAPOL_M3 - EAPOL 3/4
  230. * @QDF_PROTO_EAPOL_M4 - EAPOL 4/4
  231. * @QDF_PROTO_DHCP_DISCOVER - discover
  232. * @QDF_PROTO_DHCP_REQUEST - request
  233. * @QDF_PROTO_DHCP_OFFER - offer
  234. * @QDF_PROTO_DHCP_ACK - ACK
  235. * @QDF_PROTO_DHCP_NACK - NACK
  236. * @QDF_PROTO_DHCP_RELEASE - release
  237. * @QDF_PROTO_DHCP_INFORM - inform
  238. * @QDF_PROTO_DHCP_DECLINE - decline
  239. * @QDF_PROTO_ARP_SUBTYPE - arp
  240. * @QDF_PROTO_MGMT_ASSOC -assoc
  241. * @QDF_PROTO_MGMT_DISASSOC - disassoc
  242. * @QDF_PROTO_MGMT_AUTH - auth
  243. * @QDF_PROTO_MGMT_DEAUTH - deauth
  244. */
  245. enum qdf_proto_subtype {
  246. QDF_PROTO_INVALID,
  247. QDF_PROTO_EAPOL_M1,
  248. QDF_PROTO_EAPOL_M2,
  249. QDF_PROTO_EAPOL_M3,
  250. QDF_PROTO_EAPOL_M4,
  251. QDF_PROTO_DHCP_DISCOVER,
  252. QDF_PROTO_DHCP_REQUEST,
  253. QDF_PROTO_DHCP_OFFER,
  254. QDF_PROTO_DHCP_ACK,
  255. QDF_PROTO_DHCP_NACK,
  256. QDF_PROTO_DHCP_RELEASE,
  257. QDF_PROTO_DHCP_INFORM,
  258. QDF_PROTO_DHCP_DECLINE,
  259. QDF_PROTO_ARP_SUBTYPE,
  260. QDF_PROTO_MGMT_ASSOC,
  261. QDF_PROTO_MGMT_DISASSOC,
  262. QDF_PROTO_MGMT_AUTH,
  263. QDF_PROTO_MGMT_DEAUTH,
  264. QDF_PROTO_SUBTYPE_MAX
  265. };
  266. /**
  267. * qdf_proto_dir - direction
  268. * @QDF_TX: TX direction
  269. * @QDF_RX: RX direction
  270. * @QDF_NA: not applicable
  271. */
  272. enum qdf_proto_dir {
  273. QDF_TX,
  274. QDF_RX,
  275. QDF_NA
  276. };
  277. /**
  278. * struct qdf_dp_trace_ptr_buf - pointer record buffer
  279. * @cookie: cookie value
  280. * @msdu_id: msdu_id
  281. * @status: completion status
  282. */
  283. struct qdf_dp_trace_ptr_buf {
  284. uint64_t cookie;
  285. uint16_t msdu_id;
  286. uint16_t status;
  287. };
  288. /**
  289. * struct qdf_dp_trace_proto_buf - proto packet buffer
  290. * @sa: source address
  291. * @da: destination address
  292. * @vdev_id : vdev id
  293. * @type: packet type
  294. * @subtype: packet subtype
  295. * @dir: direction
  296. */
  297. struct qdf_dp_trace_proto_buf {
  298. struct qdf_mac_addr sa;
  299. struct qdf_mac_addr da;
  300. uint8_t vdev_id;
  301. uint8_t type;
  302. uint8_t subtype;
  303. uint8_t dir;
  304. };
  305. /**
  306. * struct qdf_dp_trace_mgmt_buf - mgmt packet buffer
  307. * @vdev_id : vdev id
  308. * @type: packet type
  309. * @subtype: packet subtype
  310. */
  311. struct qdf_dp_trace_mgmt_buf {
  312. uint8_t vdev_id;
  313. uint8_t type;
  314. uint8_t subtype;
  315. };
  316. /**
  317. * struct qdf_dp_trace_record_s - Describes a record in DP trace
  318. * @time: time when it got stored
  319. * @code: Describes the particular event
  320. * @data: buffer to store data
  321. * @size: Length of the valid data stored in this record
  322. * @pid : process id which stored the data in this record
  323. */
  324. struct qdf_dp_trace_record_s {
  325. uint64_t time;
  326. uint8_t code;
  327. uint8_t data[QDF_DP_TRACE_RECORD_SIZE];
  328. uint8_t size;
  329. uint32_t pid;
  330. };
  331. /**
  332. * struct qdf_dp_trace_data - Parameters to configure/control DP trace
  333. * @head: Position of first record
  334. * @tail: Position of last record
  335. * @num: Current index
  336. * @proto_bitmap: defines which protocol to be traced
  337. * @no_of_record: defines every nth packet to be traced
  338. * @verbosity : defines verbosity level
  339. * @enable: enable/disable DP trace
  340. * @count: current packet number
  341. */
  342. struct s_qdf_dp_trace_data {
  343. uint32_t head;
  344. uint32_t tail;
  345. uint32_t num;
  346. uint8_t proto_bitmap;
  347. uint8_t no_of_record;
  348. uint8_t verbosity;
  349. bool enable;
  350. uint32_t tx_count;
  351. uint32_t rx_count;
  352. bool live_mode;
  353. };
  354. /* Function declarations and documenation */
  355. /**
  356. * qdf_trace_set_level() - Set the trace level for a particular module
  357. * @level : trace level
  358. *
  359. * Trace level is a member of the QDF_TRACE_LEVEL enumeration indicating
  360. * the severity of the condition causing the trace message to be issued.
  361. * More severe conditions are more likely to be logged.
  362. *
  363. * This is an external API that allows trace levels to be set for each module.
  364. *
  365. * Return: nothing
  366. */
  367. void qdf_trace_set_level(QDF_MODULE_ID module, QDF_TRACE_LEVEL level);
  368. /**
  369. * qdf_trace_get_level() - get the trace level
  370. * @level : trace level
  371. *
  372. * This is an external API that returns a bool value to signify if a
  373. * particular trace level is set for the specified module.
  374. * A member of the QDF_TRACE_LEVEL enumeration indicating the severity
  375. * of the condition causing the trace message to be issued.
  376. *
  377. * Note that individual trace levels are the only valid values
  378. * for this API. QDF_TRACE_LEVEL_NONE and QDF_TRACE_LEVEL_ALL
  379. * are not valid input and will return false
  380. *
  381. * Return:
  382. * false - the specified trace level for the specified module is OFF
  383. * true - the specified trace level for the specified module is ON
  384. */
  385. bool qdf_trace_get_level(QDF_MODULE_ID module, QDF_TRACE_LEVEL level);
  386. typedef void (*tp_qdf_trace_cb)(void *p_mac, tp_qdf_trace_record, uint16_t);
  387. void qdf_trace(uint8_t module, uint8_t code, uint16_t session, uint32_t data);
  388. void qdf_trace_register(QDF_MODULE_ID, tp_qdf_trace_cb);
  389. QDF_STATUS qdf_trace_spin_lock_init(void);
  390. void qdf_trace_init(void);
  391. void qdf_trace_enable(uint32_t, uint8_t enable);
  392. void qdf_trace_dump_all(void *, uint8_t, uint8_t, uint32_t, uint32_t);
  393. #ifdef FEATURE_DP_TRACE
  394. void qdf_dp_trace_log_pkt(uint8_t session_id, struct sk_buff *skb,
  395. enum qdf_proto_dir dir);
  396. void qdf_dp_trace_init(void);
  397. void qdf_dp_trace_spin_lock_init(void);
  398. void qdf_dp_trace_set_value(uint8_t proto_bitmap, uint8_t no_of_records,
  399. uint8_t verbosity);
  400. void qdf_dp_trace_set_track(qdf_nbuf_t nbuf, enum qdf_proto_dir dir);
  401. void qdf_dp_trace(qdf_nbuf_t nbuf, enum QDF_DP_TRACE_ID code,
  402. uint8_t *data, uint8_t size, enum qdf_proto_dir dir);
  403. void qdf_dp_trace_dump_all(uint32_t count);
  404. typedef void (*tp_qdf_dp_trace_cb)(struct qdf_dp_trace_record_s* , uint16_t);
  405. void qdf_dp_display_record(struct qdf_dp_trace_record_s *record,
  406. uint16_t index);
  407. void qdf_dp_trace_ptr(qdf_nbuf_t nbuf, enum QDF_DP_TRACE_ID code,
  408. uint8_t *data, uint8_t size, uint16_t msdu_id, uint16_t status);
  409. void qdf_dp_display_ptr_record(struct qdf_dp_trace_record_s *pRecord,
  410. uint16_t recIndex);
  411. uint8_t qdf_dp_get_proto_bitmap(void);
  412. void
  413. qdf_dp_trace_proto_pkt(enum QDF_DP_TRACE_ID code, uint8_t vdev_id,
  414. uint8_t *sa, uint8_t *da, enum qdf_proto_type type,
  415. enum qdf_proto_subtype subtype, enum qdf_proto_dir dir);
  416. void qdf_dp_display_proto_pkt(struct qdf_dp_trace_record_s *record,
  417. uint16_t index);
  418. void qdf_dp_trace_enable_live_mode(void);
  419. void qdf_dp_trace_mgmt_pkt(enum QDF_DP_TRACE_ID code, uint8_t vdev_id,
  420. enum qdf_proto_type type, enum qdf_proto_subtype subtype);
  421. void qdf_dp_display_mgmt_pkt(struct qdf_dp_trace_record_s *record,
  422. uint16_t index);
  423. #else
  424. static inline
  425. void qdf_dp_trace_log_pkt(uint8_t session_id, struct sk_buff *skb,
  426. enum qdf_proto_dir dir)
  427. {
  428. }
  429. static inline
  430. void qdf_dp_trace_init(void)
  431. {
  432. }
  433. static inline
  434. void qdf_dp_trace_set_track(qdf_nbuf_t nbuf, enum qdf_proto_dir dir)
  435. {
  436. }
  437. static inline
  438. void qdf_dp_trace_set_value(uint8_t proto_bitmap, uint8_t no_of_records,
  439. uint8_t verbosity)
  440. {
  441. }
  442. static inline
  443. void qdf_dp_trace_dump_all(uint32_t count)
  444. {
  445. }
  446. static inline
  447. void qdf_dp_trace_enable_live_mode(void)
  448. {
  449. }
  450. #endif
  451. /**
  452. * qdf_trace_msg()- logging API
  453. * @module: Module identifier. A member of the QDF_MODULE_ID enumeration that
  454. * identifies the module issuing the trace message.
  455. * @level: Trace level. A member of the QDF_TRACE_LEVEL enumeration indicating
  456. * the severity of the condition causing the trace message to be issued.
  457. * More severe conditions are more likely to be logged.
  458. * @str_format: Format string. The message to be logged. This format string
  459. * contains printf-like replacement parameters, which follow this
  460. * parameter in the variable argument list.
  461. *
  462. * Users wishing to add tracing information to their code should use
  463. * QDF_TRACE. QDF_TRACE() will compile into a call to qdf_trace_msg() when
  464. * tracing is enabled.
  465. *
  466. * Return: nothing
  467. *
  468. */
  469. void __printf(3, 4) qdf_trace_msg(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
  470. char *str_format, ...);
  471. void qdf_trace_hex_dump(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
  472. void *data, int buf_len);
  473. void qdf_trace_display(void);
  474. void qdf_trace_set_value(QDF_MODULE_ID module, QDF_TRACE_LEVEL level,
  475. uint8_t on);
  476. void qdf_trace_set_module_trace_level(QDF_MODULE_ID module, uint32_t level);
  477. void __printf(3, 4) qdf_snprintf(char *str_buffer, unsigned int size,
  478. char *str_format, ...);
  479. #define QDF_SNPRINTF qdf_snprintf
  480. #else
  481. #define DPTRACE(x)
  482. #define qdf_trace_hex_dump(x, y, z, q)
  483. #endif /* CONFIG_MCL */
  484. #endif /* __QDF_TRACE_H */