2 * Copyright (c) 2005 SilverStorm Technologies. All rights reserved.
\r
4 * This software is available to you under the OpenIB.org BSD license
\r
7 * Redistribution and use in source and binary forms, with or
\r
8 * without modification, are permitted provided that the following
\r
9 * conditions are met:
\r
11 * - Redistributions of source code must retain the above
\r
12 * copyright notice, this list of conditions and the following
\r
15 * - Redistributions in binary form must reproduce the above
\r
16 * copyright notice, this list of conditions and the following
\r
17 * disclaimer in the documentation and/or other materials
\r
18 * provided with the distribution.
\r
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
23 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
24 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
25 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
26 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
33 #ifndef _VNIC_DEBUG_H_
\r
34 #define _VNIC_DEBUG_H_
\r
37 #include <complib/cl_debug.h>
\r
42 extern uint32_t g_vnic_dbg_lvl;
\r
45 #define VNIC_DBG_INIT (0x00000001)
\r
46 #define VNIC_DBG_PNP (0x00000002)
\r
47 #define VNIC_DBG_SEND (0x00000004)
\r
48 #define VNIC_DBG_RECV (0x00000008)
\r
49 #define VNIC_DBG_STATUS (0x00000010)
\r
50 #define VNIC_DBG_IB (0x00000020)
\r
51 #define VNIC_DBG_BUF (0x00000040)
\r
52 #define VNIC_DBG_MCAST (0x00000080)
\r
53 #define VNIC_DBG_ALLOC (0x00000100)
\r
54 #define VNIC_DBG_OID (0x00000200)
\r
55 #define VNIC_DBG_DATA (0x00000400)
\r
56 #define VNIC_DBG_CTRL (0x00000800)
\r
57 #define VNIC_DBG_CTRL_PKT (0x00001000)
\r
58 #define VNIC_DBG_CONF (0x00002000)
\r
59 #define VNIC_DBG_VIPORT (0x00004000)
\r
60 #define VNIC_DBG_ADAPTER (0x00008000)
\r
61 #define VNIC_DBG_NETPATH (0x00010000)
\r
63 #define VNIC_DBG_FUNC (0x10000000) /* For function entry/exit */
\r
64 #define VNIC_DBG_INFO (0x20000000) /* For verbose information */
\r
65 #define VNIC_DBG_WARN (0x40000000) /* For warnings. */
\r
66 #define VNIC_DBG_ERROR CL_DBG_ERROR
\r
67 #define VNIC_DBG_ALL CL_DBG_ALL
\r
69 #define VNIC_DEBUG_FLAGS ( VNIC_DBG_ERROR /*| VNIC_DBG_WARN | VNIC_DBG_INFO | VNIC_DBG_FUNC | VNIC_DBG_OID | VNIC_DBG_VIPORT | VNIC_DBG_CTRL | VNIC_DBG_DATA */)
\r
71 /* Enter and exit macros automatically add VNIC_DBG_FUNC bit */
\r
72 #define VNIC_ENTER( lvl ) \
\r
73 CL_ENTER( (lvl | VNIC_DBG_FUNC), g_vnic_dbg_lvl )
\r
75 #define VNIC_EXIT( lvl ) \
\r
76 CL_EXIT( (lvl | VNIC_DBG_FUNC), g_vnic_dbg_lvl )
\r
78 #define VNIC_TRACE( lvl, msg ) \
\r
79 CL_TRACE( (lvl), g_vnic_dbg_lvl, msg )
\r
81 #define VNIC_TRACE_EXIT( lvl, msg ) \
\r
82 CL_TRACE_EXIT( (lvl), g_vnic_dbg_lvl, msg )
\r
84 #define VNIC_PRINT( lvl, msg ) \
\r
85 CL_PRINT ( (lvl), g_vnic_dbg_lvl, msg )
\r
87 #define VNIC_TRACE_BYTES( lvl, ptr, len ) \
\r
90 for (_loop_ = 0; _loop_ < (len); ++_loop_) \
\r
92 CL_PRINT( (lvl), g_vnic_dbg_lvl, ("0x%.2X ", ((uint8_t*)(ptr))[_loop_])); \
\r
93 if ((_loop_ + 1)% 16 == 0) \
\r
95 CL_PRINT( (lvl), g_vnic_dbg_lvl, ("\n") ); \
\r
97 else if ((_loop_ % 4 + 1) == 0) \
\r
99 CL_PRINT( (lvl), g_vnic_dbg_lvl, (" ") ); \
\r
102 CL_PRINT( (lvl), g_vnic_dbg_lvl, ("\n") ); \
\r
106 #endif /* _VNIC_DEBUG_H_ */
\r