wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 1 | |
| 2 | /******************************************************************************/ |
| 3 | /* */ |
| 4 | /* Broadcom BCM5700 Linux Network Driver, Copyright (c) 2000 Broadcom */ |
| 5 | /* Corporation. */ |
| 6 | /* All rights reserved. */ |
| 7 | /* */ |
| 8 | /* This program is free software; you can redistribute it and/or modify */ |
| 9 | /* it under the terms of the GNU General Public License as published by */ |
| 10 | /* the Free Software Foundation, located in the file LICENSE. */ |
| 11 | /* */ |
| 12 | /* History: */ |
| 13 | /* 02/25/00 Hav Khauv Initial version. */ |
| 14 | /******************************************************************************/ |
| 15 | |
| 16 | #ifndef DEBUG_H |
| 17 | #define DEBUG_H |
| 18 | |
| 19 | #ifdef VXWORKS |
| 20 | #include <vxWorks.h> |
| 21 | #endif |
| 22 | |
| 23 | /******************************************************************************/ |
| 24 | /* Debug macros */ |
| 25 | /******************************************************************************/ |
| 26 | |
| 27 | /* Code path for controlling output debug messages. */ |
| 28 | /* Define your code path here. */ |
| 29 | #define CP_INIT 0x010000 |
| 30 | #define CP_SEND 0x020000 |
| 31 | #define CP_RCV 0x040000 |
| 32 | #define CP_INT 0x080000 |
| 33 | #define CP_UINIT 0x100000 |
| 34 | #define CP_RESET 0x200000 |
| 35 | |
| 36 | #define CP_ALL (CP_INIT | CP_SEND | CP_RCV | CP_INT | \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 37 | CP_RESET | CP_UINIT) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 38 | |
| 39 | #define CP_MASK 0xffff0000 |
| 40 | |
| 41 | |
| 42 | /* Debug message levels. */ |
| 43 | #define LV_VERBOSE 0x03 |
| 44 | #define LV_INFORM 0x02 |
| 45 | #define LV_WARN 0x01 |
| 46 | #define LV_FATAL 0x00 |
| 47 | |
| 48 | #define LV_MASK 0xffff |
| 49 | |
| 50 | |
| 51 | /* Code path and messsage level combined. These are the first argument of */ |
| 52 | /* the DbgMessage macro. */ |
| 53 | #define INIT_V (CP_INIT | LV_VERBOSE) |
| 54 | #define INIT_I (CP_INIT | LV_INFORM) |
| 55 | #define INIT_W (CP_INIT | LV_WARN) |
| 56 | #define SEND_V (CP_SEND | LV_VERBOSE) |
| 57 | #define SEND_I (CP_SEND | LV_INFORM) |
| 58 | #define SEND_W (CP_SEND | LV_WARN) |
| 59 | #define RCV_V (CP_RCV | LV_VERBOSE) |
| 60 | #define RCV_I (CP_RCV | LV_INFORM) |
| 61 | #define RCV_W (CP_RCV | LV_WARN) |
| 62 | #define INT_V (CP_INT | LV_VERBOSE) |
| 63 | #define INT_I (CP_INT | LV_INFORM) |
| 64 | #define INT_W (CP_INT | LV_WARN) |
| 65 | #define UINIT_V (CP_UINIT | LV_VERBOSE) |
| 66 | #define UINIT_I (CP_UINIT | LV_INFORM) |
| 67 | #define UINIT_W (CP_UINIT | LV_WARN) |
| 68 | #define RESET_V (CP_RESET | LV_VERBOSE) |
| 69 | #define RESET_I (CP_RESET | LV_INFORM) |
| 70 | #define RESET_W (CP_RESET | LV_WARN) |
| 71 | #define CPALL_V (CP_ALL | LV_VERBOSE) |
| 72 | #define CPALL_I (CP_ALL | LV_INFORM) |
| 73 | #define CPALL_W (CP_ALL | LV_WARN) |
| 74 | |
| 75 | |
| 76 | /* All code path message levels. */ |
| 77 | #define FATAL (CP_ALL | LV_FATAL) |
| 78 | #define WARN (CP_ALL | LV_WARN) |
| 79 | #define INFORM (CP_ALL | LV_INFORM) |
| 80 | #define VERBOSE (CP_ALL | LV_VERBOSE) |
| 81 | |
| 82 | |
| 83 | /* These constants control the message output. */ |
| 84 | /* Set your debug message output level and code path here. */ |
| 85 | #ifndef DBG_MSG_CP |
| 86 | #define DBG_MSG_CP CP_ALL /* Where to output messages. */ |
| 87 | #endif |
| 88 | |
| 89 | #ifndef DBG_MSG_LV |
| 90 | #define DBG_MSG_LV LV_VERBOSE /* Level of message output. */ |
| 91 | #endif |
| 92 | |
| 93 | /* DbgMessage macro. */ |
| 94 | #if DBG |
| 95 | #define DbgMessage(CNTRL, MESSAGE) \ |
| 96 | if((CNTRL & DBG_MSG_CP) && ((CNTRL & LV_MASK) <= DBG_MSG_LV)) \ |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 97 | printf MESSAGE |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 98 | #define DbgBreak() DbgBreakPoint() |
| 99 | #undef STATIC |
| 100 | #define STATIC |
| 101 | #else |
| 102 | #define DbgMessage(CNTRL, MESSAGE) |
| 103 | #define DbgBreak() |
| 104 | #undef STATIC |
| 105 | #define STATIC static |
| 106 | #endif /* DBG */ |
| 107 | |
| 108 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 109 | #endif /* DEBUG_H */ |