Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | 988a552 | 2014-02-19 01:15:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2012-2013 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. |
Kiet Lam | 26cd647 | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 20 | */ |
Kiet Lam | 988a552 | 2014-02-19 01:15:45 -0800 | [diff] [blame] | 21 | |
| 22 | /* |
| 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
| 26 | */ |
| 27 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 28 | #if !defined( __WLAN_QCT_OS_TRACE_H ) |
| 29 | #define __WLAN_QCT_OS_TRACE_H |
| 30 | |
Madan Mohan Koyyalamudi | 6ed07b7 | 2013-08-20 19:15:47 +0530 | [diff] [blame] | 31 | #include <vos_trace.h> |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 32 | |
Jeff Johnson | 48a8f3e | 2013-11-11 12:10:25 -0800 | [diff] [blame] | 33 | #if !defined(__printf) |
| 34 | #define __printf(a,b) |
| 35 | #endif |
| 36 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 37 | #ifdef WLAN_DEBUG |
| 38 | |
| 39 | /**---------------------------------------------------------------------------- |
| 40 | |
| 41 | \brief WPAL_TRACE() / wpalTrace() - Trace / logging API |
| 42 | |
| 43 | Users wishing to add tracing information to their code should use |
| 44 | WPAL_TRACE. WPAL_TRACE() will compile into a call to wpalTrace() when |
| 45 | tracing is enabled. |
| 46 | |
| 47 | \param module - module identifier. A member of the wpt_moduleid |
| 48 | enumeration that identifies the module issuing the trace message. |
| 49 | |
| 50 | \param level - trace level. A member of the wpt_tracelevel |
| 51 | enumeration indicating the severity of the condition causing the |
| 52 | trace message to be issued. More severe conditions are more |
| 53 | likely to be logged. |
| 54 | |
| 55 | \param strFormat - format string. The message to be logged. This format |
| 56 | string contains printf-like replacement parameters, which follow |
| 57 | this parameter in the variable argument list. |
| 58 | |
| 59 | \return nothing |
| 60 | |
| 61 | --------------------------------------------------------------------------*/ |
Jeff Johnson | 48a8f3e | 2013-11-11 12:10:25 -0800 | [diff] [blame] | 62 | void __printf(3,4) wpalTrace( wpt_moduleid module, wpt_tracelevel level, |
| 63 | char *strFormat, ... ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 64 | |
| 65 | /**---------------------------------------------------------------------------- |
| 66 | |
| 67 | \brief WPAL_DUMP() / wpalDump() - Trace / logging API |
| 68 | |
| 69 | Users wishing to add tracing memory dumps to their code should use |
| 70 | WPAL_DUMP. WPAL_DUMP() will compile into a call to wpalDump() when |
| 71 | tracing is enabled. |
| 72 | |
| 73 | \param module - module identifier. A member of the wpt_moduleid |
| 74 | enumeration that identifies the module performing the dump |
| 75 | |
| 76 | \param level - trace level. A member of the wpt_tracelevel |
| 77 | enumeration indicating the severity of the condition causing the |
| 78 | memory to be dumped. More severe conditions are more |
| 79 | likely to be logged. |
| 80 | |
| 81 | \param pMemory - memory. A pointer to the memory to be dumped |
| 82 | |
| 83 | \param length - length. How many bytes of memory to be dumped |
| 84 | |
| 85 | \return nothing |
| 86 | |
| 87 | --------------------------------------------------------------------------*/ |
| 88 | void wpalDump( wpt_moduleid module, wpt_tracelevel level, |
| 89 | wpt_uint8 *memory, wpt_uint32 length); |
| 90 | |
Madan Mohan Koyyalamudi | a53c4dc | 2012-11-13 10:35:42 -0800 | [diff] [blame] | 91 | #define WPAL_ASSERT( _condition ) do { \ |
| 92 | if ( ! ( _condition ) ) \ |
| 93 | { \ |
| 94 | printk(KERN_CRIT "VOS ASSERT in %s Line %d\n", __func__, __LINE__); \ |
| 95 | WARN_ON(1); \ |
| 96 | } \ |
| 97 | } while (0) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 98 | #else //WLAN_DEBUG |
| 99 | |
Gopichand Nakkala | 9846ac4 | 2013-06-20 19:03:52 +0530 | [diff] [blame] | 100 | static inline void wpalTrace( wpt_moduleid module, wpt_tracelevel level, |
| 101 | char *strFormat, ... ){}; |
| 102 | static inline void wpalDump( wpt_moduleid module, wpt_tracelevel level, |
| 103 | wpt_uint8 *memory, wpt_uint32 length) {}; |
| 104 | static inline void wpalTraceSetLevel( wpt_moduleid module, |
| 105 | wpt_tracelevel level, wpt_boolean on ) {}; |
| 106 | static inline void wpalTraceDisplay(void) {}; |
| 107 | #define WPAL_ASSERT(x) do {} while (0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 108 | |
| 109 | #endif //WLAN_DEBUG |
| 110 | |
Gopichand Nakkala | 9846ac4 | 2013-06-20 19:03:52 +0530 | [diff] [blame] | 111 | #define WPAL_TRACE wpalTrace |
| 112 | #define WPAL_DUMP wpalDump |
| 113 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 114 | #endif // __WLAN_QCT_OS_TRACE_H |