blob: d5b96004bf9aa393cadedb3924f76992b75ae94f [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Kiet Lam26cd6472014-02-11 23:30:06 -08002 * Copyright (c) 2012-2013 Qualcomm Atheros, Inc.
3 * All Rights Reserved.
4 * Qualcomm Atheros Confidential and Proprietary.
5 */
Jeff Johnson295189b2012-06-20 16:38:30 -07006#if !defined( __WLAN_QCT_OS_TRACE_H )
7#define __WLAN_QCT_OS_TRACE_H
8
Madan Mohan Koyyalamudi6ed07b72013-08-20 19:15:47 +05309#include <vos_trace.h>
Jeff Johnson295189b2012-06-20 16:38:30 -070010
Jeff Johnson48a8f3e2013-11-11 12:10:25 -080011#if !defined(__printf)
12#define __printf(a,b)
13#endif
14
Jeff Johnson295189b2012-06-20 16:38:30 -070015#ifdef WLAN_DEBUG
16
17/**----------------------------------------------------------------------------
18
19 \brief WPAL_TRACE() / wpalTrace() - Trace / logging API
20
21 Users wishing to add tracing information to their code should use
22 WPAL_TRACE. WPAL_TRACE() will compile into a call to wpalTrace() when
23 tracing is enabled.
24
25 \param module - module identifier. A member of the wpt_moduleid
26 enumeration that identifies the module issuing the trace message.
27
28 \param level - trace level. A member of the wpt_tracelevel
29 enumeration indicating the severity of the condition causing the
30 trace message to be issued. More severe conditions are more
31 likely to be logged.
32
33 \param strFormat - format string. The message to be logged. This format
34 string contains printf-like replacement parameters, which follow
35 this parameter in the variable argument list.
36
37 \return nothing
38
39 --------------------------------------------------------------------------*/
Jeff Johnson48a8f3e2013-11-11 12:10:25 -080040void __printf(3,4) wpalTrace( wpt_moduleid module, wpt_tracelevel level,
41 char *strFormat, ... );
Jeff Johnson295189b2012-06-20 16:38:30 -070042
43/**----------------------------------------------------------------------------
44
45 \brief WPAL_DUMP() / wpalDump() - Trace / logging API
46
47 Users wishing to add tracing memory dumps to their code should use
48 WPAL_DUMP. WPAL_DUMP() will compile into a call to wpalDump() when
49 tracing is enabled.
50
51 \param module - module identifier. A member of the wpt_moduleid
52 enumeration that identifies the module performing the dump
53
54 \param level - trace level. A member of the wpt_tracelevel
55 enumeration indicating the severity of the condition causing the
56 memory to be dumped. More severe conditions are more
57 likely to be logged.
58
59 \param pMemory - memory. A pointer to the memory to be dumped
60
61 \param length - length. How many bytes of memory to be dumped
62
63 \return nothing
64
65 --------------------------------------------------------------------------*/
66void wpalDump( wpt_moduleid module, wpt_tracelevel level,
67 wpt_uint8 *memory, wpt_uint32 length);
68
Madan Mohan Koyyalamudia53c4dc2012-11-13 10:35:42 -080069#define WPAL_ASSERT( _condition ) do { \
70 if ( ! ( _condition ) ) \
71 { \
72 printk(KERN_CRIT "VOS ASSERT in %s Line %d\n", __func__, __LINE__); \
73 WARN_ON(1); \
74 } \
75 } while (0)
Jeff Johnson295189b2012-06-20 16:38:30 -070076#else //WLAN_DEBUG
77
Gopichand Nakkala9846ac42013-06-20 19:03:52 +053078static inline void wpalTrace( wpt_moduleid module, wpt_tracelevel level,
79 char *strFormat, ... ){};
80static inline void wpalDump( wpt_moduleid module, wpt_tracelevel level,
81 wpt_uint8 *memory, wpt_uint32 length) {};
82static inline void wpalTraceSetLevel( wpt_moduleid module,
83 wpt_tracelevel level, wpt_boolean on ) {};
84static inline void wpalTraceDisplay(void) {};
85#define WPAL_ASSERT(x) do {} while (0);
Jeff Johnson295189b2012-06-20 16:38:30 -070086
87#endif //WLAN_DEBUG
88
Gopichand Nakkala9846ac42013-06-20 19:03:52 +053089#define WPAL_TRACE wpalTrace
90#define WPAL_DUMP wpalDump
91
Jeff Johnson295189b2012-06-20 16:38:30 -070092#endif // __WLAN_QCT_OS_TRACE_H