Bryan O'Sullivan | d41d3ae | 2006-03-29 15:23:25 -0800 | [diff] [blame] | 1 | /* |
John Gregor | 87427da | 2007-06-11 10:21:14 -0700 | [diff] [blame] | 2 | * Copyright (c) 2006, 2007 QLogic Corporation. All rights reserved. |
Bryan O'Sullivan | d41d3ae | 2006-03-29 15:23:25 -0800 | [diff] [blame] | 3 | * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. |
| 4 | * |
| 5 | * This software is available to you under a choice of one of two |
| 6 | * licenses. You may choose to be licensed under the terms of the GNU |
| 7 | * General Public License (GPL) Version 2, available from the file |
| 8 | * COPYING in the main directory of this source tree, or the |
| 9 | * OpenIB.org BSD license below: |
| 10 | * |
| 11 | * Redistribution and use in source and binary forms, with or |
| 12 | * without modification, are permitted provided that the following |
| 13 | * conditions are met: |
| 14 | * |
| 15 | * - Redistributions of source code must retain the above |
| 16 | * copyright notice, this list of conditions and the following |
| 17 | * disclaimer. |
| 18 | * |
| 19 | * - Redistributions in binary form must reproduce the above |
| 20 | * copyright notice, this list of conditions and the following |
| 21 | * disclaimer in the documentation and/or other materials |
| 22 | * provided with the distribution. |
| 23 | * |
| 24 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 25 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 26 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 27 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 28 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 29 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 30 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 31 | * SOFTWARE. |
| 32 | */ |
| 33 | |
| 34 | #ifndef _IPATH_DEBUG_H |
| 35 | #define _IPATH_DEBUG_H |
| 36 | |
| 37 | #ifndef _IPATH_DEBUGGING /* debugging enabled or not */ |
| 38 | #define _IPATH_DEBUGGING 1 |
| 39 | #endif |
| 40 | |
| 41 | #if _IPATH_DEBUGGING |
| 42 | |
| 43 | /* |
| 44 | * Mask values for debugging. The scheme allows us to compile out any |
| 45 | * of the debug tracing stuff, and if compiled in, to enable or disable |
| 46 | * dynamically. This can be set at modprobe time also: |
| 47 | * modprobe infinipath.ko infinipath_debug=7 |
| 48 | */ |
| 49 | |
| 50 | #define __IPATH_INFO 0x1 /* generic low verbosity stuff */ |
| 51 | #define __IPATH_DBG 0x2 /* generic debug */ |
| 52 | #define __IPATH_TRSAMPLE 0x8 /* generate trace buffer sample entries */ |
| 53 | /* leave some low verbosity spots open */ |
| 54 | #define __IPATH_VERBDBG 0x40 /* very verbose debug */ |
| 55 | #define __IPATH_PKTDBG 0x80 /* print packet data */ |
| 56 | /* print process startup (init)/exit messages */ |
| 57 | #define __IPATH_PROCDBG 0x100 |
| 58 | /* print mmap/nopage stuff, not using VDBG any more */ |
| 59 | #define __IPATH_MMDBG 0x200 |
Bryan O'Sullivan | 8ec1077 | 2007-03-15 14:44:55 -0700 | [diff] [blame] | 60 | #define __IPATH_ERRPKTDBG 0x400 |
Bryan O'Sullivan | d41d3ae | 2006-03-29 15:23:25 -0800 | [diff] [blame] | 61 | #define __IPATH_USER_SEND 0x1000 /* use user mode send */ |
| 62 | #define __IPATH_KERNEL_SEND 0x2000 /* use kernel mode send */ |
| 63 | #define __IPATH_EPKTDBG 0x4000 /* print ethernet packet data */ |
Bryan O'Sullivan | f6f0413 | 2006-04-24 14:23:09 -0700 | [diff] [blame] | 64 | #define __IPATH_IPATHDBG 0x10000 /* Ethernet (IPATH) gen debug */ |
| 65 | #define __IPATH_IPATHWARN 0x20000 /* Ethernet (IPATH) warnings */ |
| 66 | #define __IPATH_IPATHERR 0x40000 /* Ethernet (IPATH) errors */ |
| 67 | #define __IPATH_IPATHPD 0x80000 /* Ethernet (IPATH) packet dump */ |
| 68 | #define __IPATH_IPATHTABLE 0x100000 /* Ethernet (IPATH) table dump */ |
Bryan O'Sullivan | d41d3ae | 2006-03-29 15:23:25 -0800 | [diff] [blame] | 69 | |
| 70 | #else /* _IPATH_DEBUGGING */ |
| 71 | |
| 72 | /* |
| 73 | * define all of these even with debugging off, for the few places that do |
| 74 | * if(infinipath_debug & _IPATH_xyzzy), but in a way that will make the |
| 75 | * compiler eliminate the code |
| 76 | */ |
| 77 | |
| 78 | #define __IPATH_INFO 0x0 /* generic low verbosity stuff */ |
| 79 | #define __IPATH_DBG 0x0 /* generic debug */ |
| 80 | #define __IPATH_TRSAMPLE 0x0 /* generate trace buffer sample entries */ |
| 81 | #define __IPATH_VERBDBG 0x0 /* very verbose debug */ |
| 82 | #define __IPATH_PKTDBG 0x0 /* print packet data */ |
Bryan O'Sullivan | f6f0413 | 2006-04-24 14:23:09 -0700 | [diff] [blame] | 83 | #define __IPATH_PROCDBG 0x0 /* process startup (init)/exit messages */ |
Bryan O'Sullivan | d41d3ae | 2006-03-29 15:23:25 -0800 | [diff] [blame] | 84 | /* print mmap/nopage stuff, not using VDBG any more */ |
| 85 | #define __IPATH_MMDBG 0x0 |
| 86 | #define __IPATH_EPKTDBG 0x0 /* print ethernet packet data */ |
Bryan O'Sullivan | f6f0413 | 2006-04-24 14:23:09 -0700 | [diff] [blame] | 87 | #define __IPATH_IPATHDBG 0x0 /* Ethernet (IPATH) table dump on */ |
Bryan O'Sullivan | d41d3ae | 2006-03-29 15:23:25 -0800 | [diff] [blame] | 88 | #define __IPATH_IPATHWARN 0x0 /* Ethernet (IPATH) warnings on */ |
| 89 | #define __IPATH_IPATHERR 0x0 /* Ethernet (IPATH) errors on */ |
| 90 | #define __IPATH_IPATHPD 0x0 /* Ethernet (IPATH) packet dump on */ |
| 91 | #define __IPATH_IPATHTABLE 0x0 /* Ethernet (IPATH) packet dump on */ |
| 92 | |
| 93 | #endif /* _IPATH_DEBUGGING */ |
| 94 | |
| 95 | #define __IPATH_VERBOSEDBG __IPATH_VERBDBG |
| 96 | |
| 97 | #endif /* _IPATH_DEBUG_H */ |