[IPoIB] Add WPP tracing, enabled by default in release builds.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 8 May 2006 23:47:04 +0000 (23:47 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 8 May 2006 23:47:04 +0000 (23:47 +0000)
Signed-off-by: Yossi Leybovich (sleybo@mellanox.co.il)
Signed-off-by: Fab Tillier (ftillier@silverstorm.com)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@335 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/ipoib/kernel/SOURCES
ulp/ipoib/kernel/ipoib_adapter.c
ulp/ipoib/kernel/ipoib_debug.h
ulp/ipoib/kernel/ipoib_driver.c
ulp/ipoib/kernel/ipoib_driver.h
ulp/ipoib/kernel/ipoib_endpoint.c
ulp/ipoib/kernel/ipoib_endpoint.h
ulp/ipoib/kernel/ipoib_ibat.c
ulp/ipoib/kernel/ipoib_port.c
ulp/ipoib/kernel/netipoib.inf

index 75f58a5..d98b10f 100644 (file)
@@ -2,6 +2,14 @@ TARGETNAME=ipoib
 TARGETPATH=..\..\..\bin\kernel\obj$(BUILD_ALT_DIR)\r
 TARGETTYPE=DRIVER\r
 \r
+\r
+!if $(FREEBUILD)\r
+ENABLE_EVENT_TRACING=1\r
+!else\r
+#ENABLE_EVENT_TRACING=1\r
+!endif\r
+\r
+\r
 SOURCES=       ipoib_log.mc \\r
                ipoib.rc \\r
                ipoib_driver.c \\r
@@ -27,4 +35,14 @@ TARGETLIBS= \
 TARGETLIBS= $(TARGETLIBS) $(DDK_LIB_PATH)\ntstrsafe.lib\r
 !endif\r
 \r
+!IFDEF ENABLE_EVENT_TRACING\r
+\r
+C_DEFINES = $(C_DEFINES) -DEVENT_TRACING\r
+\r
+RUN_WPP = $(SOURCES) -km -ext: .c .h .C .H \\r
+       -scan:ipoib_debug.h \\r
+       -func:IPOIB_PRINT(LEVEL,FLAGS,(MSG,...)) \\r
+       -func:IPOIB_PRINT_EXIT(LEVEL,FLAGS,(MSG,...))\r
+!ENDIF\r
+\r
 MSC_WARNING_LEVEL= /W4\r
index af976df..03c790c 100644 (file)
 #include "ipoib_driver.h"\r
 #include "ipoib_debug.h"\r
 \r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "ipoib_adapter.tmh"\r
+#endif\r
+\r
 \r
 #define ITEM_POOL_START                16\r
 #define ITEM_POOL_GROW         16\r
@@ -131,7 +138,7 @@ ipoib_create_adapter(
        p_adapter = cl_zalloc( sizeof(ipoib_adapter_t) );\r
        if( !p_adapter )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, \r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate ipoib_adapter_t (%d bytes)",\r
                        sizeof(ipoib_adapter_t)) );\r
                return IB_INSUFFICIENT_MEMORY;\r
