blob: 67f855a2f38565feddf91626a281b921db8c53ac [file] [log] [blame]
Jeff Johnson295189b2012-06-20 16:38:30 -07001/*
Jeff Johnson32d95a32012-09-10 13:15:23 -07002 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Jeff Johnson295189b2012-06-20 16:38:30 -07003 *
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#if !defined( __WLAN_QCT_OS_TRACE_H )
23#define __WLAN_QCT_OS_TRACE_H
24
25
26#ifdef WLAN_DEBUG
27
28/**----------------------------------------------------------------------------
29
30 \brief WPAL_TRACE() / wpalTrace() - Trace / logging API
31
32 Users wishing to add tracing information to their code should use
33 WPAL_TRACE. WPAL_TRACE() will compile into a call to wpalTrace() when
34 tracing is enabled.
35
36 \param module - module identifier. A member of the wpt_moduleid
37 enumeration that identifies the module issuing the trace message.
38
39 \param level - trace level. A member of the wpt_tracelevel
40 enumeration indicating the severity of the condition causing the
41 trace message to be issued. More severe conditions are more
42 likely to be logged.
43
44 \param strFormat - format string. The message to be logged. This format
45 string contains printf-like replacement parameters, which follow
46 this parameter in the variable argument list.
47
48 \return nothing
49
50 --------------------------------------------------------------------------*/
51void wpalTrace( wpt_moduleid module, wpt_tracelevel level, char *strFormat, ... );
52
53/**----------------------------------------------------------------------------
54
55 \brief WPAL_DUMP() / wpalDump() - Trace / logging API
56
57 Users wishing to add tracing memory dumps to their code should use
58 WPAL_DUMP. WPAL_DUMP() will compile into a call to wpalDump() when
59 tracing is enabled.
60
61 \param module - module identifier. A member of the wpt_moduleid
62 enumeration that identifies the module performing the dump
63
64 \param level - trace level. A member of the wpt_tracelevel
65 enumeration indicating the severity of the condition causing the
66 memory to be dumped. More severe conditions are more
67 likely to be logged.
68
69 \param pMemory - memory. A pointer to the memory to be dumped
70
71 \param length - length. How many bytes of memory to be dumped
72
73 \return nothing
74
75 --------------------------------------------------------------------------*/
76void wpalDump( wpt_moduleid module, wpt_tracelevel level,
77 wpt_uint8 *memory, wpt_uint32 length);
78
79#define WPAL_TRACE wpalTrace
80#define WPAL_DUMP wpalDump
81
82#define WPAL_ASSERT( _condition ) \
83if ( ! ( _condition ) ) \
84{ \
85 printk(KERN_CRIT "VOS ASSERT in %s Line %d\n", __FUNCTION__, __LINE__); \
86 WARN_ON(1); \
87}
88
89#else //WLAN_DEBUG
90
91#define WPAL_TRACE
92#define WPAL_DUMP
93#define WPAL_ASSERT
94
95#endif //WLAN_DEBUG
96
97#endif // __WLAN_QCT_OS_TRACE_H