@@ -145,8 +152,8 @@ ipoib_create_adapter(
        if( !p_adapter->p_ifc )\r
        {\r
                __adapter_free( &p_adapter->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
-                       ("ipoib_create_adapter failed to alloc ipoib_ifc_t % bytes\n",\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("ipoib_create_adapter failed to alloc ipoib_ifc_t %d bytes\n",\r
                        sizeof(ib_al_ifc_t)) );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -156,12 +163,12 @@ ipoib_create_adapter(
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                __adapter_free( &p_adapter->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_get_adapter_guids returned 0x%.8X.\n", status) );\r
                return status;\r
        }\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Port %016I64x (CA %016I64x port %d) initializing\n",\r
                        p_adapter->guids.port_guid, p_adapter->guids.ca_guid,\r
                        p_adapter->guids.port_num) );\r
@@ -172,7 +179,7 @@ ipoib_create_adapter(
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                __adapter_free( &p_adapter->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_get_adapter_params returned 0x%.8x.\n", status) );\r
                return status;\r
        }\r
@@ -182,7 +189,7 @@ ipoib_create_adapter(
        if( cl_status != CL_SUCCESS )\r
        {\r
                __adapter_free( &p_adapter->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_obj_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -191,7 +198,7 @@ ipoib_create_adapter(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_destroy( &p_adapter->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("adapter_init returned %s.\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -287,7 +294,7 @@ adapter_init(
        cl_status = cl_perf_init( &p_adapter->perf, MaxPerf );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_perf_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -295,7 +302,7 @@ adapter_init(
        cl_status = cl_spinlock_init( &p_adapter->send_stat_lock );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -303,7 +310,7 @@ adapter_init(
        cl_status = cl_spinlock_init( &p_adapter->recv_stat_lock );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -312,7 +319,7 @@ adapter_init(
                ITEM_POOL_GROW, sizeof(cl_pool_obj_t), NULL, NULL, NULL );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_qpool_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -323,7 +330,7 @@ adapter_init(
                0, sizeof(net_address_item_t), NULL, NULL, p_adapter );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_vector_init for ip_vector returned %s\n",\r
                        CL_STATUS_MSG(cl_status)) );\r
                return IB_ERROR;\r
@@ -334,7 +341,7 @@ adapter_init(
                ipoib_mac_from_guid( p_adapter->guids.port_guid, &p_adapter->mac );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_mac_from_guid returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -344,7 +351,7 @@ adapter_init(
        status = p_adapter->p_ifc->open_al( &p_adapter->h_al );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_open_al returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -383,7 +390,7 @@ __ipoib_pnp_reg(
        if( status != IB_SUCCESS )\r
        {\r
                p_adapter->registering = FALSE;\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_reg_pnp returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -500,12 +507,12 @@ __ipoib_pnp_cb(
        if( old_state == IB_PNP_PORT_REMOVE )\r
        {\r
                KeReleaseMutex( &p_adapter->mutex, FALSE );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_PNP,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_PNP,\r
                        ("Aborting - Adapter destroying.\n") );\r
                return IB_NOT_DONE;\r
        }\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_PNP,\r
                ("p_pnp_rec->pnp_event = 0x%x\n",p_pnp_rec->pnp_event));\r
 \r
        p_port_rec = (ib_pnp_port_rec_t*)p_pnp_rec;\r
@@ -599,7 +606,8 @@ __ipoib_pnp_cb(
                                NDIS_STATUS_MEDIA_DISCONNECT, NULL, 0 );\r
                        NdisMIndicateStatusComplete( p_adapter->h_adapter );\r
 \r
-                       IPOIB_TRACE( IPOIB_DBG_INFO, ("Link DOWN!\n") );\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                               ("Link DOWN!\n") );\r
 \r
                        ipoib_port_down( p_adapter->p_port );\r
                }\r
@@ -633,7 +641,7 @@ __ipoib_pnp_cb(
                break;\r
 \r
        default:\r
-               IPOIB_TRACE( IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("IPOIB: Received unhandled PnP event 0x%x\n",\r
                        p_pnp_rec->pnp_event) );\r
                /* Fall through. */\r
@@ -671,7 +679,8 @@ __ipoib_pnp_cb(
                                NDIS_STATUS_MEDIA_DISCONNECT, NULL, 0 );\r
                        NdisMIndicateStatusComplete( p_adapter->h_adapter );\r
 \r
-                       IPOIB_TRACE( IPOIB_DBG_INFO, ("Link DOWN!\n") );\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                               ("Link DOWN!\n") );\r
 \r
                        ipoib_port_down( p_adapter->p_port );\r
                        /* Fall through. */\r
@@ -836,7 +845,7 @@ __ipoib_pnp_dereg(
                if( status != IB_SUCCESS )\r
                {\r
                        p_adapter->reset = FALSE;\r
-                       IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("__ipoib_pnp_reg returned %s\n",\r
                                p_adapter->p_ifc->get_err_str( status )) );\r
                        NdisMResetComplete( \r
@@ -873,25 +882,25 @@ ipoib_set_rate(
        switch( link_speed )\r
        {\r
        case IB_LINK_SPEED_ACTIVE_2_5:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link speed is 2.5Gs\n") );\r
                p_adapter->rate = IB_LINK_SPEED_ACTIVE_2_5;\r
                break;\r
 \r
        case IB_LINK_SPEED_ACTIVE_5:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link speed is 5G\n") );\r
                p_adapter->rate = IB_LINK_SPEED_ACTIVE_5;\r
                break;\r
 \r
        case IB_LINK_SPEED_ACTIVE_10:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link speed is 10G\n") );\r
                p_adapter->rate = IB_LINK_SPEED_ACTIVE_10;\r
                break;\r
 \r
        default:\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Invalid link speed %d.\n", link_speed) );\r
                p_adapter->rate = 0;\r
        }\r
@@ -899,25 +908,25 @@ ipoib_set_rate(
        switch( link_width )\r
        {\r
        case IB_LINK_WIDTH_ACTIVE_1X:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link width is 1X\n") );\r
                p_adapter->rate *= ONE_X_IN_100BPS;\r
                break;\r
 \r
        case IB_LINK_WIDTH_ACTIVE_4X:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link width is 4X\n") );\r
                p_adapter->rate *= FOUR_X_IN_100BPS;\r
                break;\r
 \r
        case IB_LINK_WIDTH_ACTIVE_12X:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Link width is 12X\n") );\r
                p_adapter->rate *= TWELVE_X_IN_100BPS;\r
                break;\r
 \r
        default:\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Invalid link rate (%d).\n", link_width) );\r
                p_adapter->rate = 0;\r
        }\r
@@ -975,7 +984,7 @@ ipoib_set_active(
                 * Now that we're in the broadcast group, notify that\r
                 * we have a link.\r
                 */\r
-               IPOIB_TRACE( IPOIB_DBG_INFO, ("Link UP!\n") );\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT, ("Link UP!\n") );\r
                NdisWriteErrorLogEntry( p_adapter->h_adapter,\r
                        EVENT_IPOIB_PORT_UP + (p_adapter->rate/ONE_X_IN_100BPS),\r
                        1, p_adapter->rate );\r
index d874e22..3826a97 100644 (file)
@@ -34,6 +34,8 @@
 #define _IPOIB_DEBUG_H_\r
 \r
 \r
+#define __MODULE__     "[IPoIB]"\r
+\r
 #include <complib/cl_debug.h>\r
 \r
 \r
 #define IPOIB_OBJ_ENDPOINT             3\r
 \r
 \r
+extern uint32_t                g_ipoib_dbg_level;\r
+extern uint32_t                g_ipoib_dbg_flags;\r
+\r
+\r
+#if defined(EVENT_TRACING)\r
+//\r
+// Software Tracing Definitions\r
+//\r
+#define WPP_CONTROL_GUIDS \\r
+       WPP_DEFINE_CONTROL_GUID( \\r
+               IPOIBCtlGuid,(3F9BC73D, EB03, 453a, B27B, 20F9A664211A), \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_ERROR) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_INIT) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_PNP) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_SEND) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_RECV) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_ENDPT) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_IB) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_BUF) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_MCAST) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_ALLOC) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_OID) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_IOCTL) \\r
+       WPP_DEFINE_BIT(IPOIB_DBG_STAT))\r
+\r
+\r
+\r
+#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) \\r
+       (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level  >= lvl)\r
+#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)\r
+#define WPP_FLAG_ENABLED(flags) \\r
+       (WPP_LEVEL_ENABLED(flags) && \\r
+       WPP_CONTROL(WPP_BIT_ ## flags).Level  >= TRACE_LEVEL_VERBOSE)\r
+#define WPP_FLAG_LOGGER(flags) WPP_LEVEL_LOGGER(flags)\r
+\r
+// begin_wpp config\r
+// IPOIB_ENTER(FLAG);\r
+// IPOIB_EXIT(FLAG);\r
+// USEPREFIX(IPOIB_PRINT, "%!STDPREFIX!%!FUNC!() :");\r
+// USEPREFIX(IPOIB_PRINT_EXIT, "%!STDPREFIX!%!FUNC!() :");\r
+// USESUFFIX(IPOIB_PRINT_EXIT, "\n %!FUNC!():<===");\r
+// USESUFFIX(IPOIB_ENTER, " %!FUNC!():===>");\r
+// USESUFFIX(IPOIB_EXIT, " %!FUNC!():<===");\r
+// end_wpp\r
+\r
+#else\r
+\r
+#include <evntrace.h>\r
+\r
+\r
 /*\r
  * Debug macros\r
  */\r
-extern uint32_t                g_ipoib_dbg_lvl;\r
-\r
-\r
 #define IPOIB_DBG_INIT (1 << 0)\r
 #define IPOIB_DBG_PNP  (1 << 1)\r
 #define IPOIB_DBG_SEND (1 << 2)\r
@@ -62,40 +111,72 @@ extern uint32_t            g_ipoib_dbg_lvl;
 #define IPOIB_DBG_IOCTL        (1 << 10)\r
 #define IPOIB_DBG_STAT (1 << 11)\r
 \r
-#define IPOIB_DBG_FUNC (1 << 28)       /* For function entry/exit */\r
-#define IPOIB_DBG_INFO (1 << 29)       /* For verbose information */\r
-#define IPOIB_DBG_WARN (1 << 30)       /* For warnings. */\r
 #define IPOIB_DBG_ERROR        CL_DBG_ERROR\r
 #define IPOIB_DBG_ALL  CL_DBG_ALL\r
 \r
-/* Enter and exit macros automatically add IPOIB_DBG_FUNC bit */\r
-#define IPOIB_ENTER( lvl )                             \\r
-       CL_ENTER( (lvl | IPOIB_DBG_FUNC), g_ipoib_dbg_lvl )\r
-#define IPOIB_EXIT( lvl )                              \\r
-       CL_EXIT( (lvl | IPOIB_DBG_FUNC), g_ipoib_dbg_lvl )\r
-#define IPOIB_TRACE( lvl, msg )                        \\r
-       CL_TRACE( (lvl), g_ipoib_dbg_lvl, msg )\r
-#define IPOIB_TRACE_EXIT( lvl, msg )   \\r
-       CL_TRACE_EXIT( (lvl), g_ipoib_dbg_lvl, msg )\r
+\r
+#if DBG\r
+\r
+// assignment of _level_ is need to to overcome warning C4127\r
+#define IPOIB_PRINT(_level_,_flag_,_msg_) \\r
+       { \\r
+               if( g_ipoib_dbg_level >= (_level_) ) \\r
+                       CL_TRACE( _flag_, g_ipoib_dbg_flags, _msg_ ); \\r
+       }\r
+\r
+#define IPOIB_PRINT_EXIT(_level_,_flag_,_msg_) \\r
+       { \\r
+               UNREFERENCED_PARAMETER( _level_ ); \\r
+               if( g_ipoib_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
+                       CL_TRACE_EXIT( _flag_, g_ipoib_dbg_flags, _msg_ ); \\r
+       }\r
+\r
+#define IPOIB_ENTER(_flag_) \\r
+       { \\r
+               if( g_ipoib_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
+                       CL_ENTER( _flag_, g_ipoib_dbg_flags ); \\r
+       }\r
+\r
+#define IPOIB_EXIT(_flag_)\\r
+       { \\r
+               if( g_ipoib_dbg_level >= TRACE_LEVEL_VERBOSE ) \\r
+                       CL_EXIT( _flag_, g_ipoib_dbg_flags ); \\r
+       }\r
 \r
 #define IPOIB_TRACE_BYTES( lvl, ptr, len )                                                                     \\r
        {                                                                                                                                               \\r
-               size_t _loop_;                                                                                                          \\r
-               for (_loop_ = 0; _loop_ < (len); ++_loop_)                                                      \\r
+               if( g_ipoib_dbg_level >= (_level_) &&                                                           \\r
+                       (g_ipoib_dbg_flags & (_flag_)) )                                                                \\r
                {                                                                                                                                       \\r
-                       CL_PRINT( (lvl), g_ipoib_dbg_lvl, ("0x%.2X ", ((uint8_t*)(ptr))[_loop_]));      \\r
-                       if ((_loop_  + 1)% 16 == 0)                                                                                     \\r
-                       {                                                                                                                               \\r
-                               CL_PRINT( (lvl), g_ipoib_dbg_lvl, ("\n") );                                     \\r
-                       }                                                                                                                               \\r
-                       else if ((_loop_ % 4 + 1) == 0)                                                                         \\r
+                       size_t _loop_;                                                                                                  \\r
+                       for( _loop_ = 0; _loop_ < (len); ++_loop_ )                                             \\r
                        {                                                                                                                               \\r
-                               CL_PRINT( (lvl), g_ipoib_dbg_lvl, ("  ") );                                     \\r
+                               DbgPrint( "0x%.2X ", ((uint8_t*)(ptr))[_loop_] );                       \\r
+                               if( (_loop_ + 1)% 16 == 0 )                                                                     \\r
+                                       DbgPrint("\n");                                                                                 \\r
+                               else if( (_loop_ % 4 + 1) == 0 )                                                        \\r
+                                       DbgPrint("  ");                                                                                 \\r
                        }                                                                                                                               \\r
+                       DbgPrint("\n");                                                                                                 \\r
                }                                                                                                                                       \\r
-               CL_PRINT( (lvl), g_ipoib_dbg_lvl, ("\n") );                                                     \\r
        }\r
 \r
+#else\r
+\r
+#define IPOIB_PRINT(lvl, flags, msg)\r
+\r
+#define IPOIB_PRINT_EXIT(_level_,_flag_,_msg_)\r
+\r
+#define IPOIB_ENTER(_flag_)\r
+\r
+#define IPOIB_EXIT(_flag_)\r
+\r
+#define IPOIB_TRACE_BYTES( lvl, ptr, len )\r
+\r
+#endif\r
+\r
+#endif //EVENT_TRACING\r
+\r
 \r
 enum ipoib_perf_counters\r
 {\r
index 044b6d1..80f777b 100644 (file)
 \r
 #include "ipoib_driver.h"\r
 #include "ipoib_debug.h"\r
+\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "ipoib_driver.tmh"\r
+#endif\r
+\r
 #include "ipoib_port.h"\r
 #include "ipoib_ibat.h"\r
 #include <complib/cl_bus_ifc.h>\r
@@ -118,7 +126,8 @@ static const unsigned char VENDOR_ID[] = {0x00, 0x06, 0x6A, 0x00};
 \r
 \r
 /* Global driver debug level */\r
-uint32_t               g_ipoib_dbg_lvl = IPOIB_DBG_ERROR;\r
+uint32_t               g_ipoib_dbg_level = TRACE_LEVEL_ERROR;\r
+uint32_t               g_ipoib_dbg_flags = 0x00000fff;\r
 ipoib_globals_t        g_ipoib = {0};\r
 \r
 \r
@@ -248,11 +257,13 @@ DriverEntry(
 #ifdef _DEBUG_\r
        PAGED_CODE();\r
 #endif\r
-\r
+#if defined(EVENT_TRACING)\r
+       WPP_INIT_TRACING(p_drv_obj, p_registry_path);\r
+#endif\r
        status = CL_INIT;\r
        if( !NT_SUCCESS( status ) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_init failed.\n") );\r
                return status;\r
        }\r
@@ -290,7 +301,7 @@ DriverEntry(
                g_ipoib.h_ndis_wrapper, &characteristics, sizeof(characteristics) );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR, \r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, \r
                        ("NdisMRegisterMiniport failed with status of %d\n", status) );\r
                NdisTerminateWrapper( g_ipoib.h_ndis_wrapper, NULL );\r
                CL_DEINIT;\r
@@ -310,18 +321,17 @@ __ipoib_read_registry(
 {\r
        NTSTATUS                                                status;\r
        /* Remember the terminating entry in the table below. */\r
-       RTL_QUERY_REGISTRY_TABLE                table[2];\r
+       RTL_QUERY_REGISTRY_TABLE                table[3];\r
        UNICODE_STRING                                  param_path;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
-\r
        RtlInitUnicodeString( &param_path, NULL );\r
        param_path.MaximumLength = p_registry_path->Length + \r
                sizeof(L"\\Parameters");\r
        param_path.Buffer = cl_zalloc( param_path.MaximumLength );\r
        if( !param_path.Buffer )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, \r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, \r
                        ("Failed to allocate parameters path buffer.\n") );\r
                return STATUS_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -337,16 +347,28 @@ __ipoib_read_registry(
 \r
        /* Setup the table entries. */\r
        table[0].Flags = RTL_QUERY_REGISTRY_DIRECT;\r
-       table[0].Name = L"DebugFlags";\r
-       table[0].EntryContext = &g_ipoib_dbg_lvl;\r
+       table[0].Name = L"DebugLevel";\r
+       table[0].EntryContext = &g_ipoib_dbg_level;\r
        table[0].DefaultType = REG_DWORD;\r
-       table[0].DefaultData = &g_ipoib_dbg_lvl;\r
+       table[0].DefaultData = &g_ipoib_dbg_level;\r
        table[0].DefaultLength = sizeof(ULONG);\r
 \r
+       table[1].Flags = RTL_QUERY_REGISTRY_DIRECT;\r
+       table[1].Name = L"DebugFlags";\r
+       table[1].EntryContext = &g_ipoib_dbg_flags;\r
+       table[1].DefaultType = REG_DWORD;\r
+       table[1].DefaultData = &g_ipoib_dbg_flags;\r
+       table[1].DefaultLength = sizeof(ULONG);\r
+\r
        /* Have at it! */\r
        status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, \r
                param_path.Buffer, table, NULL, NULL );\r
 \r
+       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("debug level %d debug flags 0x%.8x\n",\r
+                       g_ipoib_dbg_level,\r
+                       g_ipoib_dbg_flags));\r
+\r
        cl_free( param_path.Buffer );\r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
        return status;\r
@@ -358,6 +380,10 @@ ipoib_unload(
        IN                              PDRIVER_OBJECT                          p_drv_obj )\r
 {\r
        IPOIB_ENTER( IPOIB_DBG_INIT );\r
+       #if defined(EVENT_TRACING)\r
+       WPP_CLEANUP(p_drv_obj);\r
+       #endif\r
+\r
        UNREFERENCED_PARAMETER( p_drv_obj );\r
        CL_DEINIT;\r
        IPOIB_EXIT( IPOIB_DBG_INIT );\r
@@ -379,7 +405,7 @@ ipoib_get_adapter_params(
        NdisOpenConfiguration( &status, &h_config, wrapper_config_context );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisOpenConfiguration returned 0x%.8x\n", status) );\r
                return status;\r
        }\r
@@ -390,7 +416,7 @@ ipoib_get_adapter_params(
                &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Receive Queue Depth parameter missing.\n") );\r
                return status;\r
        }\r
@@ -402,7 +428,7 @@ ipoib_get_adapter_params(
                &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Send Queue Depth parameter missing.\n") );\r
                return status;\r
        }\r
@@ -423,7 +449,7 @@ ipoib_get_adapter_params(
                &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Send Checksum Offload parameter missing.\n") );\r
                return status;\r
        }\r
@@ -453,7 +479,7 @@ ipoib_get_adapter_params(
                &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("SA query timeout parameter missing.\n") );\r
                return status;\r
        }\r
@@ -465,7 +491,7 @@ ipoib_get_adapter_params(
                &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("SA query retry count parameter missing.\n") );\r
                return status;\r
        }\r
@@ -477,7 +503,7 @@ ipoib_get_adapter_params(
                &status, &p_param, h_config, &keyword, NdisParameterInteger );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Receive pool to queue depth ratio parameter missing.\n") );\r
                return status;\r
        }\r
@@ -538,7 +564,7 @@ ipoib_get_adapter_guids(
                NULL, 0, NULL, &event, &io_status );\r
        if( !p_irp )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate query interface IRP.\n") );\r
                return STATUS_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -561,7 +587,7 @@ ipoib_get_adapter_guids(
 \r
        if( !NT_SUCCESS( status ) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Query interface for IPOIB interface returned %08x.\n", status) );\r
                return status;\r
        }\r
@@ -627,7 +653,8 @@ ipoib_initialize(
 \r
        if( medium_index == medium_array_size ) /* Never found it */\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("No supported media.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("No supported media.\n") );\r
                return NDIS_STATUS_UNSUPPORTED_MEDIA;\r
        }\r
 \r
@@ -637,7 +664,7 @@ ipoib_initialize(
        ib_status = ipoib_create_adapter( wrapper_config_context, h_adapter, &p_adapter );\r
        if( ib_status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_create_adapter returned status %d.\n", ib_status ) );\r
                return NDIS_STATUS_FAILURE;\r
        }\r
@@ -654,7 +681,7 @@ ipoib_initialize(
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                ipoib_destroy_adapter( p_adapter );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisMInitializeScatterGatherDma returned 0x%.8x.\n", status) );\r
                return status;\r
        }\r
@@ -667,7 +694,7 @@ ipoib_initialize(
                NdisWriteErrorLogEntry( h_adapter,\r
                        NDIS_ERROR_CODE_HARDWARE_FAILURE, 0 );\r
                ipoib_destroy_adapter( p_adapter );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_start_adapter returned status %d.\n", ib_status ) );\r
                return NDIS_STATUS_FAILURE;\r
        }\r
@@ -697,7 +724,7 @@ ipoib_halt(
        CL_ASSERT( adapter_context );\r
        p_adapter = (ipoib_adapter_t*)adapter_context;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_INIT | IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Port %016I64x (CA %016I64x port %d) halting\n",\r
                        p_adapter->guids.port_guid, p_adapter->guids.ca_guid,\r
                        p_adapter->guids.port_num) );\r
@@ -791,32 +818,32 @@ ipoib_query_info(
        {\r
        /* Required General */\r
        case OID_GEN_SUPPORTED_LIST:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_SUPPORTED_LIST\n", port_num) );\r
                src_buf = (PVOID)SUPPORTED_OIDS;\r
                buf_len = sizeof(SUPPORTED_OIDS);\r
                break;\r
 \r
        case OID_GEN_HARDWARE_STATUS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_HARDWARE_STATUS\n", port_num) );\r
                cl_obj_lock( &p_adapter->obj );\r
                switch( p_adapter->state )\r
                {\r
                case IB_PNP_PORT_ADD:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NdisHardwareStatusInitializing\n", port_num) );\r
                        info = NdisHardwareStatusInitializing;\r
                        break;\r
                        \r
                case IB_PNP_PORT_ACTIVE:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NdisHardwareStatusReady\n", port_num) );\r
                        info = NdisHardwareStatusReady;\r
                        break;\r
 \r
                default:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NdisHardwareStatusNotReady\n", port_num) );\r
                        info = NdisHardwareStatusNotReady;\r
                }\r
@@ -825,20 +852,20 @@ ipoib_query_info(
 \r
        case OID_GEN_MEDIA_SUPPORTED:\r
        case OID_GEN_MEDIA_IN_USE:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MEDIA_SUPPORTED "\r
                        "or OID_GEN_MEDIA_IN_USE\n", port_num) );\r
                info = NdisMedium802_3;\r
                break;\r
 \r
        case OID_GEN_MAXIMUM_FRAME_SIZE:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MAXIMUM_FRAME_SIZE\n", port_num) );\r
                info = PAYLOAD_MTU;\r
                break;\r
 \r
        case OID_GEN_LINK_SPEED:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_LINK_SPEED\n", port_num) );\r
                cl_obj_lock( &p_adapter->obj );\r
                switch( p_adapter->state )\r
@@ -850,13 +877,13 @@ ipoib_query_info(
                        /* Save the request parameters. */\r
                        p_adapter->query_oid = oid_info;\r
 \r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NDIS_STATUS_PENDING\n", port_num) );\r
                        status = NDIS_STATUS_PENDING;\r
                        break;\r
 \r
                case IB_PNP_PORT_REMOVE:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NDIS_STATUS_NOT_ACCEPTED\n", port_num) );\r
                        status = NDIS_STATUS_NOT_ACCEPTED;\r
                        break;\r
@@ -870,13 +897,13 @@ ipoib_query_info(
                break;\r
 \r
        case OID_GEN_TRANSMIT_BUFFER_SPACE:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_TRANSMIT_BUFFER_SPACE\n", port_num) );\r
                info = p_adapter->params.sq_depth * XFER_BLOCK_SIZE;\r
                break;\r
 \r
        case OID_GEN_RECEIVE_BUFFER_SPACE:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_TRANSMIT_BUFFER_SPACE "\r
                        "or OID_GEN_RECEIVE_BUFFER_SPACE\n", port_num) );\r
                info = p_adapter->params.rq_depth * XFER_BLOCK_SIZE;\r
@@ -887,7 +914,7 @@ ipoib_query_info(
        case OID_GEN_TRANSMIT_BLOCK_SIZE:\r
        case OID_GEN_RECEIVE_BLOCK_SIZE:\r
        case OID_GEN_MAXIMUM_TOTAL_SIZE:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MAXIMUM_LOOKAHEAD "\r
                        "or OID_GEN_CURRENT_LOOKAHEAD or "\r
                        "OID_GEN_TRANSMIT_BLOCK_SIZE or "\r
@@ -897,21 +924,21 @@ ipoib_query_info(
                break;\r
 \r
        case OID_GEN_VENDOR_ID:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_VENDOR_ID\n", port_num) );\r
                src_buf = (void*)VENDOR_ID;\r
                buf_len = sizeof(VENDOR_ID);\r
                break;\r
 \r
        case OID_GEN_VENDOR_DESCRIPTION:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID\r
                        ("Port %d received query for OID_GEN_VENDOR_DESCRIPTION\n", port_num) );\r
                src_buf = VENDOR_DESCRIPTION;\r
                buf_len = sizeof(VENDOR_DESCRIPTION);\r
                break;\r
 \r
        case OID_GEN_VENDOR_DRIVER_VERSION:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_VENDOR_DRIVER_VERSION\n", port_num) );\r
                src_buf = &version;\r
                buf_len = sizeof(version);\r
@@ -920,19 +947,19 @@ ipoib_query_info(
                break;\r
 \r
        case OID_GEN_PHYSICAL_MEDIUM:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_PHYSICAL_MEDIUM\n", port_num) );\r
                info = NdisPhysicalMediumUnspecified;\r
                break;\r
 \r
        case OID_GEN_CURRENT_PACKET_FILTER:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_CURRENT_PACKET_FILTER\n", port_num) );\r
                info = p_adapter->packet_filter;\r
                break;\r
 \r
        case OID_GEN_DRIVER_VERSION:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_DRIVER_VERSION\n", port_num) );\r
                src_buf = &version;\r
                buf_len = sizeof(version);\r
@@ -940,7 +967,7 @@ ipoib_query_info(
                break;\r
 \r
        case OID_GEN_MAC_OPTIONS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MAC_OPTIONS\n", port_num) );\r
                info = NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA |\r
                        NDIS_MAC_OPTION_TRANSFERS_NOT_PEND |\r
@@ -954,7 +981,7 @@ ipoib_query_info(
                break;\r
 \r
        case OID_GEN_MEDIA_CONNECT_STATUS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MEDIA_CONNECT_STATUS\n", port_num) );\r
                cl_obj_lock( &p_adapter->obj );\r
                switch( p_adapter->state )\r
@@ -968,25 +995,25 @@ ipoib_query_info(
                        p_adapter->pending_query = TRUE;\r
                        p_adapter->query_oid = oid_info;\r
 \r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NDIS_STATUS_PENDING\n", port_num) );\r
                        status = NDIS_STATUS_PENDING;\r
                        break;\r
 \r
                case IB_PNP_PORT_ACTIVE:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NdisMediaStateConnected\n", port_num) );\r
                        info = NdisMediaStateConnected;\r
                        break;\r
 \r
                case IB_PNP_PORT_REMOVE:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NDIS_STATUS_NOT_ACCEPTED\n", port_num) );\r
                        status = NDIS_STATUS_NOT_ACCEPTED;\r
                        break;\r
 \r
                default:\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d returning NdisMediaStateDisconnected\n", port_num) );\r
                        info = NdisMediaStateDisconnected;\r
                }\r
@@ -994,126 +1021,126 @@ ipoib_query_info(
                break;\r
 \r
        case OID_GEN_MAXIMUM_SEND_PACKETS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MAXIMUM_SEND_PACKETS\n", port_num) );\r
                info = MAXULONG;\r
                break;\r
 \r
        /* Required General Statistics */\r
        case OID_GEN_XMIT_OK:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_XMIT_OK\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_SUCCESS, &oid_info );\r
                break;\r
 \r
        case OID_GEN_RCV_OK:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_RCV_OK\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_SUCCESS, &oid_info );\r
                break;\r
 \r
        case OID_GEN_XMIT_ERROR:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_XMIT_ERROR\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_ERROR, &oid_info );\r
                break;\r
 \r
        case OID_GEN_RCV_ERROR:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_RCV_ERROR\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_ERROR, &oid_info );\r
                break;\r
 \r
        case OID_GEN_RCV_NO_BUFFER:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_RCV_NO_BUFFER\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_DROPPED, &oid_info );\r
                break;\r
 \r
        case OID_GEN_DIRECTED_BYTES_XMIT:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_DIRECTED_BYTES_XMIT\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_UCAST_BYTES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_DIRECTED_FRAMES_XMIT:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_DIRECTED_FRAMES_XMIT\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_UCAST_FRAMES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_MULTICAST_BYTES_XMIT:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MULTICAST_BYTES_XMIT\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_MCAST_BYTES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_MULTICAST_FRAMES_XMIT:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MULTICAST_FRAMES_XMIT\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_MCAST_FRAMES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_BROADCAST_BYTES_XMIT:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_BROADCAST_BYTES_XMIT\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_BCAST_BYTES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_BROADCAST_FRAMES_XMIT:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_BROADCAST_FRAMES_XMIT\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_send_stat( p_adapter, IP_STAT_BCAST_FRAMES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_DIRECTED_BYTES_RCV:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_DIRECTED_BYTES_RCV\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_UCAST_BYTES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_DIRECTED_FRAMES_RCV:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_DIRECTED_FRAMES_RCV\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_UCAST_FRAMES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_MULTICAST_BYTES_RCV:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MULTICAST_BYTES_RCV\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_MCAST_BYTES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_MULTICAST_FRAMES_RCV:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_MULTICAST_FRAMES_RCV\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_MCAST_FRAMES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_BROADCAST_BYTES_RCV:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_BROADCAST_BYTES_RCV\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_BCAST_BYTES, &oid_info );\r
                break;\r
 \r
        case OID_GEN_BROADCAST_FRAMES_RCV:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_GEN_BROADCAST_FRAMES_RCV\n", port_num) );\r
                src_buf = NULL;\r
                status = ipoib_get_recv_stat( p_adapter, IP_STAT_BCAST_FRAMES, &oid_info );\r
@@ -1125,12 +1152,12 @@ ipoib_query_info(
 #if defined( _DEBUG_ )\r
                if( oid == OID_802_3_PERMANENT_ADDRESS )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d received query for OID_802_3_PERMANENT_ADDRESS\n", port_num) );\r
                }\r
                else\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d received query for OID_802_3_CURRENT_ADDRESS\n", port_num) );\r
                }\r
 #endif /* defined( _DEBUG_ )*/\r
@@ -1139,20 +1166,20 @@ ipoib_query_info(
                break;\r
 \r
        case OID_802_3_MULTICAST_LIST:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_802_3_MULTICAST_LIST\n", port_num) );\r
                src_buf = p_adapter->mcast_array;\r
                buf_len = p_adapter->mcast_array_size * sizeof(mac_addr_t);\r
                break;\r
 \r
        case OID_802_3_MAXIMUM_LIST_SIZE:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_802_3_MAXIMUM_LIST_SIZE\n", port_num) );\r
                info = MAX_MCAST;\r
                break;\r
 \r
        case OID_802_3_MAC_OPTIONS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_802_3_MAC_OPTIONS\n", port_num) );\r
                info = 0;\r
                break;\r
@@ -1161,7 +1188,7 @@ ipoib_query_info(
        case OID_802_3_RCV_ERROR_ALIGNMENT:\r
        case OID_802_3_XMIT_ONE_COLLISION:\r
        case OID_802_3_XMIT_MORE_COLLISIONS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received query for OID_802_3_RCV_ERROR_ALIGNMENT or "\r
                        "OID_802_3_XMIT_ONE_COLLISION or "\r
                        "OID_802_3_XMIT_MORE_COLLISIONS\n", port_num) );\r
@@ -1193,7 +1220,7 @@ ipoib_query_info(
        case OID_802_3_XMIT_LATE_COLLISIONS:\r
        case OID_PNP_CAPABILITIES:\r
                status = NDIS_STATUS_NOT_SUPPORTED;\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received an unsupported oid of 0x%.8X!\n", port_num, oid) );\r
                break;\r
 \r
@@ -1206,7 +1233,7 @@ ipoib_query_info(
 #endif\r
        default:\r
                status = NDIS_STATUS_INVALID_OID;\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received an invalid oid of 0x%.8X!\n", port_num, oid) );\r
                break;\r
        }\r
@@ -1246,7 +1273,7 @@ ipoib_complete_query(
        {\r
                if( p_oid_info->buf_len < buf_len )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Insufficient buffer space.  "\r
                                "Returning NDIS_STATUS_INVALID_LENGTH.\n") );\r
                        oid_status = NDIS_STATUS_INVALID_LENGTH;\r
@@ -1264,7 +1291,7 @@ ipoib_complete_query(
                }\r
                else\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Returning NDIS_NOT_ACCEPTED") );\r
                        oid_status = NDIS_STATUS_NOT_ACCEPTED;\r
                }\r
@@ -1292,7 +1319,7 @@ __ipoib_get_tcp_task_offload(
        NDIS_TASK_TCP_IP_CHECKSUM       *p_offload_chksum;\r
        ULONG                                           buf_len;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                ("Port %d received query for OID_TCP_TASK_OFFLOAD\n",\r
                p_adapter->guids.port_num) );\r
 \r
@@ -1372,7 +1399,7 @@ __ipoib_set_tcp_task_offload(
        NDIS_TASK_OFFLOAD                       *p_offload_task;\r
        NDIS_TASK_TCP_IP_CHECKSUM       *p_offload_chksum;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                ("Port %d received set for OID_TCP_TASK_OFFLOAD\n",\r
                p_adapter->guids.port_num) );\r
 \r
@@ -1522,7 +1549,7 @@ ipoib_set_info(
        {\r
        /* Required General */\r
        case OID_GEN_CURRENT_PACKET_FILTER:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received set for OID_GEN_CURRENT_PACKET_FILTER\n", port_num));\r
                if( info_buf_len < sizeof(p_adapter->packet_filter) )\r
                {\r
@@ -1584,14 +1611,14 @@ ipoib_set_info(
                break;\r
 \r
        case OID_GEN_CURRENT_LOOKAHEAD:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received set for OID_GEN_CURRENT_LOOKAHEAD\n", port_num));\r
                if( info_buf_len < buf_len )\r
                        status = NDIS_STATUS_INVALID_LENGTH;\r
                break;\r
 \r
        case OID_GEN_PROTOCOL_OPTIONS:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received set for OID_GEN_PROTOCOL_OPTIONS\n", port_num));\r
                if( info_buf_len < buf_len )\r
                        status = NDIS_STATUS_INVALID_LENGTH;\r
@@ -1603,31 +1630,31 @@ ipoib_set_info(
 \r
 #ifdef NDIS51_MINIPORT\r
        case OID_GEN_MACHINE_NAME:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OID,\r
                        ("Port %d received set for OID_GEN_MACHINE_NAME\n", port_num) );\r
                break;\r
 #endif\r
 \r
        /* Required Ethernet operational characteristics */\r
        case OID_802_3_MULTICAST_LIST:\r
-               IPOIB_TRACE( IPOIB_DBG_OID,\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_OID,\r
                        ("Port %d received set for OID_802_3_MULTICAST_LIST\n", port_num) );\r
                if( info_buf_len > MAX_MCAST * sizeof(mac_addr_t) )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d OID_802_3_MULTICAST_LIST - Multicast list full.\n", port_num) );\r
                        status = NDIS_STATUS_MULTICAST_FULL;\r
                        *p_bytes_needed = MAX_MCAST * sizeof(mac_addr_t);\r
                }\r
                else if( info_buf_len % sizeof(mac_addr_t) )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d OID_802_3_MULTICAST_LIST - Invalid input buffer.\n", port_num) );\r
                        status = NDIS_STATUS_INVALID_DATA;\r
                }\r
                else if( !info_buf && info_buf_len )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d OID_802_3_MULTICAST_LIST - Invalid input buffer.\n", port_num) );\r
                        status = NDIS_STATUS_INVALID_DATA;\r
                }\r
@@ -1648,7 +1675,7 @@ ipoib_set_info(
                break;\r
 \r
        case OID_TCP_TASK_OFFLOAD:\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received set for OID_TCP_TASK_OFFLOAD\n", port_num) );\r
 \r
                buf_len = info_buf_len;\r
@@ -1663,7 +1690,7 @@ ipoib_set_info(
        case OID_GEN_VLAN_ID:\r
 #endif\r
                status = NDIS_STATUS_NOT_SUPPORTED;\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received an unsupported oid of 0x%.8X!\n", port_num, oid));\r
                break;\r
 \r
@@ -1690,7 +1717,7 @@ ipoib_set_info(
        case OID_GEN_PHYSICAL_MEDIUM:\r
        default:\r
                status = NDIS_STATUS_INVALID_OID;\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d received an invalid oid of 0x%.8X!\n", port_num, oid));\r
                break;\r
        }\r
@@ -1792,7 +1819,7 @@ ipoib_pnp_notify(
 \r
        p_adapter = (ipoib_adapter_t*)adapter_context;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_PNP, ("Event %d\n", pnp_event) );\r
+       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_PNP, ("Event %d\n", pnp_event) );\r
        if( pnp_event != NdisDevicePnPEventPowerProfileChanged )\r
        {\r
                cl_obj_lock( &p_adapter->obj );\r
@@ -1976,13 +2003,13 @@ __ipoib_set_net_addr(
        status = NDIS_STATUS_SUCCESS;\r
        port_num = p_adapter->guids.port_num;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                ("Port %d received set for OID_GEN_NETWORK_LAYER_ADDRESSES\n",\r
                port_num) );\r
 \r
        if( !info_buf )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Port %d - OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
                        "NULL buffer\n", port_num) );\r
                IPOIB_EXIT( IPOIB_DBG_OID );\r
@@ -1995,7 +2022,7 @@ __ipoib_set_net_addr(
         */\r
        if( info_buf_len < FIELD_OFFSET(NETWORK_ADDRESS_LIST, Address) )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR, \r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, \r
                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
                        "bad length of %d, not enough "\r
                        "for NETWORK_ADDRESS_LIST (%d)\n", port_num, info_buf_len,\r
@@ -2010,13 +2037,13 @@ __ipoib_set_net_addr(
        {\r
                if( p_net_addrs->AddressType == NDIS_PROTOCOL_ID_TCP_IP )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OID,\r
                                ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
                                "clear TCP/IP addresses\n", port_num) );\r
                }\r
                else\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_OID,\r
                                ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
                                "Non TCP/IP address type of 0x%.4X on clear\n",\r
                                port_num, p_net_addrs->AddressType) );\r
@@ -2032,7 +2059,7 @@ __ipoib_set_net_addr(
 \r
        if( info_buf_len < total_size )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
                        "bad length of %d, %d required for %d addresses\n",\r
                        port_num, info_buf_len, total_size, p_net_addrs->AddressCount) );\r
@@ -2050,9 +2077,9 @@ __ipoib_set_net_addr(
        if( cl_status != CL_SUCCESS )\r
        {\r
                cl_obj_unlock( &p_adapter->obj );\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT(TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Port %d - OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
-                       "Failed to set IP vector capacity: %s\n",\r
+                       "Failed to set IP vector capacity: %s\n", port_num,\r
                        CL_STATUS_MSG(cl_status)) );\r
                IPOIB_EXIT( IPOIB_DBG_OID );\r
                return NDIS_STATUS_RESOURCES;\r
@@ -2060,7 +2087,7 @@ __ipoib_set_net_addr(
 \r
        *p_bytes_read = total_size;\r
 \r
-       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - List contains %d addresses\n",\r
                        port_num, p_net_addrs->AddressCount));\r
 \r
@@ -2079,7 +2106,7 @@ __ipoib_set_net_addr(
 \r
                        if( p_net_addr_oid->AddressType != NDIS_PROTOCOL_ID_TCP_IP )\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_WARN,\r
+                               IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_OID,\r
                                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Address %d is wrong type of 0x%.4X, "\r
                                                "should be 0x%.4X\n", port_num, i, p_net_addr_oid->AddressType,\r
                                                NDIS_PROTOCOL_ID_TCP_IP));\r
@@ -2088,7 +2115,7 @@ __ipoib_set_net_addr(
 \r
                        if( p_net_addr_oid->AddressLength != NETWORK_ADDRESS_LENGTH_IP)\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_WARN,\r
+                               IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_OID,\r
                                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Address %d is wrong size of %d, "\r
                                                "should be %d\n", port_num, i, p_net_addr_oid->AddressLength,\r
                                                NETWORK_ADDRESS_LENGTH_IP));\r
@@ -2106,7 +2133,7 @@ __ipoib_set_net_addr(
                if( i == p_net_addrs->AddressCount )\r
                {\r
                        /* Didn't find a match, delete from SA */\r
-                       IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Deleting Address %d.%d.%d.%d\n",\r
                                        port_num,\r
                                        p_addr_item->address.as_bytes[0],\r
@@ -2141,7 +2168,7 @@ __ipoib_set_net_addr(
 \r
                if( p_net_addr_oid->AddressType != NDIS_PROTOCOL_ID_TCP_IP )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_WARN,\r
+                       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_OID,\r
                                ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Address %d is wrong type of 0x%.4X, "\r
                                        "should be 0x%.4X\n", port_num, i, p_net_addr_oid->AddressType,\r
                                        NDIS_PROTOCOL_ID_TCP_IP));\r
@@ -2150,7 +2177,7 @@ __ipoib_set_net_addr(
 \r
                if( p_net_addr_oid->AddressLength != NETWORK_ADDRESS_LENGTH_IP)\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_WARN,\r
+                       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_OID,\r
                                ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Address %d is wrong size of %d, "\r
                                        "should be %d\n", port_num, i, p_net_addr_oid->AddressLength,\r
                                        NETWORK_ADDRESS_LENGTH_IP));\r
@@ -2191,7 +2218,7 @@ __ipoib_set_net_addr(
                        p_addr_item->p_reg = NULL;\r
                }\r
                memcpy ((void *)&p_addr_item->address.as_ulong, (const void *)&p_ip_addr->in_addr, sizeof(ULONG) );\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Adding Address %d.%d.%d.%d\n",\r
                        port_num,\r
                        p_addr_item->address.as_bytes[0],\r
@@ -2325,7 +2352,7 @@ ipoib_reg_addrs(
                        if( ib_status == IB_INVALID_GUID )\r
                        {\r
                                /* If this occurs, we log the error but do not fail the OID yet */\r
-                               IPOIB_TRACE( IPOIB_DBG_WARN,\r
+                               IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_OID,\r
                                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - "\r
                                        "Failed to register IP Address "\r
                                        "of %d.%d.%d.%d with error IB_INVALID_GUID\n",\r
@@ -2338,7 +2365,7 @@ ipoib_reg_addrs(
                        else\r
                        {\r
                                /* Fatal error. */\r
-                               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Failed to register IP Address "\r
                                        "of %d.%d.%d.%d with error %s\n",\r
                                        port_num,\r
@@ -2414,7 +2441,7 @@ __ipoib_ats_reg_cb(
        if( p_reg_svc_rec->req_status == IB_SUCCESS &&\r
                !p_reg_svc_rec->resp_status )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_OID | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION,IPOIB_DBG_OID,\r
                                         ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Registered IP Address "\r
                                          "of %d.%d.%d.%d\n",\r
                                          port_num,\r
@@ -2425,7 +2452,7 @@ __ipoib_ats_reg_cb(
        }\r
        else if( p_reg_svc_rec->req_status != IB_CANCELED )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_OID,\r
                                         ("Port %d OID_GEN_NETWORK_LAYER_ADDRESSES - Failed to register IP Address "\r
                                          "of %d.%d.%d.%d with error %s\n",\r
                                          port_num,\r
index a3bb2cf..a96ebb1 100644 (file)
@@ -38,7 +38,7 @@
 #include "ipoib_adapter.h"\r
 #include <complib/cl_spinlock.h>\r
 #include <complib/cl_qlist.h>\r
-#include <complib/cl_debug.h>\r
+#include "ipoib_debug.h"\r
 \r
 \r
 /*\r
index 3d0a43f..c75ac2d 100644 (file)
 #include "ipoib_endpoint.h"\r
 #include "ipoib_port.h"\r
 #include "ipoib_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "ipoib_endpoint.tmh"\r
+#endif\r
 #include <complib/cl_atomic.h>\r
 \r
 \r
@@ -83,7 +89,7 @@ ipoib_endpt_create(
        p_endpt = cl_zalloc( sizeof(ipoib_endpt_t) );\r
        if( !p_endpt )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate endpoint (%d bytes)\n",\r
                        sizeof(ipoib_endpt_t)) );\r
                return NULL;\r
@@ -138,7 +144,7 @@ __create_mcast_av(
 \r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_create_av returned %s\n",\r
                        p_endpt->p_ifc->get_err_str( status )) );\r
        }\r
@@ -159,7 +165,7 @@ ipoib_endpt_set_mcast(
 \r
        IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
 \r
-       IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),\r
+       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
                ("Create av for MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
                p_endpt->mac.addr[0], p_endpt->mac.addr[1],\r
                p_endpt->mac.addr[2], p_endpt->mac.addr[3],\r
@@ -169,7 +175,7 @@ ipoib_endpt_set_mcast(
                &p_endpt->h_av );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__create_mcast_av returned %s\n", \r
                        p_endpt->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -224,7 +230,8 @@ __endpt_cleanup(
        /* Leave the multicast group if it exists. */\r
        if( p_endpt->h_mcast )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_INFO, ("Leaving MCast group\n") );\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
+                       ("Leaving MCast group\n") );\r
                p_port->p_adapter->p_ifc->leave_mcast( p_endpt->h_mcast, NULL );\r
        }\r
 \r
@@ -322,7 +329,7 @@ ipoib_endpt_queue(
                p_port->p_adapter->h_al, &query, &p_endpt->h_query );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ENDPT,\r
                        ("ib_query for path returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                ipoib_endpt_deref( p_endpt );\r
@@ -359,7 +366,7 @@ __path_query_cb(
                ipoib_endpt_deref( p_endpt );\r
                if( p_query_rec->p_result_mad )\r
                        p_port->p_adapter->p_ifc->put_mad( p_query_rec->p_result_mad );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Endpoint destroying, aborting.\n") );\r
                return;\r
        }\r
@@ -371,7 +378,7 @@ __path_query_cb(
                ipoib_endpt_deref( p_endpt );\r
                if( p_query_rec->p_result_mad )\r
                        p_port->p_adapter->p_ifc->put_mad( p_query_rec->p_result_mad );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Path query failed with %s\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( p_query_rec->status )) );\r
                return;\r
@@ -431,7 +438,7 @@ __path_query_cb(
                p_port->p_adapter->hung = TRUE;\r
                ipoib_endpt_deref( p_endpt );\r
                cl_obj_unlock( &p_endpt->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_create_av failed with %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return;\r
index 58a6eed..fdf76bf 100644 (file)
@@ -130,7 +130,7 @@ ipoib_endpt_ref(
        IN                              ipoib_endpt_t* const            p_endpt )\r
 {\r
        CL_ASSERT( p_endpt );\r
-       IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
+\r
        cl_obj_ref( &p_endpt->obj );\r
        /*\r
         * Anytime we reference the endpoint, we're either receiving data\r
@@ -138,7 +138,6 @@ ipoib_endpt_ref(
         * to prevent the AV from being flushed.\r
         */\r
        p_endpt->expired = FALSE;\r
-       IPOIB_EXIT( IPOIB_DBG_ENDPT );\r
 }\r
 \r
 \r
@@ -146,9 +145,7 @@ static inline void
 ipoib_endpt_deref(\r
        IN                              ipoib_endpt_t* const            p_endpt )\r
 {\r
-       IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
        cl_obj_deref( &p_endpt->obj );\r
-       IPOIB_EXIT( IPOIB_DBG_ENDPT );\r
 }\r
 \r
 \r
index a49e0c5..aeb0e57 100644 (file)
 #include "ipoib_adapter.h"\r
 #include "ipoib_port.h"\r
 #include "ipoib_debug.h"\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "ipoib_ibat.tmh"\r
+#endif\r
 #include <iba/ib_at_ioctl.h>\r
 \r
 \r
@@ -76,14 +82,16 @@ __ibat_get_ports(
        if( pIoStack->Parameters.DeviceIoControl.InputBufferLength !=\r
                sizeof(IOCTL_IBAT_PORTS_IN) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid input buffer size.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid input buffer size.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
        \r
        if( pIoStack->Parameters.DeviceIoControl.OutputBufferLength <\r
                sizeof(IOCTL_IBAT_PORTS_OUT) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid output buffer size.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid output buffer size.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -92,7 +100,8 @@ __ibat_get_ports(
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid version.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid version.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -138,6 +147,7 @@ __ibat_get_ports(
        }\r
 \r
        KeReleaseInStackQueuedSpinLock( &hdl );\r
+       IPOIB_EXIT( IPOIB_DBG_IOCTL );\r
        return STATUS_SUCCESS;\r
 }\r
 \r
@@ -162,14 +172,16 @@ __ibat_get_ips(
        if( pIoStack->Parameters.DeviceIoControl.InputBufferLength !=\r
                sizeof(IOCTL_IBAT_IP_ADDRESSES_IN) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid input buffer size.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid input buffer size.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
        \r
        if( pIoStack->Parameters.DeviceIoControl.OutputBufferLength <\r
                sizeof(IOCTL_IBAT_IP_ADDRESSES_OUT) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid output buffer size.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid output buffer size.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -178,7 +190,8 @@ __ibat_get_ips(
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid version.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid version.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -234,6 +247,7 @@ __ibat_get_ips(
                pIrp->IoStatus.Information += (sizeof(IP_ADDRESS) * nIps);\r
 \r
        KeReleaseInStackQueuedSpinLock( &hdl );\r
+       IPOIB_EXIT( IPOIB_DBG_IOCTL );\r
        return STATUS_SUCCESS;\r
 }\r
 \r
@@ -255,14 +269,16 @@ __ibat_mac_to_gid(
        if( pIoStack->Parameters.DeviceIoControl.InputBufferLength !=\r
                sizeof(IOCTL_IBAT_MAC_TO_GID_IN) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid input buffer size.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid input buffer size.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
        \r
        if( pIoStack->Parameters.DeviceIoControl.OutputBufferLength !=\r
                sizeof(IOCTL_IBAT_MAC_TO_GID_OUT) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid output buffer size.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid output buffer size.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -271,7 +287,8 @@ __ibat_mac_to_gid(
 \r
        if( pIn->Version != IBAT_IOCTL_VERSION )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid version.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid version.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -303,6 +320,7 @@ __ibat_mac_to_gid(
 \r
        KeReleaseInStackQueuedSpinLock( &hdl );\r
 \r
+       IPOIB_EXIT( IPOIB_DBG_IOCTL );\r
        return status;\r
 }\r
 \r
@@ -336,7 +354,7 @@ ipoib_ref_ibat()
                        &p_dev_obj, &g_ipoib.h_ibat_dev );\r
                if( status != NDIS_STATUS_SUCCESS )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_ERROR, \r
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, \r
                                ("NdisMRegisterDevice failed with status of %d\n", status) );\r
                }\r
        }\r
@@ -443,22 +461,26 @@ __ipoib_dispatch(
        switch( pIoStack->Parameters.DeviceIoControl.IoControlCode )\r
        {\r
        case IOCTL_IBAT_PORTS:\r
-               IPOIB_TRACE( IPOIB_DBG_IOCTL, ("IOCTL_IBAT_PORTS recieved\n") );\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
+                       ("IOCTL_IBAT_PORTS recieved\n") );\r
                status = __ibat_get_ports( pIrp, pIoStack );\r
                break;\r
 \r
        case IOCTL_IBAT_IP_ADDRESSES:\r
-               IPOIB_TRACE( IPOIB_DBG_IOCTL, ("IOCTL_IBAT_IP_ADDRESSES recieved\n" ));\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
+                       ("IOCTL_IBAT_IP_ADDRESSES recieved\n" ));\r
                status = __ibat_get_ips( pIrp, pIoStack );\r
                break;\r
 \r
        case IOCTL_IBAT_MAC_TO_GID:\r
-               IPOIB_TRACE( IPOIB_DBG_IOCTL, ("IOCTL_IBAT_MAC_TO_GID recieved\n" ));\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_IOCTL,\r
+                       ("IOCTL_IBAT_MAC_TO_GID recieved\n" ));\r
                status = __ibat_mac_to_gid( pIrp, pIoStack );\r
                break;\r
 \r
        default:\r
-               IPOIB_TRACE( IPOIB_DBG_WARN, ("unknow IOCTL code = 0x%x\n",\r
+               IPOIB_PRINT( TRACE_LEVEL_WARNING, IPOIB_DBG_IOCTL,\r
+                       ("unknow IOCTL code = 0x%x\n",\r
                        pIoStack->Parameters.DeviceIoControl.IoControlCode) );\r
                status = STATUS_INVALID_PARAMETER;\r
        }\r
index 593061c..72e96f7 100644 (file)
 #include "ipoib_port.h"\r
 #include "ipoib_adapter.h"\r
 #include "ipoib_debug.h"\r
-\r
+#if defined(EVENT_TRACING)\r
+#ifdef offsetof\r
+#undef offsetof\r
+#endif\r
+#include "ipoib_port.tmh"\r
+#endif\r
 \r
 /*\r
  * PR 102492 relates to the SA not accepting wildcard values for MCMemberRecord\r
@@ -488,7 +493,7 @@ ipoib_create_port(
                (sizeof(ipoib_hdr_t) * (p_adapter->params.sq_depth - 1)) );\r
        if( !p_port )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate ipoib_port_t (%d bytes)\n",\r
                        sizeof(ipoib_port_t)) );\r
                return IB_INSUFFICIENT_MEMORY;\r
@@ -503,7 +508,7 @@ ipoib_create_port(
        status = __port_init( p_port, p_adapter, p_pnp_rec );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_port_init returned %s.\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                __port_cleanup( &p_port->obj );\r
@@ -573,7 +578,7 @@ __port_init(
        cl_status = cl_spinlock_init( &p_port->send_lock );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -581,7 +586,7 @@ __port_init(
        cl_status = cl_spinlock_init( &p_port->recv_lock );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -590,7 +595,7 @@ __port_init(
        status = __ib_mgr_init( p_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__ib_mgr_init returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -600,7 +605,7 @@ __port_init(
        status = __buf_mgr_init( p_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__buf_mgr_init returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -610,7 +615,7 @@ __port_init(
        status = __recv_mgr_init( p_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__recv_mgr_init returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -620,7 +625,7 @@ __port_init(
        status = __endpt_mgr_init( p_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__endpt_mgr_init returned %s\n", \r
                        p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -631,7 +636,7 @@ __port_init(
                __port_destroying, __port_cleanup, __port_free );\r
        if( cl_status != CL_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_obj_init returned %s\n", cl_status_text[cl_status]) );\r
                return IB_ERROR;\r
        }\r
@@ -755,7 +760,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_OPEN_CA, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_open_ca returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -768,7 +773,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_ALLOC_PD, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_alloc_pd returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -786,7 +791,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_CREATE_RECV_CQ, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_create_cq returned %s.\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -803,7 +808,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_CREATE_SEND_CQ, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_create_cq returned %s.\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -827,7 +832,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_CREATE_QP, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_create_qp returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -839,7 +844,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_QUERY_QP, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_query_qp returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -863,7 +868,7 @@ __ib_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_REG_PHYS, 1, status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_reg_phys returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -904,7 +909,7 @@ static void
 __buf_mgr_construct(\r
        IN                              ipoib_port_t* const                     p_port )\r
 {\r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_INIT );\r
+       IPOIB_ENTER( IPOIB_DBG_INIT );\r
 \r
        cl_qpool_construct( &p_port->buf_mgr.recv_pool );\r
 \r
@@ -917,7 +922,7 @@ __buf_mgr_construct(
        p_port->buf_mgr.h_send_pkt_pool = NULL;\r
        p_port->buf_mgr.h_send_buf_pool = NULL;\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_INIT );\r
+       IPOIB_EXIT( IPOIB_DBG_INIT );\r
 }\r
 \r
 \r
@@ -929,7 +934,7 @@ __buf_mgr_init(
        NDIS_STATUS             ndis_status;\r
        ipoib_params_t  *p_params;\r
 \r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_INIT );\r
+       IPOIB_ENTER(IPOIB_DBG_INIT );\r
 \r
        CL_ASSERT( p_port );\r
        CL_ASSERT( p_port->p_adapter );\r
@@ -948,7 +953,7 @@ __buf_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_RECV_POOL, 1, cl_status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_qpool_init for recvs returned %s\n",\r
                        cl_status_text[cl_status]) );\r
                return IB_INSUFFICIENT_MEMORY;\r
@@ -961,7 +966,7 @@ __buf_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_RECV_PKT_POOL, 1, ndis_status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisAllocatePacketPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -972,7 +977,7 @@ __buf_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_RECV_BUF_POOL, 1, ndis_status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisAllocateBufferPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -984,7 +989,7 @@ __buf_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_SEND_PKT_POOL, 1, ndis_status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisAllocatePacketPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -995,12 +1000,12 @@ __buf_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_SEND_BUF_POOL, 1, ndis_status );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisAllocateBufferPool returned %08X\n", ndis_status) );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_INIT );\r
+       IPOIB_EXIT( IPOIB_DBG_INIT );\r
        return IB_SUCCESS;\r
 }\r
 \r
@@ -1009,7 +1014,7 @@ static void
 __buf_mgr_destroy(\r
        IN                              ipoib_port_t* const                     p_port )\r
 {\r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_INIT );\r
+       IPOIB_ENTER(IPOIB_DBG_INIT );\r
 \r
        CL_ASSERT( p_port );\r
 \r
@@ -1031,7 +1036,7 @@ __buf_mgr_destroy(
        /* Free the lookaside list of scratch buffers. */\r
        ExDeleteNPagedLookasideList( &p_port->buf_mgr.send_buf_list );\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_INIT );\r
+       IPOIB_EXIT(  IPOIB_DBG_INIT );\r
 }\r
 \r
 \r
@@ -1045,7 +1050,7 @@ __recv_ctor(
        ipoib_port_t            *p_port;\r
        uint32_t                        ds0_len;\r
 \r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_ALLOC );\r
+       IPOIB_ENTER( IPOIB_DBG_ALLOC );\r
 \r
        CL_ASSERT( p_object );\r
        CL_ASSERT( context );\r
@@ -1089,7 +1094,7 @@ __recv_ctor(
        p_desc->p_buf = (recv_buf_t*)cl_zalloc( sizeof(recv_buf_t) );\r
        if( !p_desc->p_buf )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate receive buffer.\n") );\r
                return CL_INSUFFICIENT_MEMORY;\r
        }\r
@@ -1106,7 +1111,7 @@ __recv_ctor(
 \r
        *pp_pool_item = &p_desc->item;\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_ALLOC );\r
+       IPOIB_EXIT( IPOIB_DBG_ALLOC );\r
        return CL_SUCCESS;\r
 }\r
 \r
@@ -1119,7 +1124,7 @@ __recv_dtor(
 {\r
        ipoib_recv_desc_t       *p_desc;\r
 \r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_ALLOC );\r
+       IPOIB_ENTER(  IPOIB_DBG_ALLOC );\r
 \r
        UNUSED_PARAM( context );\r
 \r
@@ -1128,7 +1133,7 @@ __recv_dtor(
        if( p_desc->p_buf )\r
                cl_free( p_desc->p_buf );\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_ALLOC );\r
+       IPOIB_EXIT( IPOIB_DBG_ALLOC );\r
 }\r
 #endif\r
 \r
@@ -1138,7 +1143,7 @@ __buf_mgr_get_recv(
        IN                              ipoib_port_t* const                     p_port )\r
 {\r
        ipoib_recv_desc_t       *p_desc;\r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_ENTER( IPOIB_DBG_RECV );\r
        p_desc = (ipoib_recv_desc_t*)cl_qpool_get( &p_port->buf_mgr.recv_pool );\r
        /* Reference the port object for the send. */\r
        if( p_desc )\r
@@ -1156,7 +1161,7 @@ __buf_mgr_get_recv(
 #endif /* IPOIB_INLINE_RECV */\r
                CL_ASSERT( p_desc->local_ds[0].lkey == p_port->ib_mgr.lkey );\r
        }\r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_EXIT( IPOIB_DBG_RECV );\r
        return p_desc;\r
 }\r
 \r
@@ -1169,7 +1174,7 @@ __buf_mgr_put_recv(
 {\r
        NDIS_BUFFER             *p_buf;\r
 \r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_ENTER(IPOIB_DBG_RECV );\r
 \r
        if( p_packet )\r
        {\r
@@ -1189,7 +1194,7 @@ __buf_mgr_put_recv(
         */\r
        cl_obj_deref( &p_port->obj );\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_EXIT(  IPOIB_DBG_RECV );\r
 }\r
 \r
 \r
@@ -1198,9 +1203,9 @@ __buf_mgr_put_recv_list(
        IN                              ipoib_port_t* const                     p_port,\r
        IN                              cl_qlist_t* const                       p_list )\r
 {\r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_ENTER(  IPOIB_DBG_RECV );\r
        cl_qpool_put_list( &p_port->buf_mgr.recv_pool, p_list );\r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_EXIT(  IPOIB_DBG_RECV );\r
 }\r
 \r
 \r
@@ -1213,13 +1218,13 @@ __buf_mgr_get_ndis_pkt(
        NDIS_PACKET                             *p_packet;\r
        NDIS_BUFFER                             *p_buffer;\r
 \r
-       IPOIB_ENTER( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_ENTER(  IPOIB_DBG_RECV );\r
 \r
        NdisDprAllocatePacketNonInterlocked( &status, &p_packet,\r
                p_port->buf_mgr.h_packet_pool );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate NDIS_PACKET: %08x\n", status) );\r
                return NULL;\r
        }\r
@@ -1235,7 +1240,7 @@ __buf_mgr_get_ndis_pkt(
 #endif /* IPOIB_INLINE_RECV */\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate NDIS_BUFFER: %08x\n", status) );\r
                NdisDprFreePacketNonInterlocked( p_packet );\r
                return NULL;\r
@@ -1245,7 +1250,7 @@ __buf_mgr_get_ndis_pkt(
        NDIS_SET_PACKET_HEADER_SIZE( p_packet, sizeof(eth_hdr_t) );\r
        NDIS_SET_PACKET_STATUS( p_packet, NDIS_STATUS_SUCCESS );\r
 \r
-       IPOIB_EXIT( IPOIB_DBG_BUF | IPOIB_DBG_RECV );\r
+       IPOIB_EXIT(  IPOIB_DBG_RECV );\r
        return p_packet;\r
 }\r
 \r
@@ -1281,7 +1286,7 @@ __recv_mgr_init(
        {\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_RECV_PKT_ARRAY, 0 );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("cl_malloc for PNDIS_PACKET array failed.\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -1327,7 +1332,7 @@ __recv_mgr_repost(
        if( p_port->state == IB_QPS_ERROR )\r
        {\r
                cl_obj_unlock( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_RECV,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                        ("Port in invalid state.  Not reposting.\n") );\r
                return IB_SUCCESS;\r
        }\r
@@ -1338,7 +1343,7 @@ __recv_mgr_repost(
        {\r
                if( p_port->recv_mgr.depth == p_port->p_adapter->params.rq_depth )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_INFO | IPOIB_DBG_RECV,\r
+                       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                                ("Receive queue already full\n") );\r
                        break;\r
                }\r
@@ -1349,7 +1354,7 @@ __recv_mgr_repost(
                cl_perf_stop( &p_port->p_adapter->perf, GetRecv );\r
                if( !p_next )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_INFO | IPOIB_DBG_RECV,\r
+                       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                                ("Out of receive descriptors!\n") );\r
                        break;\r
                }\r
@@ -1387,7 +1392,7 @@ __recv_mgr_repost(
         */\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ip_post_recv returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                /* return the descriptors to the pool */\r
@@ -1469,7 +1474,7 @@ ipoib_return_packet(
                }\r
                else if( status != IB_NOT_DONE )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_RECV,\r
+                       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                                ("__recv_mgr_prepare_pkt returned %s\n",\r
                                p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                        /* Return the item to the head of the list. */\r
@@ -1666,7 +1671,7 @@ __recv_get_endpts(
 #endif /* IPOIB_INLINE_RECV */\r
                        if( status != IB_SUCCESS )\r
                        {\r
-                               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("ipoib_mac_from_guid returned %s\n",\r
                                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                                return;\r
@@ -1681,7 +1686,7 @@ __recv_get_endpts(
                                p_wc->recv.ud.remote_lid, p_wc->recv.ud.remote_qp );\r
                        if( !*pp_src )\r
                        {\r
-                               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("ipoib_endpt_create returned %s\n",\r
                                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                                return;\r
@@ -1709,7 +1714,7 @@ __recv_get_endpts(
        if( *pp_src && (*pp_src)->qpn != p_wc->recv.ud.remote_qp )\r
        {\r
                /* Update the QPN for the endpoint. */\r
-               IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_WARN),\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                        ("Updating QPN for MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
                        (*pp_src )->mac.addr[0], (*pp_src )->mac.addr[1],\r
                        (*pp_src )->mac.addr[2], (*pp_src )->mac.addr[3],\r
@@ -1719,7 +1724,7 @@ __recv_get_endpts(
 \r
        if( *pp_src && *pp_dst )\r
        {\r
-               IPOIB_TRACE( (IPOIB_DBG_RECV | IPOIB_DBG_INFO),\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                        ("Recv:\n"\r
                        "\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n"\r
                        "\tdst MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
@@ -1768,14 +1773,14 @@ __recv_mgr_filter(
                {\r
                        if( p_wc->status != IB_WCS_WR_FLUSHED_ERR )\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("Failed completion %s\n",\r
                                        p_port->p_adapter->p_ifc->get_wc_status_str( p_wc->status )) );\r
                                ipoib_inc_recv_stat( p_port->p_adapter, IP_STAT_ERROR, 0 );\r
                        }\r
                        else\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_INFO | IPOIB_DBG_RECV,\r
+                               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                                        ("Flushed completion %s\n",\r
                                        p_port->p_adapter->p_ifc->get_wc_status_str( p_wc->status )) );\r
                                ipoib_inc_recv_stat( p_port->p_adapter, IP_STAT_DROPPED, 0 );\r
@@ -1790,7 +1795,7 @@ __recv_mgr_filter(
 \r
                if( len < sizeof(ipoib_hdr_t) )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Received ETH packet < min size\n") );\r
                        ipoib_inc_recv_stat( p_port->p_adapter, IP_STAT_ERROR, 0 );\r
                        cl_qlist_insert_tail( p_bad_list, &p_desc->item.list_item );\r
@@ -1833,7 +1838,7 @@ __recv_mgr_filter(
                case ETH_PROT_TYPE_IP:\r
                        if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t)) )\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("Received IP packet < min size\n") );\r
                                status = IB_INVALID_SETTING;\r
                                break;\r
@@ -1853,7 +1858,7 @@ __recv_mgr_filter(
                        if( len <\r
                                (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) + sizeof(udp_hdr_t)) )\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("Received UDP packet < min size\n") );\r
                                status = IB_INVALID_SETTING;\r
                                break;\r
@@ -1868,7 +1873,7 @@ __recv_mgr_filter(
                                if( len < (sizeof(ipoib_hdr_t) + sizeof(ip_hdr_t) +\r
                                        sizeof(udp_hdr_t) + DHCP_MIN_SIZE) )\r
                                {\r
-                                       IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                                ("Received DHCP < min size\n") );\r
                                        status = IB_INVALID_SETTING;\r
                                        break;\r
@@ -1890,7 +1895,7 @@ __recv_mgr_filter(
                case ETH_PROT_TYPE_ARP:\r
                        if( len < (sizeof(ipoib_hdr_t) + sizeof(ipoib_arp_pkt_t)) )\r
                        {\r
-                               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("Received ARP < min size\n") );\r
                                status = IB_INVALID_SETTING;\r
                                break;\r
@@ -1958,7 +1963,7 @@ __recv_gen(
 \r
        if( !p_src || !p_dst )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Received packet with no matching endpoints.\n") );\r
                return IB_NOT_DONE;\r
        }\r
@@ -2000,7 +2005,7 @@ __recv_dhcp(
        status = __recv_gen( p_ipoib, p_eth, p_src, p_dst );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__recv_gen returned %s.\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -2010,7 +2015,8 @@ __recv_dhcp(
        p_dhcp = &p_eth->type.ip.prot.udp.dhcp;\r
        if( p_dhcp->op != DHCP_REQUEST && p_dhcp->op != DHCP_REPLY )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("Invalid DHCP op code.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Invalid DHCP op code.\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
 \r
@@ -2021,7 +2027,7 @@ __recv_dhcp(
        p_option = &p_dhcp->options[0];\r
        if ( *(uint32_t *)p_option != DHCP_COOKIE )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("DHCP cookie corrupted.\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
@@ -2063,13 +2069,13 @@ __recv_dhcp(
        case DHCPINFORM:\r
                if( !p_cid )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to find required Client-identifier option.\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
                if( p_dhcp->htype != DHCP_HW_TYPE_IB )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Invalid hardware address type.\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
@@ -2081,7 +2087,7 @@ __recv_dhcp(
                break;\r
 \r
        default:\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Invalide message type.\n") );\r
                return IB_INVALID_PARAMETER;\r
        }\r
@@ -2094,13 +2100,13 @@ __recv_dhcp(
                /* Validate that the length and type of the option is as required. */\r
                if( p_cid[1] != 21 )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Client-identifier length not 21 as required.\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
                if( p_cid[2] != DHCP_HW_TYPE_IB )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Client-identifier type is wrong.\n") );\r
                        return IB_INVALID_SETTING;\r
                }\r
@@ -2140,7 +2146,7 @@ __recv_arp(
 \r
        if( !p_dst )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Unknown destination endpoint\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
@@ -2150,21 +2156,22 @@ __recv_arp(
 \r
        if( p_ib_arp->hw_type != ARP_HW_TYPE_IB )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ARP hardware type is not IB\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
 \r
        if( p_ib_arp->hw_size != sizeof(ipoib_hw_addr_t) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ARP hardware address size is not sizeof(ipoib_hw_addr_t)\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
 \r
        if( p_ib_arp->prot_type != ETH_PROT_TYPE_IP )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ARP protocal type not IP\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("ARP protocal type not IP\n") );\r
                return IB_INVALID_SETTING;\r
        }\r
 \r
@@ -2206,7 +2213,7 @@ __recv_arp(
                status = ipoib_mac_from_guid( gid.unicast.interface_id, &mac );\r
                if( status != IB_SUCCESS )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("ipoib_mac_from_guid returned %s\n",\r
                                p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                        return status;\r
@@ -2221,7 +2228,7 @@ __recv_arp(
                        0, (p_ib_arp->src_hw.flags_qpn & CL_HTON32(0x00FFFFFF)) );\r
                if( !*pp_src )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("ipoib_endpt_create returned %s\n",\r
                                p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                        return status;\r
@@ -2254,7 +2261,8 @@ __recv_arp(
                         */\r
                        if ( !ib_gid_is_multicast((const ib_gid_t *)&p_dst->dgid ) )\r
                        {\r
-                               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ARP: is not ARP MCAST\n") );\r
+                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                                       ("ARP: is not ARP MCAST\n") );\r
                                return IB_INVALID_SETTING;\r
                        }\r
 \r
@@ -2288,7 +2296,7 @@ __recv_arp(
        status = __recv_gen( p_ipoib, p_eth, *pp_src, p_dst );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__recv_gen returned %s.\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -2370,7 +2378,7 @@ __recv_mgr_prepare_pkt(
                ipoib_inc_recv_stat( p_port->p_adapter, type, 0 );\r
                /* Return the receive descriptor to the pool. */\r
                __buf_mgr_put_recv( p_port, p_desc, NULL );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_RECV,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                        ("Packet filter doesn't match receive.  Dropping.\n") );\r
                /*\r
                 * Return IB_NOT_DONE since the packet has been completed,\r
@@ -2384,7 +2392,7 @@ __recv_mgr_prepare_pkt(
        cl_perf_stop( &p_port->p_adapter->perf, GetNdisPkt );\r
        if( !*pp_packet )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__buf_mgr_get_ndis_pkt failed\n") );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -2437,7 +2445,7 @@ __recv_mgr_build_pkt_array(
                }\r
                else if( status != IB_NOT_DONE )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_RECV,\r
+                       IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_RECV,\r
                                ("__recv_mgr_prepare_pkt returned %s\n",\r
                                p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                        /* Put all completed receives on the port's done list. */\r
@@ -2567,7 +2575,7 @@ __send_copy(
                ExAllocateFromNPagedLookasideList( &p_port->buf_mgr.send_buf_list );\r
        if( !p_desc->p_buf )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to allocate buffer for packet copy.\n") );\r
                return NDIS_STATUS_RESOURCES;\r
        }\r
@@ -2575,7 +2583,7 @@ __send_copy(
        NdisAllocatePacket( &status, &p_packet, p_port->buf_mgr.h_send_pkt_pool );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_SEND | IPOIB_DBG_WARN,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
                        ("Failed to allocate NDIS_PACKET for copy.\n") );\r
                return status;\r
        }\r
@@ -2585,7 +2593,7 @@ __send_copy(
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
                NdisFreePacket( p_packet );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_SEND | IPOIB_DBG_WARN,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
                        ("Failed to allocate NDIS_BUFFER for copy.\n") );\r
                return status;\r
        }\r
@@ -2614,7 +2622,7 @@ __send_copy(
        if( bytes_copied != tot_len )\r
        {\r
                /* Something went wrong.  Drop the packet. */\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to copy full packet: %d of %d bytes copied.\n",\r
                        bytes_copied, tot_len) );\r
                return NDIS_STATUS_RESOURCES;\r
@@ -2648,7 +2656,7 @@ __send_gen(
 \r
        if( !p_mdl )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("No buffers associated with packet.\n") );\r
                return IB_ERROR;\r
        }\r
@@ -2656,7 +2664,7 @@ __send_gen(
        /* Remember that one of the DS entries is reserved for the IPoIB header. */\r
        if( num_pages >= MAX_SEND_SGE )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_SEND | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                        ("Too many buffers to fit in WR ds_array.  Copying data.\n") );\r
                status = __send_copy( p_port, p_desc );\r
                IPOIB_EXIT( IPOIB_DBG_SEND );\r
@@ -2750,7 +2758,7 @@ __send_gen(
                NdisGetNextBuffer( p_mdl, &p_mdl );\r
                if( !p_mdl )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to get next buffer.\n") );\r
                        return IB_ERROR;\r
                }\r
@@ -2783,7 +2791,7 @@ __send_gen(
        if( !p_sgl )\r
        {\r
                ASSERT( p_sgl );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to get SGL from packet.\n") );\r
                return NDIS_STATUS_FAILURE;\r
        }\r
@@ -2794,7 +2802,7 @@ __send_gen(
                ( p_sgl->NumberOfElements > MAX_SEND_SGE &&\r
                p_sgl->Elements[0].Length <= sizeof(eth_hdr_t)) )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_SEND | IPOIB_DBG_INFO,\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                        ("Too many buffers to fit in WR ds_array.  Copying data.\n") );\r
                cl_perf_start( SendCopy );\r
                status = __send_copy( p_port, p_desc );\r
@@ -2868,14 +2876,14 @@ __send_mgr_filter_ip(
                NdisGetNextBuffer( p_buf, &p_buf );\r
                if( !p_buf )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to get IP header buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
                NdisQueryBufferSafe( p_buf, &p_ip_hdr, &buf_len, NormalPagePriority );\r
                if( !p_ip_hdr )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to query IP header buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
@@ -2888,7 +2896,7 @@ __send_mgr_filter_ip(
        if( buf_len < sizeof(ip_hdr_t) )\r
        {\r
                /* This buffer is done for.  Get the next buffer. */\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Buffer too small for IP packet.\n") );\r
                return NDIS_STATUS_BUFFER_TOO_SHORT;\r
        }\r
@@ -2938,14 +2946,14 @@ __send_mgr_filter_udp(
                NdisGetNextBuffer( p_buf, &p_buf );\r
                if( !p_buf )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to get UDP header buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
                NdisQueryBufferSafe( p_buf, &p_udp_hdr, &buf_len, NormalPagePriority );\r
                if( !p_udp_hdr )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to query UDP header buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
@@ -2958,7 +2966,7 @@ __send_mgr_filter_udp(
        /* Get the UDP header and check the destination port numbers. */\r
        if( buf_len < sizeof(udp_hdr_t) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Buffer not large enough for UDP packet.\n") );\r
                return NDIS_STATUS_BUFFER_TOO_SHORT;\r
        }\r
@@ -2983,7 +2991,7 @@ __send_mgr_filter_udp(
                ExAllocateFromNPagedLookasideList( &p_port->buf_mgr.send_buf_list );\r
        if( !p_desc->p_buf )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to query DHCP packet buffer.\n") );\r
                return NDIS_STATUS_RESOURCES;\r
        }\r
@@ -3024,14 +3032,14 @@ __send_mgr_filter_dhcp(
                NdisGetNextBuffer( p_buf, &p_buf );\r
                if( !p_buf )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to get DHCP buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
                NdisQueryBufferSafe( p_buf, &p_dhcp, &buf_len, NormalPagePriority );\r
                if( !p_dhcp )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to query DHCP buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
@@ -3043,7 +3051,7 @@ __send_mgr_filter_dhcp(
 \r
        if( buf_len < DHCP_MIN_SIZE )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Buffer not large enough for DHCP packet.\n") );\r
                return NDIS_STATUS_BUFFER_TOO_SHORT;\r
        }\r
@@ -3100,7 +3108,7 @@ __send_mgr_filter_dhcp(
                                 */\r
                                if( buf_len + 23 - p_cid[1] > sizeof(dhcp_pkt_t) )\r
                                {\r
-                                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                                ("Can't convert CID to IPoIB format.\n") );\r
                                        return IB_INSUFFICIENT_MEMORY;\r
                                }\r
@@ -3127,7 +3135,7 @@ __send_mgr_filter_dhcp(
                         */\r
                        if( buf_len + 23 > sizeof(dhcp_pkt_t) )\r
                        {\r
-                               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                        ("Can't convert CID to IPoIB format.\n") );\r
                                return NDIS_STATUS_RESOURCES;\r
                        }\r
@@ -3158,7 +3166,7 @@ __send_mgr_filter_dhcp(
                break;\r
 \r
        default:\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Invalide message type.\n") );\r
                return NDIS_STATUS_INVALID_DATA;\r
        }\r
@@ -3193,14 +3201,14 @@ __send_mgr_filter_arp(
                NdisGetNextBuffer( p_buf, &p_buf );\r
                if( !p_buf )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to get ARP buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
                NdisQueryBufferSafe( p_buf, &p_arp, &buf_len, NormalPagePriority );\r
                if( !p_arp )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed to get query ARP buffer.\n") );\r
                        return NDIS_STATUS_FAILURE;\r
                }\r
@@ -3213,14 +3221,14 @@ __send_mgr_filter_arp(
        /* Single buffer ARP packet. */\r
        if( buf_len < sizeof(arp_pkt_t) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Buffer too short for ARP.\n") );\r
                return NDIS_STATUS_BUFFER_TOO_SHORT;\r
        }\r
 \r
        if( p_arp->prot_type != ETH_PROT_TYPE_IP )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Unsupported protocol type.\n") );\r
                return NDIS_STATUS_INVALID_DATA;\r
        }\r
@@ -3230,7 +3238,7 @@ __send_mgr_filter_arp(
                ExAllocateFromNPagedLookasideList( &p_port->buf_mgr.send_buf_list );\r
        if( !p_desc->p_buf )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to query ARP packet buffer.\n") );\r
                return NDIS_STATUS_RESOURCES;\r
        }\r
@@ -3253,7 +3261,7 @@ __send_mgr_filter_arp(
                        &p_ib_arp->dst_hw.gid, &p_ib_arp->dst_hw.flags_qpn );\r
                if( status != NDIS_STATUS_SUCCESS )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("Failed lookup of destination HW address\n") );\r
                        return status;\r
                }\r
@@ -3279,9 +3287,9 @@ __send_mgr_get_eth_hdr(
        IN                              NDIS_PACKET* const                      p_packet,\r
                OUT                     NDIS_BUFFER** const                     pp_buf,\r
                OUT                     eth_hdr_t** const                       pp_eth_hdr,\r
-               OUT                     size_t*                                         p_buf_len )\r
+               OUT                     UINT*                                           p_buf_len )\r
 {\r
-       size_t                          tot_len;\r
+       UINT                            tot_len;\r
 \r
        IPOIB_ENTER( IPOIB_DBG_SEND );\r
 \r
@@ -3291,20 +3299,20 @@ __send_mgr_get_eth_hdr(
        if( !*pp_eth_hdr )\r
        {\r
                /* Failed to get first buffer. */\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("NdisMGetFirstBufferSafe failed.\n") );\r
                return NDIS_STATUS_FAILURE;\r
        }\r
 \r
        if( *p_buf_len < sizeof(eth_hdr_t) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("First buffer in packet smaller than eth_hdr_t: %d.\n",\r
                        *p_buf_len) );\r
                return NDIS_STATUS_BUFFER_TOO_SHORT;\r
        }\r
 \r
-       IPOIB_TRACE_EXIT( (IPOIB_DBG_SEND | IPOIB_DBG_INFO),\r
+       IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                ("Ethernet header:\n"\r
                "\tsrc MAC: %02X-%02X-%02X-%02X-%02X-%02X\n"\r
                "\tdst MAC: %02X-%02X-%02X-%02X-%02X-%02X\n"\r
@@ -3336,7 +3344,7 @@ __send_mgr_queue(
        /* Check the send queue and pend the request if not empty. */\r
        if( cl_qlist_count( &p_port->send_mgr.pending_list ) )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_SEND | IPOIB_DBG_WARN,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
                        ("Pending list not empty.\n") );\r
                return NDIS_STATUS_PENDING;\r
        }\r
@@ -3344,7 +3352,7 @@ __send_mgr_queue(
        /* Check the send queue and pend the request if not empty. */\r
        if( p_port->send_mgr.depth == p_port->p_adapter->params.sq_depth )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_SEND | IPOIB_DBG_WARN,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
                        ("No available WQEs.\n") );\r
                return NDIS_STATUS_PENDING;\r
        }\r
@@ -3360,7 +3368,7 @@ __send_mgr_queue(
        {\r
                if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) == IB_SUCCESS )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                                ("Multicast Mac - trying to join.\n") );\r
                        return NDIS_STATUS_PENDING;\r
                }\r
@@ -3393,7 +3401,7 @@ __build_send_desc(
        cl_perf_stop( &p_port->p_adapter->perf, SendMgrFilter );\r
        if( status != NDIS_STATUS_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__send_mgr_filter returned 0x%08X.\n", status) );\r
                return status;\r
        }\r
@@ -3471,7 +3479,7 @@ ipoib_port_send(
        uint32_t                        i;\r
        eth_hdr_t                       *p_eth_hdr;\r
        NDIS_BUFFER                     *p_buf;\r
-       size_t                          buf_len;\r
+       UINT                            buf_len;\r
 \r
        PERF_DECLARE( GetEthHdr );\r
        PERF_DECLARE( BuildSendDesc );\r
@@ -3547,7 +3555,7 @@ ipoib_port_send(
                cl_perf_stop( &p_port->p_adapter->perf, PostSend );\r
                if( ib_status != IB_SUCCESS )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("ib_post_send returned %s\n", \r
                                p_port->p_adapter->p_ifc->get_err_str( ib_status )) );\r
                        cl_perf_start( ProcessFailedSends );\r
@@ -3576,7 +3584,7 @@ ipoib_port_resume(
        ipoib_send_desc_t       desc;\r
        eth_hdr_t                       *p_eth_hdr;\r
        NDIS_BUFFER                     *p_buf;\r
-       size_t                          buf_len;\r
+       UINT                            buf_len;\r
 \r
        PERF_DECLARE( GetEndpt );\r
        PERF_DECLARE( BuildSendDesc );\r
@@ -3594,7 +3602,7 @@ ipoib_port_resume(
                /* Check the send queue and pend the request if not empty. */\r
                if( p_port->send_mgr.depth == p_port->p_adapter->params.sq_depth )\r
                {\r
-                       IPOIB_TRACE_EXIT( IPOIB_DBG_SEND | IPOIB_DBG_WARN,\r
+                       IPOIB_PRINT_EXIT( TRACE_LEVEL_WARNING, IPOIB_DBG_SEND,\r
                                ("No available WQEs.\n") );\r
                        break;\r
                }\r
@@ -3635,7 +3643,7 @@ ipoib_port_resume(
                                if( ipoib_port_join_mcast( p_port, p_eth_hdr->dst ) ==\r
                                        IB_SUCCESS )\r
                                {\r
-                                       IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT,\r
+                                       IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                                                ("Multicast Mac - trying to join.\n") );\r
                                        cl_qlist_insert_head( &p_port->send_mgr.pending_list,\r
                                                IPOIB_LIST_ITEM_FROM_PACKET( desc.p_pkt ) );\r
@@ -3670,7 +3678,7 @@ ipoib_port_resume(
                cl_perf_stop( &p_port->p_adapter->perf, PostSend );\r
                if( ib_status != IB_SUCCESS )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("ib_post_send returned %s\n", \r
                                p_port->p_adapter->p_ifc->get_err_str( ib_status )) );\r
                        cl_perf_start( ProcessFailedSends );\r
@@ -3776,7 +3784,7 @@ __send_cb(
                                break;\r
 \r
                        case IB_WCS_WR_FLUSHED_ERR:\r
-                               IPOIB_TRACE( IPOIB_DBG_RECV | IPOIB_DBG_INFO,\r
+                               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_SEND,\r
                                        ("Flushed send completion.\n") );\r
                                ipoib_inc_send_stat( p_port->p_adapter, IP_STAT_DROPPED, 0 );\r
                                NdisMSendComplete( p_port->p_adapter->h_adapter,\r
@@ -3784,7 +3792,8 @@ __send_cb(
                                break;\r
 \r
                        default:\r
-                               IPOIB_TRACE( IPOIB_DBG_ERROR, ("Send failed with %s\n",\r
+                               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                                       ("Send failed with %s\n",\r
                                        p_port->p_adapter->p_ifc->get_wc_status_str( p_wc->status )) );\r
                                ipoib_inc_send_stat( p_port->p_adapter, IP_STAT_ERROR, 0 );\r
                                NdisMSendComplete( p_port->p_adapter->h_adapter,\r
@@ -4031,7 +4040,8 @@ ipoib_mac_to_gid(
        if( p_item == cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) )\r
        {\r
                cl_obj_unlock( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Failed endpoint lookup.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("Failed endpoint lookup.\n") );\r
                return STATUS_INVALID_PARAMETER;\r
        }\r
 \r
@@ -4062,7 +4072,8 @@ __endpt_mgr_ref(
        if( !cl_memcmp( &mac, &p_port->p_adapter->mac, sizeof(mac) ) )\r
        {\r
                /* Discard loopback traffic. */\r
-               IPOIB_TRACE( IPOIB_DBG_WARN, ("Discarding loopback traffic\n") );\r
+               IPOIB_PRINT(TRACE_LEVEL_WARNING, IPOIB_DBG_ENDPT,\r
+                       ("Discarding loopback traffic\n") );\r
                IPOIB_EXIT( IPOIB_DBG_ENDPT );\r
                return NDIS_STATUS_NO_ROUTE_TO_DESTINATION;\r
        }\r
@@ -4072,7 +4083,7 @@ __endpt_mgr_ref(
 \r
        cl_obj_lock( &p_port->obj );\r
 \r
-       IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
                ("Look for :\t  MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
                mac.addr[0], mac.addr[1], mac.addr[2],\r
                mac.addr[3], mac.addr[4], mac.addr[5]) );\r
@@ -4081,7 +4092,8 @@ __endpt_mgr_ref(
        if( p_item == cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) )\r
        {\r
                cl_obj_unlock( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Failed endpoint lookup.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
+                       ("Failed endpoint lookup.\n") );\r
                return NDIS_STATUS_NO_ROUTE_TO_DESTINATION;\r
        }\r
 \r
@@ -4123,7 +4135,8 @@ __endpt_mgr_get_gid_qpn(
        if( p_item == cl_qmap_end( &p_port->endpt_mgr.mac_endpts ) )\r
        {\r
                cl_obj_unlock( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ENDPT, ("Failed endpoint lookup.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
+                       ("Failed endpoint lookup.\n") );\r
                return NDIS_STATUS_FAILURE;\r
        }\r
 \r
@@ -4189,7 +4202,7 @@ __endpt_mgr_insert_locked(
 {\r
        IPOIB_ENTER( IPOIB_DBG_ENDPT );\r
 \r
-       IPOIB_TRACE( (IPOIB_DBG_ENDPT | IPOIB_DBG_INFO),\r
+       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_ENDPT,\r
                ("insert  :\t  MAC: %02X-%02X-%02X-%02X-%02X-%02X\n",\r
                mac.addr[0], mac.addr[1], mac.addr[2],\r
                mac.addr[3], mac.addr[4], mac.addr[5]) );\r
@@ -4271,7 +4284,7 @@ __endpt_mgr_add_bcast(
                p_mcast_rec->p_member_rec->mlid, CL_HTON32(0x00FFFFFF) );\r
        if( !p_endpt )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_endpt_create failed.\n") );\r
                return IB_INSUFFICIENT_RESOURCES;\r
        }\r
@@ -4281,7 +4294,7 @@ __endpt_mgr_add_bcast(
                p_port->port_num, p_mcast_rec );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ipoib_create_mcast_endpt returned %s\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -4452,7 +4465,7 @@ ipoib_port_up(
        {\r
                p_port->p_adapter->hung = TRUE;\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_query returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return;\r
@@ -4480,7 +4493,7 @@ __endpt_mgr_add_local(
        if( !p_endpt )\r
        {\r
                p_port->p_adapter->hung = TRUE;\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Failed to create local endpt\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
@@ -4496,7 +4509,7 @@ __endpt_mgr_add_local(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_destroy( &p_endpt->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_create_av for local endpoint returned %s\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -4537,7 +4550,7 @@ __port_info_cb(
                status = __endpt_mgr_add_local( p_port, &p_port_rec->port_info );\r
                if( status == IB_SUCCESS )\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_INFO,\r
+                       IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                                ("Received port info: link width = %d.\n",\r
                                p_port_rec->port_info.link_width_active) );\r
 \r
@@ -4552,28 +4565,30 @@ __port_info_cb(
                }\r
                else\r
                {\r
-                       IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+                       IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                                ("__endpt_mgr_add_local returned %s\n",\r
                                p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                }\r
                break;\r
 \r
        case IB_CANCELED:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT,\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Instance destroying - Aborting.\n") );\r
                break;\r
 \r
        case IB_TIMEOUT:\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_PORT_INFO_TIMEOUT, 0 );\r
-               IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query timed out.\n") );\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                       ("Port info query timed out.\n") );\r
                ipoib_set_inactive( p_port->p_adapter );\r
                break;\r
 \r
        case IB_REMOTE_ERROR:\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_PORT_INFO_REJECT, 0 );\r
-               IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query rejected by SA.\n") );\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                       ("Port info query rejected by SA.\n") );\r
                ipoib_set_inactive( p_port->p_adapter );\r
                break;\r
 \r
@@ -4581,7 +4596,8 @@ __port_info_cb(
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_QUERY_PORT_INFO, 1, p_query_rec->status );\r
                /* Hopefully we'll get an SM change event that will restart things. */\r
-               IPOIB_TRACE( IPOIB_DBG_INFO, ("Port info query failed.\n") );\r
+               IPOIB_PRINT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                       ("Port info query failed.\n") );\r
                ipoib_set_inactive( p_port->p_adapter );\r
        }\r
 \r
@@ -4634,7 +4650,7 @@ __port_get_mcast(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_query returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return;\r
@@ -4709,7 +4725,8 @@ __bcast_get_cb(
                break;\r
 \r
        case IB_CANCELED:\r
-               IPOIB_TRACE( IPOIB_DBG_INIT, ("Instance destroying - Aborting.\n") );\r
+               IPOIB_PRINT(TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
+                       ("Instance destroying - Aborting.\n") );\r
        \r
        default:\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
@@ -4745,7 +4762,7 @@ __port_join_bcast(
                 * The MC group rate is higher than our port's rate.  Log an error\r
                 * and stop.  A port transition will drive the retry.\r
                 */\r
-               IPOIB_TRACE( IPOIB_DBG_WARN,\r
+               IPOIB_PRINT(TRACE_LEVEL_WARNING, IPOIB_DBG_MCAST,\r
                        ("Unrealizable join due to rate mismatch.\n") );\r
                NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter,\r
                        EVENT_IPOIB_BCAST_RATE, 2,\r
@@ -4773,7 +4790,7 @@ __port_join_bcast(
        if( ib_member_get_state( mcast_req.member_rec.scope_state ) !=\r
                IB_MC_REC_STATE_FULL_MEMBER )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_WARN,\r
+               IPOIB_PRINT(TRACE_LEVEL_WARNING, IPOIB_DBG_MCAST,\r
                        ("Incorrect MC member rec join state in query response.\n") );\r
                ib_member_set_state( &mcast_req.member_rec.scope_state,\r
                        IB_MC_REC_STATE_FULL_MEMBER );\r
@@ -4786,7 +4803,7 @@ __port_join_bcast(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_join_mcast returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return;\r
@@ -4853,7 +4870,7 @@ __port_create_bcast(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_join_mcast returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
        }\r
@@ -4894,7 +4911,7 @@ ipoib_port_down(
        status = p_port->p_adapter->p_ifc->modify_qp( p_port->ib_mgr.h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_modify_qp to error state returned %s.\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                p_port->p_adapter->hung = TRUE;\r
@@ -4924,7 +4941,7 @@ __bcast_cb(
        {\r
                cl_obj_unlock( &p_port->obj );\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_INIT,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Instance destroying - Aborting.\n") );\r
                return;\r
        }\r
@@ -4932,7 +4949,7 @@ __bcast_cb(
 \r
        if( p_mcast_rec->status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Multicast join for broadcast group returned %s.\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( p_mcast_rec->status )) );\r
                if( p_mcast_rec->status == IB_REMOTE_ERROR )\r
@@ -4969,7 +4986,7 @@ __bcast_cb(
        status = __endpt_mgr_add_bcast( p_port, p_mcast_rec );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__endpt_mgr_add_bcast returned %s\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                status = p_port->p_adapter->p_ifc->leave_mcast( p_mcast_rec->h_mcast, NULL );\r
@@ -4985,7 +5002,7 @@ __bcast_cb(
        status = __ib_mgr_activate( p_port );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("__ib_mgr_activate returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                /* Flag the adapter as hung. */\r
@@ -5044,7 +5061,7 @@ __ib_mgr_activate(
        status = p_port->p_adapter->p_ifc->modify_qp( p_port->ib_mgr.h_qp, &qp_mod );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_modify_qp returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -5057,7 +5074,7 @@ __ib_mgr_activate(
        status = p_port->p_adapter->p_ifc->init_dgrm_svc( p_port->ib_mgr.h_qp, &dgrm_info );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_init_dgrm_svc returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -5067,7 +5084,7 @@ __ib_mgr_activate(
        status = p_port->p_adapter->p_ifc->rearm_cq( p_port->ib_mgr.h_recv_cq, FALSE );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_rearm_cq for recv returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -5075,7 +5092,7 @@ __ib_mgr_activate(
        status = p_port->p_adapter->p_ifc->rearm_cq( p_port->ib_mgr.h_send_cq, FALSE );\r
        if( status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_rearm_cq for send returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                return status;\r
@@ -5171,7 +5188,8 @@ ipoib_port_join_mcast(
                &mcast_req.member_rec.mgid, 0, CL_HTON32(0x00FFFFFF) );\r
        if( !p_endpt )\r
        {\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_ERROR, ("ipoib_endpt_create failed.\n") );\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
+                       ("ipoib_endpt_create failed.\n") );\r
                return IB_INSUFFICIENT_MEMORY;\r
        }\r
 \r
@@ -5184,7 +5202,7 @@ ipoib_port_join_mcast(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("ib_join_mcast returned %s\n", \r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
        }\r
@@ -5213,7 +5231,7 @@ __mcast_cb(
        {\r
                cl_obj_unlock( &p_port->obj );\r
                cl_obj_deref( &p_port->obj );\r
-               IPOIB_TRACE_EXIT( IPOIB_DBG_INIT,\r
+               IPOIB_PRINT_EXIT( TRACE_LEVEL_INFORMATION, IPOIB_DBG_INIT,\r
                        ("Instance destroying - Aborting.\n") );\r
                return;\r
        }\r
@@ -5221,7 +5239,7 @@ __mcast_cb(
 \r
        if( p_mcast_rec->status != IB_SUCCESS )\r
        {\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR,\r
                        ("Multicast join request failed with status %s.\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( p_mcast_rec->status )) );\r
                ipoib_set_inactive( p_port->p_adapter );\r
@@ -5241,7 +5259,7 @@ __mcast_cb(
                 * is not an error.\r
                 */\r
                cl_obj_unlock( &p_port->obj );\r
-               IPOIB_TRACE( IPOIB_DBG_MCAST,\r
+               IPOIB_PRINT(TRACE_LEVEL_WARNING, IPOIB_DBG_ERROR,\r
                        ("Failed to find endpoint for update.\n") );\r
                p_port->p_adapter->p_ifc->leave_mcast( p_mcast_rec->h_mcast, NULL );\r
                cl_obj_deref( &p_port->obj );\r
@@ -5258,7 +5276,7 @@ __mcast_cb(
        if( status != IB_SUCCESS )\r
        {\r
                cl_obj_unlock( &p_port->obj );\r
-               IPOIB_TRACE( IPOIB_DBG_ERROR,\r
+               IPOIB_PRINT( TRACE_LEVEL_ERROR, IPOIB_DBG_MCAST,\r
                        ("ipoib_endpt_set_mcast returned %s.\n",\r
                        p_port->p_adapter->p_ifc->get_err_str( status )) );\r
                /* Flag the adapter as hung. */\r
index 817b550..af6cb69 100644 (file)
@@ -135,7 +135,8 @@ LoadOrderGroup  = NDIS
 AddReg          = Ipoib.ParamsReg\r
 \r
 [Ipoib.ParamsReg]\r
-HKR,"Parameters","DebugFlags",%REG_DWORD_NO_CLOBBER%,0x80000000\r
+HKR,"Parameters","DebugLevel",%REG_DWORD_NO_CLOBBER%,0x00000002\r
+HKR,"Parameters","DebugFlags",%REG_DWORD_NO_CLOBBER%,0x00000fff\r
 \r
 [IpoibEventLog]\r
 AddReg = IpoibAddEventLogReg\r