[Openib-windows] [PATCH] srp WPP support

Yossi Leybovich sleybo at mellanox.co.il
Mon Sep 4 06:48:11 PDT 2006


Fab 
Attach  patch that add WPP support to the SRP code.
I compiled it on x86 free/chk and amd64 free
I also tested it on x86 chk.
NOTE: the patch include the fix to the blue screen problem you sent me
yesterday
 
10x
Yossi 
 


Index: kernel/ib_srp.inf
===================================================================
--- kernel/ib_srp.inf	(revision 1647)
+++ kernel/ib_srp.inf	(working copy)
@@ -103,6 +103,8 @@
 [SRP.ParamsReg]
 HKR,"Parameters\PnpInterface",%InternalBus%,%REG_DWORD%,1
 HKR,"Parameters\PnpInterface",%PNPBus%,%REG_DWORD%,1
+HKR,"Parameters","DebugLevel",%REG_DWORD%,2
+HKR,"Parameters","DebugFlags",%REG_DWORD%,0x00ffffff
 
 ;
 ; == The NT EventLog entries are the same for all SCSI miniports. ==
Index: kernel/srp_connection.c
===================================================================
--- kernel/srp_connection.c	(revision 1647)
+++ kernel/srp_connection.c	(working copy)
@@ -82,7 +82,7 @@
 
&p_srp_connection->h_send_cq );
 	if( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Create Send Completion Queue. Status =
%d\n", status) );
 		goto exit;
 	}
@@ -99,7 +99,7 @@
 
&p_srp_connection->h_recv_cq );
 	if( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Create Receive Completion Queue. Status
= %d\n", status) );
 	}
 
@@ -151,7 +151,7 @@
 
&p_srp_connection->h_qp );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Create Queue Pair. Status = %d\n",
status) );
 	}
 
@@ -175,7 +175,7 @@
 	p_connection->p_wc_array = cl_zalloc( sizeof( ib_wc_t ) *
completion_count );
 	if ( p_connection->p_wc_array == NULL )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to allocate %d work completions.\n",
completion_count) );
 		status = CL_INSUFFICIENT_MEMORY;
 		goto exit;
@@ -282,7 +282,7 @@
 
 	SRP_ENTER( SRP_DBG_PNP );
 
-	SRP_TRACE( SRP_DBG_DEBUG,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 		("Target has issued a disconnect request.\n") );
 
 	if ( p_hba->adapter_paused == FALSE )
@@ -294,7 +294,7 @@
 
SP_UNTAGGED,
 
SP_UNTAGGED,
 
SRB_STATUS_BUSY );
-		SRP_TRACE( SRP_DBG_DEBUG, ("Pausing Adapter for %s.\n",
p_hba->ioc_info.profile.id_string) );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("Pausing Adapter for %s.\n", p_hba->ioc_info.profile.id_string) );
 	}
 
 	cl_obj_lock( &p_srp_session->obj );
@@ -307,7 +307,7 @@
 	status = p_hba->ifc.cm_drep( p_cm_dreq_rec->h_cm_dreq, &cm_drep
);
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot respond to target disconnect request.
Status = %d\n", status) );
 	}
 
@@ -324,19 +324,19 @@
 
 	cl_obj_unlock( &p_hba->obj );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Session Object ref_cnt = %d\n",
p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 	cl_obj_destroy( &p_srp_session->obj );
 
 	do
 	{
 		retry_count++;
 
-		SRP_TRACE( SRP_DBG_DEBUG,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 			("Attempting to reconnect %s. Connection Attempt
Count = %d.\n",
 			 p_hba->ioc_info.profile.id_string,
 			 retry_count) );
 
-		SRP_TRACE( SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			("Creating New Session For Service Entry Index
%d.\n", p_hba->ioc_info.profile.num_svc_entries));
 		p_srp_session = srp_new_session( p_hba,
 
p_hba->ioc_info.profile.ioc_guid,
@@ -348,9 +348,9 @@
 			break;
 		}
 
-		SRP_TRACE( SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			("New Session For Service Entry Index %d
Created.\n", p_hba->ioc_info.profile.num_svc_entries));
-		SRP_TRACE( SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			("Logging Into Session.\n"));
 		status = srp_session_login( p_srp_session );
 		if ( status == IB_SUCCESS )
@@ -372,21 +372,21 @@
 			p_hba->session_list[i] = p_srp_session;
 			cl_obj_unlock( &p_hba->obj );
 
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				("Session Login Issued
Successfully.\n"));
 		}
 		else
 		{
-			SRP_TRACE( SRP_DBG_ERROR,
+			SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 				("Session Login Failure Status = %d.\n",
status));
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 			cl_obj_destroy( &p_srp_session->obj );
 		}
 	} while ( (status != IB_SUCCESS) && (retry_count < 3) );
 
 	if ( status == IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("Resuming Adapter for %s.\n",
p_hba->ioc_info.profile.id_string) );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("Resuming Adapter for %s.\n", p_hba->ioc_info.profile.id_string) );
 		p_hba->adapter_paused = FALSE;
 		StorPortReady( p_hba->p_ext );
 //		StorPortNotification( BusChangeDetected, p_hba->p_ext, 0
);
@@ -452,10 +452,10 @@
 	}
 	else /*	not reported any descriptor format */
 	{
-		SRP_TRACE( SRP_DBG_DEBUG,(" Target does not support
valid descriptor formats\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,("
Target does not support valid descriptor formats\n") );
 		goto rej;
 	}
-	SRP_TRACE( SRP_DBG_DEBUG,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 			("Request Limit = %d, SendQ Depth = %d,
RecvQDepth = %d, ItoT size = %d, TtoI size = %d, Max S/G = %d\n",
 			p_connection->request_limit,
 			p_connection->send_queue_depth,
@@ -471,7 +471,7 @@
 	status = p_ifc->cm_mra( p_cm_reply->h_cm_rep, &u.cm_mra );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Send MRA. Status = %d\n", status) );
 		goto rej;
 	}
@@ -479,14 +479,14 @@
 	status = p_ifc->modify_cq( p_connection->h_send_cq,
&p_connection->send_queue_depth );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_WARN,
+		SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_PNP,
 			("Cannot Modify Send Completion Queue Depth.
Status = %d\n", status) );
 	}
 
 	status = p_ifc->modify_cq( p_connection->h_recv_cq,
&p_connection->recv_queue_depth );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_WARN,
+		SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_PNP,
 			("Cannot Modify Recv Completion Queue Depth.
Status = %d\n", status) );
 	}
 
@@ -529,7 +529,7 @@
 	status = p_ifc->cm_rtu( p_cm_reply->h_cm_rep, &u.cm_rtu );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Send RTU. Status = %d\n", status) );
 		p_connection->state = SRP_CONNECT_FAILURE;
 		goto exit;
@@ -540,7 +540,7 @@
 	status = p_ifc->rearm_cq( p_connection->h_send_cq, FALSE );
 	if ( status != IB_SUCCESS)
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("ib_rearm_cq() for send cq failed!, status
0x%x", status) );
 
 		// TODO: Kill session and inform port driver link down
storportnotification
@@ -550,7 +550,7 @@
 	status = p_ifc->rearm_cq( p_connection->h_recv_cq, FALSE );
 	if ( status != IB_SUCCESS)
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("ib_rearm_cq() for recv failed!, status 0x%x",
status) );
 
 		// TODO: Kill session and inform port driver link down
storportnotification
@@ -593,16 +593,16 @@
 		set_srp_login_reject_from_network_to_host(
p_srp_login_rej ); // <-- Is this coming back NULL?
 		p_connection->reject_reason =
get_srp_login_reject_reason( p_srp_login_rej );
 
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Login Rejected. IBT Code = 0x%x, SRP Code =
0x%x\n",
 			p_cm_reject->rej_status,
p_connection->reject_reason ) );
 		switch( p_connection->reject_reason )
 		{
 			case LIREJ_INIT_TO_TARG_IU_LENGTH_TOO_LARGE:
-				SRP_TRACE( SRP_DBG_ERROR, ("REQUESTED
IU_SIZE %d\n", p_connection->req_max_iu_msg_size ));
+
SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR, ("REQUESTED IU_SIZE %d\n",
p_connection->req_max_iu_msg_size ));
 				break;
 			case
LIREJ_UNSUPPORTED_DATA_BUFFER_DESCRIPTOR_FORMAT:
-				SRP_TRACE( SRP_DBG_ERROR, ("REQUESTED
DESC FORMAT: %#x, SUPPORTED FORMAT %#x\n",
+
SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR, ("REQUESTED DESC FORMAT: %#x,
SUPPORTED FORMAT %#x\n",
 					p_connection->descriptor_format,

 
get_srp_login_reject_supported_data_buffer_formats(p_srp_login_rej) ));
 					__srp_issue_session_login(
p_connection, (srp_hca_t *)&p_srp_session->hca,
p_connection->ioc_max_send_msg_depth );
@@ -613,7 +613,7 @@
 	}
 	else
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Login Rejected. IBT Code = 0x%x\n",
 			p_cm_reject->rej_status) );
 }
@@ -701,7 +701,7 @@
 
 	cm_req.remote_resp_timeout = 15;
 	cm_req.flow_ctrl = FALSE;
-	cm_req.local_resp_timeout = 16;
+	cm_req.local_resp_timeout = 15;
 	cm_req.retry_cnt = 1;
 	cm_req.rnr_nak_timeout = 0; /* 655.36 ms */
 	cm_req.rnr_retry_cnt = 6;
@@ -720,7 +720,7 @@
 	}
 	else
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Send Connect Request. Status = %d\n",
status) );
 		p_connection->state = SRP_CONNECT_FAILURE;
 	}
@@ -815,7 +815,7 @@
 	cl_status = cl_event_init( &p_connection->conn_req_event, TRUE
);
 	if ( cl_status != CL_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Initialize Connect Request Event.
Status = %d\n", cl_status) );
 		status = cl_status;
 		goto exit;
@@ -831,7 +831,7 @@
 	cl_status = cl_event_wait_on( &p_connection->conn_req_event,
EVENT_NO_TIMEOUT, FALSE );
 	if ( cl_status != CL_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Wait On Connect Request Event Failed. Status =
%d\n", cl_status) );
 		status = cl_status;
 		cl_event_destroy( &p_connection->conn_req_event );
Index: kernel/srp_data_path.c
===================================================================
--- kernel/srp_data_path.c	(revision 1647)
+++ kernel/srp_data_path.c	(working copy)
@@ -62,14 +62,14 @@
 	ib_wc_t         *p_wc_done_list = NULL;
 	ib_wc_t         *p_wc;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_obj_lock( &p_session->obj );
 
 	if ( p_session->connection.state != SRP_CONNECTED )
 	{
 		cl_obj_unlock( &p_session->obj );
-		SRP_EXIT( SRP_DBG_FUNC );
+		SRP_EXIT( SRP_DBG_DEBUG );
 		return;
 	}
 
@@ -79,7 +79,7 @@
 		&p_wc_done_list );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("ib_poll_cq() failed!, status 0x%x\n", status)
);
 
 		// TODO: Kill session and inform port driver link down
scsiportnotification
@@ -103,10 +103,12 @@
 			p_send_descriptor = (srp_send_descriptor_t
*)((uintn_t)p_wc->wr_id);
 
 			// TODO: Kill session and inform port driver
link down scsiportnotification
-			SRP_TRACE( SRP_DBG_ERROR,
-				("Send failed!, status 0x%x\n",
p_wc->status) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_ERROR,
+					   ("Send Completion Status %s
Vendore Status = 0x%x, \n",
+
p_session->p_hba->ifc.get_wc_status_str( p_wc->status ),
+					   p_wc->vendor_specific));
 
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_ERROR,
 					   ("Send Completion Received
for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x, tag
0x%"PRIx64"\n",
 
g_srb_function_name[p_send_descriptor->p_srb->Function],
 
p_send_descriptor->p_srb->Function,
@@ -114,6 +116,7 @@
 
p_send_descriptor->p_srb->TargetId,
 
p_send_descriptor->p_srb->Lun,
 					   get_srp_command_tag(
(srp_cmd_t *)p_send_descriptor->data_segment )) );
+
 		}
 
 		/* Put onto head of free list */
@@ -131,7 +134,7 @@
 		p_session->connection.h_send_cq, FALSE );
 	if ( status != IB_SUCCESS)
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("ib_rearm_cq() failed!, status 0x%x\n", status)
);
 
 		// TODO: Kill session and inform port driver link down
scsiportnotification
@@ -139,7 +142,7 @@
 
 	cl_obj_deref( &p_session->obj );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 /* srp_send_completion_cb */
@@ -157,13 +160,13 @@
 {
 	srp_session_t	*p_session = (srp_session_t *)p_context;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	UNUSED_PARAM( h_cq );
 
 	__srp_process_session_send_completions( p_session );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 static inline
@@ -177,7 +180,7 @@
 	uint8_t                 response_status;
 	srp_send_descriptor_t   *p_send_descriptor;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	p_srp_rsp = (srp_rsp_t *)p_recv_descriptor->p_data_segment;
 
@@ -195,19 +198,19 @@
 			p_session->connection.h_qp,
&p_recv_descriptor->wr, NULL );
 		if ( status != IB_SUCCESS )
 		{
-			SRP_TRACE( SRP_DBG_ERROR,
+			SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 				("Failed to post send descriptor. Status
= %d.\n", status) );
 			// TODO: Kill session and inform port driver
link down scsiportnotification
 		}
 
 		cl_atomic_add( &p_session->connection.request_limit,
get_srp_response_request_limit_delta( p_srp_rsp ) );
 
-		SRP_TRACE( SRP_DBG_WARN, ("Matching Send Descriptor Not
Found.\n") );
+		SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG, ("Matching
Send Descriptor Not Found.\n") );
 
 		goto exit;
 	}
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			   ("Recv Completion Received for Function =
%s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x, tag 0x%"PRIx64"\n",
 
g_srb_function_name[p_send_descriptor->p_srb->Function],
 			   p_send_descriptor->p_srb->Function,
@@ -234,24 +237,24 @@
 					p_session->connection.h_qp,
&p_recv_descriptor->wr, NULL );
 				if ( status != IB_SUCCESS )
 				{
-					SRP_TRACE( SRP_DBG_ERROR,
+
SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 						("Failed to post recv
descriptor. Status = %d.\n", status) );
 					// TODO: Kill session and inform
port driver link down storportnotification
 				}
 
 				cl_atomic_add(
&p_session->connection.request_limit,
get_srp_response_request_limit_delta( p_srp_rsp ) );
 
-				SRP_TRACE( SRP_DBG_VERBOSE,
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 						   ("Srb Status =
%s(0x%x)\n",
 
g_srb_status_name[p_send_descriptor->p_srb->SrbStatus],
 
p_send_descriptor->p_srb->SrbStatus) );
 
-				SRP_TRACE( SRP_DBG_VERBOSE, ("Device
Extension Address = %p\n", p_session->p_hba->p_ext) );
-				SRP_TRACE( SRP_DBG_VERBOSE, ("Srb
Address              = %p\n", p_send_descriptor->p_srb) );
-				SRP_TRACE( SRP_DBG_VERBOSE, ("Srb
DataBuffer Address   = %p\n", p_send_descriptor->p_srb->DataBuffer) );
-				SRP_TRACE( SRP_DBG_VERBOSE, ("Srb
DataTransferLength   = %d\n",
p_send_descriptor->p_srb->DataTransferLength) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Device Extension Address
= %p\n", p_session->p_hba->p_ext) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Srb Address
= %p\n", p_send_descriptor->p_srb) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Srb DataBuffer Address
= %p\n", p_send_descriptor->p_srb->DataBuffer) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Srb DataTransferLength
= %d\n", p_send_descriptor->p_srb->DataTransferLength) );
 
-				SRP_TRACE( SRP_DBG_VERBOSE,
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 						   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x, tag 0x%"PRIx64"\n",
 
g_srb_status_name[p_send_descriptor->p_srb->SrbStatus],
 
p_send_descriptor->p_srb->SrbStatus,
@@ -280,7 +283,7 @@
 				{
 					resid =
get_srp_response_data_in_residual_count( p_srp_rsp );
 
-					SRP_TRACE( SRP_DBG_WARN,
+
SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG,
 						("DI Underflow in
response: expected %d got %d.\n",
 
p_send_descriptor->p_srb->DataTransferLength,
 
p_send_descriptor->p_srb->DataTransferLength - resid) );
@@ -297,7 +300,7 @@
 				{
 					resid =
get_srp_response_data_out_residual_count( p_srp_rsp );
 
-					SRP_TRACE( SRP_DBG_WARN,
+
SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG,
 						("DI Underflow in
response: expected %d got %d.\n",
 
p_send_descriptor->p_srb->DataTransferLength,
 
p_send_descriptor->p_srb->DataTransferLength - resid) );
@@ -327,7 +330,7 @@
 					{
 						/* probably a problem
with the Vfx FC san like wire pull*/
 						/* initiate session
recovery */
-						SRP_TRACE( SRP_DBG_WARN,
+
SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG,
 							("Sense Data
indicates FC link connectivity has been lost.\n") );
 						StorPortPauseDevice(
p_session->p_hba->p_ext,
 
p_send_descriptor->p_srb->PathId,
@@ -339,7 +342,7 @@
 
 				if ( get_srp_response_di_over( p_srp_rsp
) || get_srp_response_do_over( p_srp_rsp ) )
 				{
-					SRP_TRACE( SRP_DBG_WARN,
+
SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG,
 						("Overflow error in
response.\n") );
 					if (
p_send_descriptor->p_srb->SrbStatus == SRB_STATUS_SUCCESS )
 					{
@@ -348,7 +351,7 @@
 				}
 			}
 
-			SRP_TRACE( SRP_DBG_VERBOSE, ("DataBuffer =
0x%"PRIx64".\n",
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("DataBuffer = 0x%"PRIx64".\n",
 
MmGetPhysicalAddress( p_send_descriptor->p_srb->DataBuffer ).QuadPart)
);
 
 			/* Repost the recv descriptor */
@@ -356,24 +359,24 @@
 				p_session->connection.h_qp,
&p_recv_descriptor->wr, NULL );
 			if ( status != IB_SUCCESS )
 			{
-				SRP_TRACE( SRP_DBG_ERROR,
+
SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 					("Failed to post recv
descriptor. Status = %d.\n", status) );
 				// TODO: Kill session and inform port
driver link down storportnotification
 			}
 
 			cl_atomic_add(
&p_session->connection.request_limit,
get_srp_response_request_limit_delta( p_srp_rsp ) );
 
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 					   ("Srb Status = %s(0x%x)\n",
 
g_srb_status_name[p_send_descriptor->p_srb->SrbStatus],
 
p_send_descriptor->p_srb->SrbStatus) );
 
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Device Extension
Address = %p\n", p_session->p_hba->p_ext) );
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Srb Address
= %p\n", p_send_descriptor->p_srb) );
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Srb DataBuffer
Address   = %p\n", p_send_descriptor->p_srb->DataBuffer) );
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Srb
DataTransferLength   = %d\n",
p_send_descriptor->p_srb->DataTransferLength) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Device Extension Address = %p\n", p_session->p_hba->p_ext) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Srb Address              = %p\n", p_send_descriptor->p_srb) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Srb DataBuffer Address   = %p\n",
p_send_descriptor->p_srb->DataBuffer) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Srb DataTransferLength   = %d\n",
p_send_descriptor->p_srb->DataTransferLength) );
 
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 					   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x, tag 0x%"PRIx64"\n",
 
g_srb_status_name[p_send_descriptor->p_srb->SrbStatus],
 
p_send_descriptor->p_srb->SrbStatus,
@@ -397,7 +400,7 @@
 	}
 
 exit:
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 
 	return ( status );
 }
@@ -411,14 +414,14 @@
 	ib_wc_t         *p_wc_done_list;
 	ib_wc_t         *p_wc;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_obj_lock( &p_session->obj );
 
 	if ( p_session->connection.state != SRP_CONNECTED )
 	{
 		cl_obj_unlock( &p_session->obj );
-		SRP_EXIT( SRP_DBG_FUNC );
+		SRP_EXIT( SRP_DBG_DEBUG );
 		return;
 	}
 
@@ -428,11 +431,11 @@
 		&p_wc_done_list );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("ib_poll_cq() failed!, status 0x%x\n", status)
);
 
 		// TODO: Kill session and inform port driver link down
scsiportnotification
-		SRP_EXIT( SRP_DBG_FUNC );
+		SRP_EXIT( SRP_DBG_DEBUG );
 		cl_obj_unlock( &p_session->obj );
 		return;
 	}
@@ -460,9 +463,10 @@
 		}
 		else
 		{
-			SRP_TRACE( SRP_DBG_ERROR,
-				("Recv failed!, status 0x%x\n",
p_wc->status) );
-		}
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_ERROR,
+					   ("Send Completion Status %s
Vendore Status = 0x%x, \n",
+
p_session->p_hba->ifc.get_wc_status_str( p_wc->status ),
+					   p_wc->vendor_specific));}
 
 		/* Put onto head of free list */
 		cl_obj_lock( &p_session->obj );
@@ -479,7 +483,7 @@
 		p_session->connection.h_recv_cq, FALSE );
 	if ( status != IB_SUCCESS)
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("ib_rearm_cq() failed!, status 0x%x\n", status)
);
 
 		// TODO: Kill session and inform port driver link down
scsiportnotification
@@ -487,7 +491,7 @@
 
 	cl_obj_deref( &p_session->obj );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 /* srp_recv_completion_cb */
@@ -505,13 +509,13 @@
 {
 	srp_session_t	*p_session = (srp_session_t *)p_context;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	UNUSED_PARAM( h_cq );
 
 	__srp_process_session_recv_completions( p_session );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 /* __srp_build_cmd */
@@ -541,9 +545,9 @@
 	ULONG                           scsi_direction = p_srb->SrbFlags
& ( SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT );
 	DATA_BUFFER_DESCRIPTOR_FORMAT   format =
p_srp_conn_info->descriptor_format &
DBDF_INDIRECT_DATA_BUFFER_DESCRIPTORS;
 	ULONG							length;
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			   ("Sending I/O to Path = 0x%x, Target = 0x%x,
Lun = 0x%x\n",
 			   p_srb->PathId,
 			   p_srb->TargetId,
@@ -562,13 +566,13 @@
 	p_cdb = get_srp_command_cdb( p_srp_cmd );
 	cl_memcpy( p_cdb, p_srb->Cdb, p_srb->CdbLength );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("CDB Length = %d.\n",
p_srb->CdbLength) );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("CDB = 0x") );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("CDB Length =
%d.\n", p_srb->CdbLength) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("CDB = 0x") );
 	for ( i = 0; i < p_srb->CdbLength; i++ )
 	{
-		SRP_TRACE( SRP_DBG_VERBOSE, ("%0.2x", p_srb->Cdb[i]) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("%0.2x",
p_srb->Cdb[i]) );
 	}
-	SRP_TRACE( SRP_DBG_VERBOSE, ("\n.") );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("\n.") );
 	
 	if ( !format )
 	{
@@ -648,19 +652,19 @@
 				p_memory_descriptor->memory_handle   =
p_srp_conn_info->rkey;
 				p_memory_descriptor->data_length     =
cl_hton32( p_sg_element->Length );
 
-				SRP_TRACE( SRP_DBG_VERBOSE,
("virtual_address[%d] = 0x%"PRIx64".\n", i,
cl_ntoh64(p_memory_descriptor->virtual_address) ) );
-				SRP_TRACE( SRP_DBG_VERBOSE,
("memory_handle[%d]   = 0x%x.\n", i, cl_ntoh32(
p_memory_descriptor->memory_handle) ) );
-				SRP_TRACE( SRP_DBG_VERBOSE,
("data_length[%d]     = %d.\n", i, cl_ntoh32(
p_memory_descriptor->data_length) ) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("virtual_address[%d] =
0x%"PRIx64".\n", i, cl_ntoh64(p_memory_descriptor->virtual_address) ) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("memory_handle[%d]   =
0x%x.\n", i, cl_ntoh32( p_memory_descriptor->memory_handle) ) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("data_length[%d]     =
%d.\n", i, cl_ntoh32( p_memory_descriptor->data_length) ) );
 			}
 		}
-		SRP_TRACE( SRP_DBG_VERBOSE, ("scatter/gather count =
%d.\n", scatter_gather_count));
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("scatter/gather count = %d.\n", scatter_gather_count));
 	}
 
 	p_srp_cmd->logical_unit_number = cl_hton64(
p_srp_cmd->logical_unit_number );
 
 	//set_srp_command_from_host_to_network( p_srp_cmd );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 /* srp_format_io_request */
@@ -681,12 +685,12 @@
 	BOOLEAN         result = TRUE;
 	srp_session_t   *p_srp_session;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Device Extension Address = %p\n",
p_dev_ext) );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Srb Address              = %p\n",
p_srb) );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Srb DataBuffer Address   = %p\n",
p_srb->DataBuffer) );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Srb DataTransferLength   = %d\n",
p_srb->DataTransferLength) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Device Extension
Address = %p\n", p_dev_ext) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Srb Address
= %p\n", p_srb) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Srb DataBuffer
Address   = %p\n", p_srb->DataBuffer) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Srb
DataTransferLength   = %d\n", p_srb->DataTransferLength) );
 
 	cl_obj_lock( &p_hba->obj );
 
@@ -718,14 +722,14 @@
 	else
 	{
 		// Handle the error case here
-		SRP_TRACE( SRP_DBG_ERROR, ("Cannot Find Session For
Target ID = %d\n", p_srb->TargetId) );
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR, ("Cannot Find
Session For Target ID = %d\n", p_srb->TargetId) );
 		cl_obj_unlock( &p_hba->obj );
 		p_srb->SrbStatus = SRB_STATUS_INVALID_TARGET_ID;
 		result = FALSE;
 	}
 
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 	return ( result );
 }
 
@@ -739,7 +743,7 @@
 	srp_send_descriptor_t	*p_send_descriptor =
(srp_send_descriptor_t *)p_srb->SrbExtension;
 	srp_session_t           *p_srp_session;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_obj_lock( &p_hba->obj );
 
@@ -760,7 +764,7 @@
 
 			if ( p_srp_session->connection.request_limit < 3
)
 			{
-				SRP_TRACE( SRP_DBG_WARN, ("Calling
StorPortBusy.\n") );
+
SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG, ("Calling StorPortBusy.\n")
);
 				StorPortBusy( p_dev_ext, 1 );
 			}
 
@@ -776,7 +780,7 @@
 	}
 
 	p_srb->SrbStatus = SRB_STATUS_NO_HBA;
-	SRP_TRACE( SRP_DBG_ERROR,
+	SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			   ("Returning SrbStatus %s(0x%x) for Function =
%s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x, tag 0x%"PRIx64"\n",
 			   g_srb_status_name[p_srb->SrbStatus],
 			   p_srb->SrbStatus,
@@ -789,7 +793,7 @@
 	StorPortNotification( RequestComplete, p_dev_ext, p_srb );
 
 exit:
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 void
@@ -805,7 +809,7 @@
 	srp_conn_info_t         srp_conn_info;
 	srp_tsk_mgmt_t          *p_srp_tsk_mgmt;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_obj_lock( &p_hba->obj );
 
@@ -863,7 +867,7 @@
 	cl_obj_unlock( &p_hba->obj );
 	if ( p_srb->SrbStatus == SRB_STATUS_ABORT_FAILED )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				   ("Returning SrbStatus %s(0x%x) for
Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x\n",
 				   g_srb_status_name[p_srb->SrbStatus],
 				   p_srb->SrbStatus,
@@ -875,7 +879,7 @@
 		StorPortNotification( RequestComplete, p_dev_ext, p_srb
);
 	}
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 void
@@ -887,7 +891,7 @@
 	srp_hba_t               *p_hba = ((srp_ext_t
*)p_dev_ext)->p_hba;
 	srp_session_t           *p_srp_session;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_obj_lock( &p_hba->obj );
 
@@ -903,7 +907,7 @@
 
 		while ( (p_send_descriptor =
srp_remove_lun_head_send_descriptor( &p_srp_session->descriptors,
p_srb->Lun )) != NULL )
 		{
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 					   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x, tag 0x%"PRIx64"\n",
 
g_srb_status_name[SRB_STATUS_BUS_RESET],
 					   SRB_STATUS_BUS_RESET,
@@ -917,7 +921,7 @@
 
 		p_srb->SrbStatus = SRB_STATUS_SUCCESS;
 
-		SRP_TRACE( SRP_DBG_DEBUG,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				   ("Returning SrbStatus %s(0x%x) for
Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x\n",
 				   g_srb_status_name[p_srb->SrbStatus],
 				   p_srb->SrbStatus,
@@ -937,7 +941,7 @@
 	{
 		// Handle the error case here
 		p_srb->SrbStatus = SRB_STATUS_INVALID_TARGET_ID;
-		SRP_TRACE( SRP_DBG_DEBUG,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				   ("Returning SrbStatus %s(0x%x) for
Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x\n",
 				   g_srb_status_name[p_srb->SrbStatus],
 				   p_srb->SrbStatus,
@@ -952,5 +956,5 @@
 
 	cl_obj_unlock( &p_hba->obj );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
Index: kernel/srp_debug.h
===================================================================
--- kernel/srp_debug.h	(revision 1647)
+++ kernel/srp_debug.h	(working copy)
@@ -38,33 +38,102 @@
 #include <complib/cl_debug.h>
 
 
-extern uint32_t     g_srp_dbg_lvl;
-extern char         g_srb_function_name[][32];
-extern char         g_srb_status_name[][32];
+extern uint32_t		g_srp_dbg_level;
+extern uint32_t		g_srp_dbg_flags;
 
-/* Debug message category */
-#define SRP_DBG_PNP         (1 << 1)
-#define SRP_DBG_DEBUG       (1 << 2)
+#if defined(EVENT_TRACING)
+//
+// Software Tracing Definitions 
+//
 
-/* Debug message types. */
-#define SRP_DBG_FUNC        (1 << 28)
-#define SRP_DBG_VERBOSE     (1 << 29)
-#define SRP_DBG_WARN        (1 << 30)
-#define SRP_DBG_ERROR       CL_DBG_ERROR
-#define SRP_DBG_ALL         CL_DBG_ALL
 
-#define SRP_ENTER( lvl )            \
-	CL_ENTER( (lvl), g_srp_dbg_lvl )
-//	CL_ENTER( (lvl | SRP_DBG_FUNC), g_srp_dbg_lvl )
-#define SRP_EXIT( lvl )             \
-	CL_EXIT( (lvl), g_srp_dbg_lvl )
-//	CL_EXIT( (lvl | SRP_DBG_FUNC), g_srp_dbg_lvl )
-#define SRP_TRACE( lvl, msg )       \
-	CL_TRACE( (lvl), g_srp_dbg_lvl, msg )
-#define SRP_TRACE_EXIT( lvl, msg )  \
-	CL_TRACE_EXIT( (lvl), g_srp_dbg_lvl, msg )
-#define SRP_PRINT( lvl, msg )       \
-	CL_PRINT( (lvl), g_srp_dbg_lvl, msg )
+#define WPP_CONTROL_GUIDS \
+
WPP_DEFINE_CONTROL_GUID(SRPCtlGuid,(5AF07B3C,D119,4233,9C81,C07EF481CBE6
),  \
+	WPP_DEFINE_BIT( SRP_DBG_ERROR) \
+	WPP_DEFINE_BIT( SRP_DBG_PNP) \
+	WPP_DEFINE_BIT( SRP_DBG_DEBUG))
 
+#define WPP_GLOBALLOGGER
 
+
+#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) (WPP_LEVEL_ENABLED(flags)
&& WPP_CONTROL(WPP_BIT_ ## flags).Level  >= lvl)
+#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags)
+#define WPP_FLAG_ENABLED(flags)(WPP_LEVEL_ENABLED(flags) &&
WPP_CONTROL(WPP_BIT_ ## flags).Level  >= TRACE_LEVEL_VERBOSE)
+#define WPP_FLAG_LOGGER(flags) WPP_LEVEL_LOGGER(flags)
+
+
+// begin_wpp config
+// SRP_ENTER(FLAG);
+// SRP_EXIT(FLAG);
+// USEPREFIX(SRP_PRINT, "%!STDPREFIX! [SRP] :%!FUNC!() :");
+// USESUFFIX(SRP_ENTER, " [SRP] :%!FUNC!():[");
+// USESUFFIX(SRP_EXIT, " [SRP] :%!FUNC!():]");
+// end_wpp
+
+
+#else
+
+
+#include <evntrace.h>
+
+/*
+ * Debug macros
+ */
+
+
+#define SRP_DBG_ERR		(1 << 0)
+#define SRP_DBG_PNP		(1 << 1)
+#define SRP_DBG_DEBUG	(1 << 3)
+
+#define SRP_DBG_ERROR	(CL_DBG_ERROR | SRP_DBG_ERR)
+#define SRP_DBG_ALL	CL_DBG_ALL
+
+#if DBG
+
+// assignment of _level_ is need to to overcome warning C4127
+#define SRP_PRINT(_level_,_flag_,_msg_) \
+	{ \
+		if( g_srp_dbg_level >= (_level_) ) \
+			CL_TRACE( _flag_, g_srp_dbg_flags, _msg_ ); \
+	}
+
+#define SRP_PRINT_EXIT(_level_,_flag_,_msg_) \
+	{ \
+		if( g_srp_dbg_level >= (_level_) ) \
+			CL_TRACE( _flag_, g_srp_dbg_flags, _msg_ );\
+		SRP_EXIT(_flag_);\
+	}
+
+#define SRP_ENTER(_flag_) \
+	{ \
+		if( g_srp_dbg_level >= TRACE_LEVEL_VERBOSE ) \
+			CL_ENTER( _flag_, g_srp_dbg_flags ); \
+	}
+
+#define SRP_EXIT(_flag_)\
+	{ \
+		if( g_srp_dbg_level >= TRACE_LEVEL_VERBOSE ) \
+			CL_EXIT( _flag_, g_srp_dbg_flags ); \
+	}
+
+
+#else
+
+#define SRP_PRINT(lvl, flags, msg)
+
+#define SRP_PRINT_EXIT(_level_,_flag_,_msg_)
+
+#define SRP_ENTER(_flag_)
+
+#define SRP_EXIT(_flag_)
+
+
+#endif
+
+
+#endif //EVENT_TRACING
+
+extern char         g_srb_function_name[][32];
+extern char         g_srb_status_name[][32];
+
 #endif  /* _SRP_DEBUG_H_ */
Index: kernel/srp_descriptors.c
===================================================================
--- kernel/srp_descriptors.c	(revision 1647)
+++ kernel/srp_descriptors.c	(working copy)
@@ -68,7 +68,7 @@
 		(srp_recv_descriptor_t *)cl_zalloc(
p_descriptors->recv_descriptor_count * sizeof(srp_recv_descriptor_t) );
 	if ( p_descriptors->p_recv_descriptors_array == NULL )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to allocate %d recv descriptors.\n",
p_descriptors->recv_descriptor_count) );
 		status = IB_INSUFFICIENT_MEMORY;
 		goto exit;
@@ -79,7 +79,7 @@
 		cl_zalloc( p_descriptors->recv_descriptor_count *
p_descriptors->recv_data_segment_size );
 	if ( p_descriptors->p_recv_data_segments_array == NULL )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to allocate %d recv data segments of %d
length.\n",
 			p_descriptors->recv_descriptor_count,
 			p_descriptors->recv_data_segment_size) );
@@ -94,7 +94,6 @@
 	mr_create.vaddr = p_descriptors->p_recv_data_segments_array;
 	mr_create.length = p_descriptors->recv_descriptor_count *
p_descriptors->recv_data_segment_size;
 	mr_create.access_ctrl = IB_AC_LOCAL_WRITE;
-
 	status = p_ifc->reg_mem( h_pd,
 						 &mr_create,
 
&p_descriptors->recv_lkey,
@@ -102,7 +101,7 @@
 
&p_descriptors->h_recv_mr );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to register recv data segments. Status
= %d.\n", status) );
 
 		cl_free( p_descriptors->p_recv_data_segments_array );
@@ -133,11 +132,10 @@
 		status = p_ifc->post_recv( h_qp, &p_descriptor->wr, NULL
);
 		if ( status != IB_SUCCESS )
 		{
-			SRP_TRACE( SRP_DBG_ERROR,
-				("Failed to post send descriptor. Status
= %d.\n", status) );
+			SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
+				("Failed to post recv descriptor. Status
= %d.\n", status) );
 			goto exit;
 		}
-
 		p_descriptor++;
 		p_data_segment += p_descriptors->recv_data_segment_size;
 	}
@@ -247,7 +245,7 @@
 	IN  srp_descriptors_t       *p_descriptors,
 	IN  srp_send_descriptor_t   *p_descriptor )
 {
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_spinlock_acquire ( &p_descriptors->sent_list_lock );
 
@@ -256,7 +254,7 @@
 
 	cl_spinlock_release ( &p_descriptors->sent_list_lock );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 /* srp_remove_send_descriptor */
@@ -274,7 +272,7 @@
 	IN  srp_descriptors_t       *p_descriptors,
 	IN  srp_send_descriptor_t   *p_descriptor )
 {
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_spinlock_acquire ( &p_descriptors->sent_list_lock );
 
@@ -283,7 +281,7 @@
 
 	cl_spinlock_release ( &p_descriptors->sent_list_lock );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
 
 /* srp_remove_lun_head_send_descriptor */
@@ -302,7 +300,7 @@
 {
 	srp_send_descriptor_t   *p_descriptor;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_spinlock_acquire ( &p_descriptors->sent_list_lock );
 
@@ -329,7 +327,7 @@
 
 	cl_spinlock_release ( &p_descriptors->sent_list_lock );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 
 	return ( p_descriptor );
 }
@@ -355,19 +353,19 @@
 	srp_connection_t	*p_connection;
 	ib_al_ifc_t			*p_ifc;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	p_connection = &p_session->connection;
 	p_ifc = &p_session->hca.p_hba->ifc;
 
 	if ( p_connection->state == SRP_CONNECTED )
 	{
-		SRP_TRACE( SRP_DBG_VERBOSE, ("wr_id    =
0x%"PRIx64".\n", p_descriptor->wr.wr_id) );
-		SRP_TRACE( SRP_DBG_VERBOSE, ("wr_type  = 0x%x.\n",
p_descriptor->wr.wr_type) );
-		SRP_TRACE( SRP_DBG_VERBOSE, ("send_opt = 0x%x.\n",
p_descriptor->wr.send_opt) );
-		SRP_TRACE( SRP_DBG_VERBOSE, ("num_ds   = 0x%x.\n",
p_descriptor->wr.num_ds) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("wr_id
= 0x%"PRIx64".\n", p_descriptor->wr.wr_id) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("wr_type
= 0x%x.\n", p_descriptor->wr.wr_type) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("send_opt
= 0x%x.\n", p_descriptor->wr.send_opt) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("num_ds
= 0x%x.\n", p_descriptor->wr.num_ds) );
 
-		SRP_TRACE( SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				   ("Posting  I/O for Function =
%s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x, tag 0x%"PRIx64"\n",
 
g_srb_function_name[p_descriptor->p_srb->Function],
 				   p_descriptor->p_srb->Function,
@@ -395,7 +393,7 @@
 		{
 			/* Remove From Sent List */
 			srp_remove_send_descriptor( p_descriptors,
p_descriptor );
-			SRP_TRACE( SRP_DBG_ERROR,
+			SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 						("Failed to post send
descriptor. ib_post_send status = 0x%x tag = 0x%"PRIx64"\n",
 						status,
 						get_srp_command_tag(
(srp_cmd_t *)p_descriptor->data_segment )) );
@@ -403,11 +401,11 @@
 	}
 	else
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Attempting to post to an unconnected
session.\n") );
 	}
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 
 	return ( status );
 }
@@ -430,18 +428,18 @@
 {
 	srp_send_descriptor_t   *p_send_descriptor;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_spinlock_acquire( &p_descriptors->sent_list_lock );
 
 	p_send_descriptor = (srp_send_descriptor_t *)cl_qlist_head(
&p_descriptors->sent_descriptors );
 	CL_ASSERT( &p_descriptors->sent_descriptors ==
p_send_descriptor->list_item.p_list );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("rsp tag = 0x%"PRIx64".\n", tag) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("rsp tag =
0x%"PRIx64".\n", tag) );
 
 	while ( p_send_descriptor != (srp_send_descriptor_t
*)cl_qlist_end( &p_descriptors->sent_descriptors ) )
 	{
-		SRP_TRACE( SRP_DBG_VERBOSE, ("cmd tag = 0x%"PRIx64".\n",
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("cmd tag =
0x%"PRIx64".\n",
 			get_srp_command_tag( (srp_cmd_t
*)p_send_descriptor->data_segment )) );
 
 		if ( get_srp_command_tag( (srp_cmd_t
*)p_send_descriptor->data_segment ) == tag )
@@ -460,7 +458,7 @@
 exit:
 	cl_spinlock_release( &p_descriptors->sent_list_lock );
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 
 	return ( p_send_descriptor );
 }
@@ -485,7 +483,7 @@
 	STOR_PHYSICAL_ADDRESS   physical_address;
 	ULONG                   length;
 
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	cl_memclr( p_send_descriptor, (sizeof ( srp_send_descriptor_t )
- SRP_MAX_IU_SIZE) );
 
@@ -502,11 +500,11 @@
 	p_send_descriptor->ds[0].length =
p_srp_conn_info->init_to_targ_iu_sz;
 	p_send_descriptor->ds[0].lkey =   p_srp_conn_info->lkey;
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("hca vaddr        =
0x%"PRIx64".\n", p_srp_conn_info->vaddr));
-	SRP_TRACE( SRP_DBG_VERBOSE, ("physical_address =
0x%"PRIx64".\n", physical_address.QuadPart));
-	SRP_TRACE( SRP_DBG_VERBOSE, ("IU  vaddr        =
0x%"PRIx64".\n", p_send_descriptor->ds[0].vaddr));
-	SRP_TRACE( SRP_DBG_VERBOSE, ("length           = %d.\n",
p_send_descriptor->ds[0].length));
-	SRP_TRACE( SRP_DBG_VERBOSE, ("lkey             = 0x%x.\n",
p_send_descriptor->ds[0].lkey));
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("hca vaddr
= 0x%"PRIx64".\n", p_srp_conn_info->vaddr));
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("physical_address
= 0x%"PRIx64".\n", physical_address.QuadPart));
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("IU  vaddr
= 0x%"PRIx64".\n", p_send_descriptor->ds[0].vaddr));
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("length
= %d.\n",          p_send_descriptor->ds[0].length));
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("lkey
= 0x%x.\n",        p_send_descriptor->ds[0].lkey));
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 }
Index: kernel/srp_driver.c
===================================================================
--- kernel/srp_driver.c	(revision 1647)
+++ kernel/srp_driver.c	(working copy)
@@ -46,9 +46,10 @@
 
 BOOLEAN             g_srp_system_shutdown = FALSE;
 
-//uint32_t            g_srp_dbg_lvl = SRP_DBG_PNP | SRP_DBG_ERROR |
SRP_DBG_WARN | SRP_DBG_VERBOSE | SRP_DBG_FUNC;
-uint32_t            g_srp_dbg_lvl = SRP_DBG_DEBUG | SRP_DBG_ERROR |
SRP_DBG_WARN;
 
+uint32_t			g_srp_dbg_level = TRACE_LEVEL_ERROR;
+uint32_t			g_srp_dbg_flags = 0x0000ffff;
+
 char g_srb_function_name[][32] =
 {
 	"EXECUTE_SCSI",          // 0x00
@@ -142,6 +143,11 @@
 PDRIVER_ADD_DEVICE  gpfn_add_device;
 PDRIVER_UNLOAD      gpfn_unload;
 
+
+static NTSTATUS
+__read_registry(
+	IN				UNICODE_STRING* const
p_Param_Path );
+
 NTSTATUS
 srp_add_device(
 	IN              DRIVER_OBJECT               *p_drv_obj,
@@ -198,6 +204,73 @@
 __srp_free(
 	IN              cl_obj_t                    *p_obj );
 
+
+
+static NTSTATUS
+__read_registry(
+	IN				UNICODE_STRING* const
p_registry_path )
+{
+	NTSTATUS					status;
+	/* Remember the terminating entry in the table below. */
+	RTL_QUERY_REGISTRY_TABLE	table[3];
+	UNICODE_STRING				param_path;
+
+	SRP_ENTER( SRP_DBG_PNP );
+
+	RtlInitUnicodeString( &param_path, NULL );
+	param_path.MaximumLength = p_registry_path->Length + 
+		sizeof(L"\\Parameters");
+	param_path.Buffer = cl_zalloc( param_path.MaximumLength );
+	if( !param_path.Buffer )
+	{
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR , 
+			("Failed to allocate parameters path buffer.\n")
);
+		return STATUS_INSUFFICIENT_RESOURCES;
+	}
+
+	RtlAppendUnicodeStringToString( &param_path, p_registry_path );
+	RtlAppendUnicodeToString( &param_path, L"\\Parameters" );
+
+	/*
+	 * Clear the table.  This clears all the query callback
pointers,
+	 * and sets up the terminating table entry.
+	 */
+	cl_memclr( table, sizeof(table) );
+
+	/* Setup the table entries. */
+	table[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
+	table[0].Name = L"DebugFlags";
+	table[0].EntryContext = &g_srp_dbg_level;
+	table[0].DefaultType = REG_DWORD;
+	table[0].DefaultData = &g_srp_dbg_level;
+	table[0].DefaultLength = sizeof(ULONG);
+
+	table[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
+	table[1].Name = L"DebugFlags";
+	table[1].EntryContext = &g_srp_dbg_flags;
+	table[1].DefaultType = REG_DWORD;
+	table[1].DefaultData = &g_srp_dbg_flags;
+	table[1].DefaultLength = sizeof(ULONG);
+	/* Have at it! */
+	status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, 
+		param_path.Buffer, table, NULL, NULL );
+
+
+#ifndef EVENT_TRACING
+	if( g_srp_dbg_flags & SRP_DBG_ERR )
+		g_srp_dbg_flags |= CL_DBG_ERROR;
+#endif
+
+	SRP_PRINT( TRACE_LEVEL_INFORMATION, SRP_DBG_PNP,
+		("debug level %d debug flags 0x%.8x\n",
+		g_srp_dbg_level,
+		g_srp_dbg_flags) );
+
+	cl_free( param_path.Buffer );
+	SRP_EXIT( SRP_DBG_PNP );
+	return status;
+}
+
 ULONG
 DriverEntry(
 	IN              DRIVER_OBJECT               *p_drv_obj,
@@ -212,13 +285,23 @@
 	status = CL_INIT;
 	if( !NT_SUCCESS(status) )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("cl_init returned %08X.\n", status) );
 		return status;
 	}
 
 	gp_drv_obj = p_drv_obj;
 
+	/* Get the registry values. */
+	status = __read_registry( p_registry_path );
+	if( !NT_SUCCESS(status) )
+	{
+		CL_DEINIT;
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR , 
+			("__read_registry returned %08x.\n", status) );
+		return status;
+	}
+	
 	cl_obj_construct( &g_drv_obj, SRP_OBJ_TYPE_DRV );
 
 	KeInitializeMutex( &g_srp_pnp_mutex, 0 );
@@ -279,7 +362,7 @@
 		else
 		{
 			CL_DEINIT;
-			SRP_TRACE( SRP_DBG_ERROR,
+			SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 				("StorPortInitialize returned 0x%x.\n",
status) );
 		}
 	}
@@ -289,7 +372,7 @@
 		status = (ULONG)STATUS_INSUFFICIENT_RESOURCES;
 	}
 
-	SRP_TRACE_EXIT( SRP_DBG_PNP, ("DriverEntry returning status of
0x%x.\n", status) );
+	SRP_PRINT_EXIT(TRACE_LEVEL_INFORMATION ,SRP_DBG_PNP ,
("DriverEntry returning status of 0x%x.\n", status) );
 	return status;
 }
 
@@ -300,14 +383,14 @@
 	SRP_ENTER( SRP_DBG_PNP );
 
 	/* Kill all SRP objects. */
-	SRP_TRACE( SRP_DBG_DEBUG, ("Destroying all SRP objects.\n") );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Driver Object ref_cnt = %d\n",
g_drv_obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Destroying
all SRP objects.\n") );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Driver Object
ref_cnt = %d\n", g_drv_obj.ref_cnt) );
 	cl_obj_destroy( &g_drv_obj );
 
 	CL_DEINIT;
 
 	/* Invoke the port driver's unload routine. */
-	SRP_TRACE( SRP_DBG_DEBUG, ("Invoking the port driver's unload
routine.\n") );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Invoking the
port driver's unload routine.\n") );
 	gpfn_unload( p_drv_obj );
 
 	SRP_EXIT( SRP_DBG_PNP );
@@ -334,7 +417,7 @@
 	SRP_ENTER( SRP_DBG_PNP );
 
 	status = gpfn_add_device( p_drv_obj, p_pdo );
-	SRP_TRACE( SRP_DBG_PNP,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP ,
 		("srp_add_device status = 0x%x.\n", status) );
 
 	SRP_EXIT( SRP_DBG_PNP );
@@ -354,7 +437,7 @@
 
 	p_stack = IoGetCurrentIrpStackLocation( p_irp );
 	minor = p_stack->MinorFunction;
-	SRP_TRACE( SRP_DBG_PNP,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP ,
 		("Minor PNP Function = %d.\n", minor) );
 
 	if( minor == IRP_MN_START_DEVICE )
@@ -364,12 +447,12 @@
 		wait_status = KeWaitForMutexObject(
 			&g_srp_pnp_mutex, Executive, KernelMode, FALSE,
NULL );
 
-		SRP_TRACE( SRP_DBG_PNP,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP ,
 			("KeWaitForMutexObject status = 0x%x.\n",
wait_status) );
 		gp_self_do = p_dev_obj;
 	}
 	status = gpfn_pnp( p_dev_obj, p_irp );
-	SRP_TRACE( SRP_DBG_PNP,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP ,
 		("gpfn_pnp status = 0x%x.\n", status) );
 
 	if( minor == IRP_MN_START_DEVICE )
@@ -377,7 +460,7 @@
 		LONG    release_status;
 		gp_self_do = NULL;
 		release_status = KeReleaseMutex( &g_srp_pnp_mutex, FALSE
);
-		SRP_TRACE( SRP_DBG_PNP,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP ,
 			("KeReleaseMutex status = %d.\n",
release_status) );
 	}
 
@@ -408,7 +491,7 @@
 
 	if( KeGetCurrentIrql() >= DISPATCH_LEVEL )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("Improper IRQL!\n") );
 		return SP_RETURN_ERROR;
 	}
@@ -418,7 +501,7 @@
 	ib_status = srp_hba_create( &g_drv_obj, p_ext );
 	if( ib_status != IB_SUCCESS )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("srp_hba_create returned %d\n", ib_status) );
 		return SP_RETURN_ERROR;
 	}
@@ -443,7 +526,7 @@
 //	p_config->InitiatorBusId[0]           = 127;
 //	p_config->DeviceExtensionSize         = sizeof( srp_ext_t );
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 		("NumberOfPhysicalBreaks passed in = %d.\n",
p_config->NumberOfPhysicalBreaks) );
 
 	if ( p_config->NumberOfPhysicalBreaks == SP_UNINITIALIZED_VALUE
)
@@ -455,7 +538,7 @@
 		p_config->NumberOfPhysicalBreaks = MIN(
p_ext->p_hba->max_sg - 1, p_config->NumberOfPhysicalBreaks );
 	}
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 		("NumberOfPhysicalBreaks set to = %d.\n",
p_config->NumberOfPhysicalBreaks) );
 
 	SRP_EXIT( SRP_DBG_PNP );
@@ -470,7 +553,7 @@
 
 	UNUSED_PARAM( p_dev_ext );
 
-	SRP_TRACE( SRP_DBG_PNP, ("called at IRQL %d\n",
KeGetCurrentIrql()) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP , ("called at IRQL
%d\n", KeGetCurrentIrql()) );
 
 	SRP_EXIT( SRP_DBG_PNP );
 	return TRUE;
@@ -481,9 +564,9 @@
 	IN              PVOID                       p_dev_ext,
 	IN              PSCSI_REQUEST_BLOCK         p_srb )
 {
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			   ("Starting I/O for Function = %s(0x%x), Path
= 0x%x, Target = 0x%x, Lun = 0x%x\n",
 			   g_srb_function_name[p_srb->Function],
 			   p_srb->Function,
@@ -526,7 +609,7 @@
 				p_srp_session->p_shutdown_srb = p_srb;
 				cl_obj_destroy( &p_srp_session->obj );
 
-				SRP_TRACE( SRP_DBG_DEBUG,
+
SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 						   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x\n",
 
g_srb_status_name[p_srb->SrbStatus],
 						   p_srb->SrbStatus,
@@ -539,7 +622,7 @@
 			else
 			{
 				p_srb->SrbStatus = SRB_STATUS_SUCCESS;
-				SRP_TRACE( SRP_DBG_DEBUG,
+
SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 						   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x\n",
 
g_srb_status_name[p_srb->SrbStatus],
 						   p_srb->SrbStatus,
@@ -555,7 +638,7 @@
 
 		case SRB_FUNCTION_FLUSH: /* Only receive this if
CachesData is TRUE in PORT_CONFIGURATION_INFORMATION */
 			p_srb->SrbStatus = SRB_STATUS_SUCCESS;
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 					   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x\n",
 
g_srb_status_name[p_srb->SrbStatus],
 					   p_srb->SrbStatus,
@@ -589,7 +672,7 @@
 #endif
 		default:
 			p_srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 					   ("Returning SrbStatus
%s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun =
0x%x\n",
 
g_srb_status_name[p_srb->SrbStatus],
 					   p_srb->SrbStatus,
@@ -602,7 +685,7 @@
 
 	}
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 
 	return ( TRUE );
 }
@@ -615,7 +698,7 @@
 
 	UNUSED_PARAM( p_dev_ext );
 
-	SRP_TRACE( SRP_DBG_PNP, ("called at IRQL %d\n",
KeGetCurrentIrql()) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP , ("called at IRQL
%d\n", KeGetCurrentIrql()) );
 
 	SRP_EXIT( SRP_DBG_PNP );
 	return TRUE;
@@ -646,14 +729,14 @@
 
 	SRP_ENTER( SRP_DBG_PNP );
 
-	SRP_TRACE( SRP_DBG_PNP, ("called at IRQL %d\n",
KeGetCurrentIrql()) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_PNP , ("called at IRQL
%d\n", KeGetCurrentIrql()) );
 
 	p_ext = (srp_ext_t*)p_dev_ext;
 
 	switch( ctrl_type )
 	{
 	case ScsiQuerySupportedControlTypes:
-		SRP_TRACE( SRP_DBG_DEBUG | SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG ,
 			("ScsiQuerySupportedControlTypes\n") );
 		p_ctrl_list = (SCSI_SUPPORTED_CONTROL_TYPE_LIST*)params;
 
p_ctrl_list->SupportedTypeList[ScsiQuerySupportedControlTypes] = TRUE;
@@ -664,28 +747,28 @@
 		break;
 
 	case ScsiStopAdapter:
-		SRP_TRACE( SRP_DBG_DEBUG | SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG ,
 			("ScsiStopAdapter\n") );
 		if( p_ext->p_hba )
 		{
-			SRP_TRACE( SRP_DBG_VERBOSE, ("HBA Object ref_cnt
= %d\n", p_ext->p_hba->obj.ref_cnt) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("HBA Object ref_cnt = %d\n", p_ext->p_hba->obj.ref_cnt) );
 			cl_obj_destroy( &p_ext->p_hba->obj );
 			p_ext->p_hba = NULL;
 		}
 		break;
 
 	case ScsiRestartAdapter:
-		SRP_TRACE( SRP_DBG_DEBUG | SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG ,
 			("ScsiRestartAdapter\n") );
 		break;
 
 	case ScsiSetBootConfig:
-		SRP_TRACE( SRP_DBG_DEBUG | SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG ,
 			("ScsiSetBootConfig\n") );
 		break;
 
 	case ScsiSetRunningConfig:
-		SRP_TRACE( SRP_DBG_DEBUG | SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG ,
 			("ScsiSetRunningConfig\n") );
 		break;
 	}
@@ -699,14 +782,14 @@
 	IN              PVOID                       p_dev_ext,
 	IN              PSCSI_REQUEST_BLOCK         p_srb )
 {
-	SRP_ENTER( SRP_DBG_FUNC );
+	SRP_ENTER( SRP_DBG_DEBUG );
 
 	if ( p_srb->Function == SRB_FUNCTION_EXECUTE_SCSI )
 	{
 
 		CL_ASSERT( p_srb->SrbExtension != NULL );
 
-		SRP_TRACE( SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				   ("Building I/O for Function =
%s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x\n",
 				   g_srb_function_name[p_srb->Function],
 				   p_srb->Function,
@@ -716,7 +799,7 @@
 
 		if ( srp_format_io_request( p_dev_ext, p_srb ) == FALSE
)
 		{
-			SRP_TRACE_EXIT( SRP_DBG_ERROR,
+			SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR
,
 							("Returning
SrbStatus %s(0x%x) for Function = %s(0x%x), Path = 0x%x, Target = 0x%x,
Lun = 0x%x\n",
 
g_srb_status_name[p_srb->SrbStatus],
 
p_srb->SrbStatus,
@@ -732,7 +815,7 @@
 		}
 	}
 
-	SRP_EXIT( SRP_DBG_FUNC );
+	SRP_EXIT( SRP_DBG_DEBUG );
 
 	return ( TRUE );
 }
Index: kernel/srp_event.c
===================================================================
--- kernel/srp_event.c	(revision 1647)
+++ kernel/srp_event.c	(working copy)
@@ -59,21 +59,21 @@
 	switch ( p_event_rec->code )
 	{
 		case IB_AE_PORT_ACTIVE:
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				("Async Event IB_AE_PORT_ACTIVE (%d)
received for %s.\n",
 				 p_event_rec->code,
 
p_srp_session->p_hba->ioc_info.profile.id_string) );
 			break;
 
 		case IB_AE_PORT_DOWN:
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				("Async Event IB_AE_PORT_DOWN (%d)
received for %s.\n",
 				 p_event_rec->code,
 
p_srp_session->p_hba->ioc_info.profile.id_string) );
 			break;
 
 		default:
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				("Async Event %d received.\n",
p_event_rec->code) );
 			break;
 	}
Index: kernel/srp_hba.c
===================================================================
--- kernel/srp_hba.c	(revision 1647)
+++ kernel/srp_hba.c	(working copy)
@@ -65,36 +65,36 @@
 {
 	UNUSED_PARAM( p_ioc_info );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("Dumping IOC Info\n") );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Dumping IOC
Info\n") );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   chassis_guid    =
0x%"PRIx64"\n", cl_ntoh64( p_ioc_info->chassis_guid )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   chassis_slot    = %d\n",
p_ioc_info->chassis_slot) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   iou_guid        =
0x%"PRIx64"\n", cl_ntoh64( p_ioc_info->iou_guid )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   iou_slot        = %d\n",
p_ioc_info->iou_slot) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("\n") );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("Dumping IOC Info Profile\n") );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
chassis_guid    = 0x%"PRIx64"\n", cl_ntoh64( p_ioc_info->chassis_guid ))
);
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
chassis_slot    = %d\n",          p_ioc_info->chassis_slot) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   iou_guid
= 0x%"PRIx64"\n", cl_ntoh64( p_ioc_info->iou_guid )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   iou_slot
= %d\n",          p_ioc_info->iou_slot) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("\n") );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Dumping IOC
Info Profile\n") );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   ioc_guid        =
0x%"PRIx64"\n", cl_ntoh64( p_ioc_info->profile.ioc_guid )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   vend_id         = %d\n",
cl_ntoh32( p_ioc_info->profile.vend_id )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   dev_id          = %d\n",
cl_ntoh32( p_ioc_info->profile.dev_id )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   dev_ver         = %d\n",
cl_ntoh16( p_ioc_info->profile.dev_ver )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   ioc_guid
= 0x%"PRIx64"\n", cl_ntoh64( p_ioc_info->profile.ioc_guid )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   vend_id
= %d\n",          cl_ntoh32( p_ioc_info->profile.vend_id )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   dev_id
= %d\n",          cl_ntoh32( p_ioc_info->profile.dev_id )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   dev_ver
= %d\n",          cl_ntoh16( p_ioc_info->profile.dev_ver )) );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   subsys_vend_id  = %d\n",
cl_ntoh32( p_ioc_info->profile.subsys_vend_id )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   subsys_id       = %d\n",
cl_ntoh32( p_ioc_info->profile.subsys_id )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
subsys_vend_id  = %d\n",          cl_ntoh32(
p_ioc_info->profile.subsys_vend_id )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   subsys_id
= %d\n",          cl_ntoh32( p_ioc_info->profile.subsys_id )) );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   io_class        = %d\n",
cl_ntoh16( p_ioc_info->profile.io_class )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   io_subclass     = %d\n",
cl_ntoh16( p_ioc_info->profile.io_subclass )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   protocol        = %d\n",
cl_ntoh16( p_ioc_info->profile.protocol )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   protocol_ver    = %d\n",
cl_ntoh16( p_ioc_info->profile.protocol_ver )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   io_class
= %d\n",          cl_ntoh16( p_ioc_info->profile.io_class )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
io_subclass     = %d\n",          cl_ntoh16(
p_ioc_info->profile.io_subclass )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   protocol
= %d\n",          cl_ntoh16( p_ioc_info->profile.protocol )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
protocol_ver    = %d\n",          cl_ntoh16(
p_ioc_info->profile.protocol_ver )) );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   send_msg_depth  = %d\n",
cl_ntoh16( p_ioc_info->profile.send_msg_depth )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   rdma_read_depth = %d\n",
p_ioc_info->profile.rdma_read_depth) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   send_msg_size   = %d\n",
cl_ntoh32( p_ioc_info->profile.send_msg_size )) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   rdma_size       = %d\n",
cl_ntoh32( p_ioc_info->profile.rdma_size )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
send_msg_depth  = %d\n",          cl_ntoh16(
p_ioc_info->profile.send_msg_depth )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
rdma_read_depth = %d\n",          p_ioc_info->profile.rdma_read_depth)
);
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
send_msg_size   = %d\n",          cl_ntoh32(
p_ioc_info->profile.send_msg_size )) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   rdma_size
= %d\n",          cl_ntoh32( p_ioc_info->profile.rdma_size )) );
 
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   ctrl_ops_cap    = 0x%X\n",
p_ioc_info->profile.ctrl_ops_cap) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   num_svc_entries = 0x%X\n",
p_ioc_info->profile.num_svc_entries) );
-	SRP_PRINT( SRP_DBG_VERBOSE, ("   id_string       = %s\n",
p_ioc_info->profile.id_string) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
ctrl_ops_cap    = 0x%X\n",        p_ioc_info->profile.ctrl_ops_cap) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("
num_svc_entries = 0x%X\n",        p_ioc_info->profile.num_svc_entries)
);
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("   id_string
= %s\n",          p_ioc_info->profile.id_string) );
 }
 
 
@@ -124,7 +124,7 @@
 	status = cl_fwd_query_ifc( gp_self_do, &io_stack );
 	if( !NT_SUCCESS( status ) )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("Query interface for IOU parameters returned
%08x.\n", status) );
 		return FALSE;
 	}
@@ -158,7 +158,7 @@
 	p_hba = (srp_hba_t*)cl_zalloc( sizeof(srp_hba_t) );
 	if( !p_hba )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("Failed to allocate srp_hba_t structure.\n") );
 		return IB_INSUFFICIENT_MEMORY;
 	}
@@ -173,7 +173,7 @@
 
 	if( !__get_ioc_ifc( p_hba ) )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR, ("__get_ioc_ifc
failed.\n") );
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
("__get_ioc_ifc failed.\n") );
 		return IB_ERROR;
 	}
 
@@ -187,7 +187,7 @@
 		__srp_destroying_hba, __srp_cleanup_hba, __srp_free_hba
);
 	if( cl_status != CL_SUCCESS )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("cl_obj_init returned %s\n",
cl_status_text[cl_status]) );
 		return IB_ERROR;
 	}
@@ -195,9 +195,9 @@
 	ib_status = p_hba->ifc.open_al( &p_hba->h_al );
 	if( ib_status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_VERBOSE, ("HBA Object ref_cnt =
%d\n", p_hba->obj.ref_cnt) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("HBA
Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );
 		cl_obj_destroy( &p_hba->obj );
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("ib_open_al returned %s\n",
p_hba->ifc.get_err_str( ib_status )) );
 		return ib_status;
 	}
@@ -214,9 +214,9 @@
 	ib_status = p_hba->ifc.reg_pnp( p_hba->h_al, &pnp_req,
&p_hba->h_pnp );
 	if( ib_status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_VERBOSE, ("HBA Object ref_cnt =
%d\n", p_hba->obj.ref_cnt) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("HBA
Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );
 		cl_obj_destroy( &p_hba->obj );
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("ib_reg_pnp returned %s\n",
p_hba->ifc.get_err_str( ib_status )) );
 		return ib_status;
 	}
@@ -230,10 +230,10 @@
 	if ( p_hba->session_list[0] == NULL )
 	{
 		p_ext->p_hba = NULL;
-		SRP_TRACE( SRP_DBG_VERBOSE, ("HBA Object ref_cnt =
%d\n", p_hba->obj.ref_cnt) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("HBA
Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );
 		cl_obj_destroy( &p_hba->obj );
 
-		SRP_TRACE( SRP_DBG_ERROR, ("Session Connection
Failure.\n") );
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR, ("Session
Connection Failure.\n") );
 		ib_status = IB_ERROR;
 	}
 
@@ -252,14 +252,14 @@
 
 	p_hba = PARENT_STRUCT( p_obj, srp_hba_t, obj );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Before dereg pnp HBA Object
ref_cnt = %d\n", p_hba->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Before dereg pnp
HBA Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );
 
 	if( p_hba->h_pnp )
 	{
 		p_hba->ifc.dereg_pnp( p_hba->h_pnp, cl_obj_deref );
 	}
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("After dereg pnp HBA Object ref_cnt
= %d\n", p_hba->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG , ("After dereg pnp
HBA Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );
 
 	SRP_EXIT( SRP_DBG_PNP );
 }
@@ -275,7 +275,7 @@
 	cl_spinlock_acquire( &p_hba->path_record_list_lock );
 	p_srp_path_record = (srp_path_record_t *)cl_qlist_remove_head(
&p_hba->path_record_list );
 
-	SRP_TRACE( SRP_DBG_DEBUG, ("Removing any remaining path
records.\n") );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG , ("Removing any
remaining path records.\n") );
 
 	while ( p_srp_path_record != (srp_path_record_t *)cl_qlist_end(
&p_hba->path_record_list ) )
 	{
@@ -339,7 +339,7 @@
 		   cl_ntoh16( p_ioc_rec->info.profile.io_class )  !=
SRP_IO_CLASS_R10 ) ||
 		 cl_ntoh16( p_ioc_rec->info.profile.io_subclass ) !=
SRP_IO_SUBCLASS )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR, ("Not an SRP
CLASS(0x%x)/SUBCLASS(0x%x).\n",
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR , ("Not
an SRP CLASS(0x%x)/SUBCLASS(0x%x).\n",
 						cl_ntoh16(
p_ioc_rec->info.profile.io_class ),
 						cl_ntoh16(
p_ioc_rec->info.profile.io_subclass )) );
 		return FALSE;
@@ -353,7 +353,7 @@
 		 !(p_ioc_rec->info.profile.ctrl_ops_cap &
CTRL_OPS_CAP_RF) ||
 		 !(p_ioc_rec->info.profile.ctrl_ops_cap &
CTRL_OPS_CAP_WF) )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR, ("Not an SRP
PROTOCOL/PROTOCOL_VER.\n") );
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR , ("Not
an SRP PROTOCOL/PROTOCOL_VER.\n") );
 		return FALSE;
 	}
 
@@ -362,7 +362,7 @@
 		 cl_ntoh16( p_ioc_rec->info.profile.send_msg_depth ) ==
0 ||
 		 cl_ntoh32( p_ioc_rec->info.profile.rdma_size )      <
SRP_MIN_TGT_TO_INI_DMA )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR, ("Device Not Capable.\n")
);
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
("Device Not Capable.\n") );
 		return FALSE;
 	}
 
@@ -400,19 +400,19 @@
 
 	if ( p_path_rec_1->hop_flow_raw.val !=
p_path_rec_2->hop_flow_raw.val )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("hop_flow_raw.val does not
match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("hop_flow_raw.val does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->tclass != p_path_rec_2->tclass )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("tclass does not match.\n")
);
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("tclass does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->num_path != p_path_rec_2->num_path )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("num_path does not match.\n")
);
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("num_path does not match.\n") );
 		if ( check_num_path == TRUE )
 		{
 			return ( FALSE );
@@ -421,37 +421,37 @@
 
 	if ( p_path_rec_1->pkey != p_path_rec_2->pkey )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("pkey does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("pkey
does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->sl != p_path_rec_2->sl )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("sl does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("sl
does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->mtu != p_path_rec_2->mtu )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("mtu does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("mtu
does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->rate != p_path_rec_2->rate )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("rate does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("rate
does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->pkt_life != p_path_rec_2->pkt_life )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("pkt_life does not match.\n")
);
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("pkt_life does not match.\n") );
 		return ( FALSE );
 	}
 
 	if ( p_path_rec_1->preference != p_path_rec_2->preference )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("preference does not
match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("preference does not match.\n") );
 		if ( check_preference == TRUE )
 		{
 			return ( FALSE );
@@ -462,26 +462,26 @@
 
 	if ( p_path_rec_1->resv0 != p_path_rec_2->resv0 )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("resv0 does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("resv0
does not match.\n") );
 	}
 
 	if ( p_path_rec_1->resv1 != p_path_rec_2->resv1 )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("resv1 does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("resv1
does not match.\n") );
 	}
 
 	if ( p_path_rec_1->resv2 != p_path_rec_2->resv2 )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("resv2 does not match.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("resv2
does not match.\n") );
 	}
 
 	if ( cl_memcmp( p_path_rec_1, p_path_rec_2, sizeof(
ib_path_rec_t ) ) != 0 )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("p_path_rec_1 does not match
p_path_rec_2.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("p_path_rec_1 does not match p_path_rec_2.\n") );
 	}
 	else
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("p_path_rec_1 matches
p_path_rec_2.\n") );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("p_path_rec_1 matches p_path_rec_2.\n") );
 	}
 
 #endif
@@ -503,7 +503,7 @@
 
 	SRP_ENTER( SRP_DBG_PNP );
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 		("Finding path record (slid:%d dlid:%d) for %s.\n",
 		p_path_rec->slid,
 		p_path_rec->dlid,
@@ -520,7 +520,7 @@
 
check_num_path,
 
check_preference ) == TRUE )
 		{
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				("Found path record (slid:%d dlid:%d)
for %s.\n",
 				p_path_rec->slid,
 				p_path_rec->dlid,
@@ -558,7 +558,7 @@
 	{
 		cl_spinlock_acquire( &p_hba->path_record_list_lock );
 
-		SRP_TRACE( SRP_DBG_VERBOSE,
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 			("Removing path record (slid:%d dlid:%d) for
%s.\n",
 			p_path_rec->slid,
 			p_path_rec->dlid,
@@ -569,7 +569,7 @@
 		cl_spinlock_release( &p_hba->path_record_list_lock );
 	}
 
-	SRP_TRACE( SRP_DBG_DEBUG,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 		("Current Path count for %s = %d \n",
 		 p_hba->ioc_info.profile.id_string,
 		 cl_qlist_count( &p_hba->path_record_list )) );
@@ -596,7 +596,7 @@
 		p_srp_path_record->path_rec = *p_path_rec;
 		cl_spinlock_release( &p_hba->path_record_list_lock );
 
-		SRP_TRACE( SRP_DBG_WARN,
+		SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG,
 			("Discarding/Updating duplicate path record
(slid:%d dlid:%d) for %s.\n",
 			p_path_rec->slid,
 			p_path_rec->dlid,
@@ -605,7 +605,7 @@
 		goto exit;
 	}
 
-	SRP_TRACE( SRP_DBG_VERBOSE,
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 		("Adding path record (slid:%d dlid:%d) for %s.\n",
 		p_path_rec->slid,
 		p_path_rec->dlid,
@@ -615,7 +615,7 @@
 	p_srp_path_record = cl_zalloc( sizeof( srp_path_record_t ) );
 	if ( p_srp_path_record == NULL )
 	{
-		SRP_TRACE( SRP_DBG_ERROR, ("Insufficient Memory.\n") );
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
("Insufficient Memory.\n") );
 	}
 	else
 	{
@@ -626,7 +626,7 @@
 		cl_spinlock_release( &p_hba->path_record_list_lock );
 	}
 
-	SRP_TRACE( SRP_DBG_DEBUG,
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 		("Current Path count for %s = %d \n",
 		 p_hba->ioc_info.profile.id_string,
 		 cl_qlist_count( &p_hba->path_record_list )) );
@@ -657,12 +657,12 @@
 		{
 			retry_count++;
 
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				("Attempting to connect %s. Connection
Attempt Count = %d.\n",
 				 p_hba->ioc_info.profile.id_string,
 				 retry_count) );
 
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				("Creating New Session For Service Entry
Index %d.\n", p_hba->ioc_info.profile.num_svc_entries));
 			p_session = srp_new_session( p_hba,
 
p_hba->ioc_info.profile.ioc_guid,
@@ -674,9 +674,9 @@
 				break;
 			}
 
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				("New Session For Service Entry Index %d
Created.\n", p_hba->ioc_info.profile.num_svc_entries));
-			SRP_TRACE( SRP_DBG_VERBOSE,
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 				("Logging Into Session.\n"));
 			status = srp_session_login( p_session );
 			if ( status == IB_SUCCESS )
@@ -703,14 +703,14 @@
 				p_hba->session_list[i] = p_session;
 				cl_obj_unlock( &p_hba->obj );
 
-				SRP_TRACE( SRP_DBG_VERBOSE,
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 					("Session Login Issued
Successfully.\n"));
 			}
 			else
 			{
-				SRP_TRACE( SRP_DBG_ERROR,
+
SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 					("Session Login Failure Status =
%d.\n", status));
-				SRP_TRACE( SRP_DBG_VERBOSE, ("Session
Object ref_cnt = %d\n", p_session->obj.ref_cnt) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Session Object ref_cnt =
%d\n", p_session->obj.ref_cnt) );
 				cl_obj_destroy( &p_session->obj );
 			}
 		} while ( (status != IB_SUCCESS) && (retry_count < 3) );
@@ -720,7 +720,7 @@
 			status = IB_SUCCESS;
 			if ( p_hba->adapter_paused == TRUE )
 			{
-				SRP_TRACE( SRP_DBG_DEBUG, ("Resuming
Adapter for %s.\n", p_hba->ioc_info.profile.id_string) );
+
SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Resuming Adapter for
%s.\n", p_hba->ioc_info.profile.id_string) );
 				p_hba->adapter_paused = FALSE;
 				StorPortReady( p_hba->p_ext );
 //				StorPortNotification( BusChangeDetected,
p_hba->p_ext, 0 );
@@ -757,11 +757,11 @@
 
 	if ( i == p_hba->ioc_info.profile.num_svc_entries )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("No current connections to
%s.\n", p_hba->ioc_info.profile.id_string) );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("No
current connections to %s.\n", p_hba->ioc_info.profile.id_string) );
 		goto exit;
 	}
 
-	SRP_TRACE( SRP_DBG_DEBUG, ("Current path to %s has been
lost.\n", p_hba->ioc_info.profile.id_string) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Current path
to %s has been lost.\n", p_hba->ioc_info.profile.id_string) );
 
 	p_hba->p_srp_path_record = NULL;
 
@@ -776,12 +776,12 @@
 
SP_UNTAGGED,
 
SP_UNTAGGED,
 
SRB_STATUS_BUSY );
-			SRP_TRACE( SRP_DBG_DEBUG, ("Pausing Adapter for
%s.\n", p_hba->ioc_info.profile.id_string) );
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("Pausing Adapter for %s.\n", p_hba->ioc_info.profile.id_string) );
 		}
 	}
 
 	/* Destroy all the connections. */
-	SRP_TRACE( SRP_DBG_DEBUG, ("Destroy all connections to %s.\n",
p_hba->ioc_info.profile.id_string) );
+	SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG, ("Destroy all
connections to %s.\n", p_hba->ioc_info.profile.id_string) );
 
 	for ( i = 0; i < p_hba->ioc_info.profile.num_svc_entries; i++ )
 	{
@@ -792,13 +792,13 @@
 
 		if ( p_session != NULL )
 		{
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Session Object
ref_cnt = %d\n", p_session->obj.ref_cnt) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Session Object ref_cnt = %d\n", p_session->obj.ref_cnt) );
 			__srp_cleanup_session ( &p_session->obj );
 			cl_obj_destroy( &p_session->obj );
 		}
 		else
 		{
-			SRP_TRACE( SRP_DBG_WARN,
+			SRP_PRINT(TRACE_LEVEL_WARNING,SRP_DBG_DEBUG,
 				("Session for Target ID %d on %s is
NULL.\n",
 				 i,
 				 p_hba->ioc_info.profile.id_string) );
// <-- OK in a shutdown or target disconnect
@@ -820,24 +820,24 @@
 
 	while ( g_srp_system_shutdown == FALSE )
 	{
-		SRP_TRACE( SRP_DBG_DEBUG, ("Searching for path to
%s.\n", p_hba->ioc_info.profile.id_string) );
+		SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("Searching for path to %s.\n", p_hba->ioc_info.profile.id_string) );
 
 		cl_spinlock_acquire( &p_hba->path_record_list_lock );
 		p_srp_path_record = (srp_path_record_t *)cl_qlist_head(
&p_hba->path_record_list );
 		cl_spinlock_release( &p_hba->path_record_list_lock );
 		if ( p_srp_path_record == (srp_path_record_t
*)cl_qlist_end( &p_hba->path_record_list ) )
 		{
-			SRP_TRACE( SRP_DBG_DEBUG, ("No paths to %s
found.\n", p_hba->ioc_info.profile.id_string) );
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("No paths to %s found.\n", p_hba->ioc_info.profile.id_string) );
 			break;
 		}
 
-		SRP_TRACE( SRP_DBG_VERBOSE, ("Connecting path to %s.\n",
p_hba->ioc_info.profile.id_string) );
+		SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Connecting path to %s.\n", p_hba->ioc_info.profile.id_string) );
 
 		p_hba->p_srp_path_record = p_srp_path_record;
 		status = __srp_connect_sessions( p_hba );
 		if ( status == IB_SUCCESS )
 		{
-			SRP_TRACE( SRP_DBG_DEBUG, ("Path to %s has
connected.\n", p_hba->ioc_info.profile.id_string) );
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("Path to %s has connected.\n", p_hba->ioc_info.profile.id_string) );
 			break;
 		}
 
@@ -872,7 +872,7 @@
 	switch( p_pnp_rec->pnp_event )
 	{
 		case IB_PNP_IOC_ADD:
-			SRP_TRACE( SRP_DBG_DEBUG, ("IB_PNP_IOC_ADD for
%s.\n", p_ioc_rec->info.profile.id_string) );
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("IB_PNP_IOC_ADD for %s.\n", p_ioc_rec->info.profile.id_string) );
 
 			__srp_dump_ioc_info( &p_ioc_rec->info );
 
@@ -882,7 +882,7 @@
 			 */
 			if( p_ioc_rec->ca_guid != p_hba->info.ca_guid )
 			{
-				SRP_TRACE_EXIT( SRP_DBG_WARN, ("Ignoring
CA GUID.\n") );
+				SRP_PRINT_EXIT(TRACE_LEVEL_WARNING
,SRP_DBG_DEBUG , ("Ignoring CA GUID.\n") );
 				status = IB_INVALID_GUID;
 				break;
 			}
@@ -890,7 +890,7 @@
 			/* Trap our IOC GUID so we can get path
notification events. */
 			if( p_ioc_rec->info.profile.ioc_guid !=
p_hba->info.guid )
 			{
-				SRP_TRACE_EXIT( SRP_DBG_WARN, ("Ignoring
GUID.\n") );
+				SRP_PRINT_EXIT(TRACE_LEVEL_WARNING
,SRP_DBG_DEBUG , ("Ignoring GUID.\n") );
 				status = IB_INVALID_GUID;
 				break;
 			}
@@ -905,7 +905,7 @@
 			p_hba->p_svc_entries = cl_zalloc(
sizeof(ib_svc_entry_t) * p_hba->ioc_info.profile.num_svc_entries );
 			if ( p_hba->p_svc_entries == NULL )
 			{
-				SRP_TRACE_EXIT( SRP_DBG_ERROR,
("Insufficient Memory.\n") );
+				SRP_PRINT_EXIT(TRACE_LEVEL_ERROR
,SRP_DBG_ERROR , ("Insufficient Memory.\n") );
 				status = IB_INSUFFICIENT_MEMORY;
 				break;
 			}
@@ -914,23 +914,23 @@
 
p_ioc_rec->svc_entry_array,
 						sizeof(ib_svc_entry_t) *
p_hba->ioc_info.profile.num_svc_entries);
 
-			SRP_TRACE( SRP_DBG_VERBOSE, ("Found %d Service
Entries.\n", p_hba->ioc_info.profile.num_svc_entries));
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("Found %d Service Entries.\n",
p_hba->ioc_info.profile.num_svc_entries));
 			break;
 
 		case IB_PNP_IOC_REMOVE:
-			SRP_TRACE( SRP_DBG_DEBUG, ("IB_PNP_IOC_REMOVE
for %s.\n", p_hba->ioc_info.profile.id_string) );
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("IB_PNP_IOC_REMOVE for %s.\n", p_hba->ioc_info.profile.id_string) );
 
 			CL_ASSERT( p_pnp_rec->guid == p_hba->info.guid
);
 
-			SRP_TRACE( SRP_DBG_DEBUG, ("Hey!!! Our IOC went
away.\n") );
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
("Hey!!! Our IOC went away.\n") );
 
 			__srp_disconnect_sessions( p_hba, FALSE );
 			__srp_remove_path_records( p_hba );
-			SRP_TRACE( SRP_DBG_VERBOSE, ("HBA Object ref_cnt
= %d\n", p_hba->obj.ref_cnt) );
+			SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
("HBA Object ref_cnt = %d\n", p_hba->obj.ref_cnt) );
 			break;
 
 		case IB_PNP_IOC_PATH_ADD:
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				("IB_PNP_IOC_PATH_ADD (slid:%d dlid:%d)
for %s.\n",
 				p_ioc_path->path.slid,
 				p_ioc_path->path.dlid,
@@ -945,13 +945,13 @@
 
 			if ( p_hba->p_srp_path_record == NULL )
 			{
-				SRP_TRACE( SRP_DBG_VERBOSE, ("Connecting
new path to %s.\n", p_hba->ioc_info.profile.id_string) );
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Connecting new path to
%s.\n", p_hba->ioc_info.profile.id_string) );
 				status = __srp_connect_path( p_hba );
 			}
 			break;
 
 		case IB_PNP_IOC_PATH_REMOVE:
-			SRP_TRACE( SRP_DBG_DEBUG,
+			SRP_PRINT(TRACE_LEVEL_INFORMATION,SRP_DBG_DEBUG,
 				("IB_PNP_IOC_PATH_REMOVE (slid:%d
dlid:%d) for %s.\n",
 				p_ioc_path->path.slid,
 				p_ioc_path->path.dlid,
@@ -962,7 +962,7 @@
 			{
 				if ( p_srp_path_record ==
p_hba->p_srp_path_record )
 				{
-					SRP_TRACE( SRP_DBG_VERBOSE,
+
SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG,
 						("Current path to %s has
been lost.\n",
 
p_hba->ioc_info.profile.id_string) );
 
Index: kernel/srp_hca.c
===================================================================
--- kernel/srp_hca.c	(revision 1647)
+++ kernel/srp_hca.c	(working copy)
@@ -68,32 +68,27 @@
 		h_al, p_port_gid, &p_hca->ca_guid );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to locate Channel Adapter. Status =
%d\n", status) );
 		goto exit;
 	}
 
-	status = p_hca->p_hba->ifc.open_ca( h_al,
-						 p_hca->ca_guid,
-
srp_async_event_handler_cb,
-						 p_context,
-						 &p_hca->h_ca );
+	status = p_hca->p_hba->ifc.open_ca( h_al, p_hca->ca_guid,
+		srp_async_event_handler_cb, p_context, &p_hca->h_ca );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to open Channel Adapter. Status =
%d\n", status) );
 		goto exit;
 	}
 
-	p_hca->initialized = TRUE;
-
 	status = p_hca->p_hba->ifc.alloc_pd( p_hca->h_ca,
 						  IB_PDT_NORMAL,
 						  p_context,
 						  &p_hca->h_pd );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Failed to create Protection Domain. Status =
%d\n", status) );
 		goto exit;
 	}
@@ -119,18 +114,11 @@
 						  &p_hca->h_mr );
 	if( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Physical Memory Registration Failure. Status =
%d\n", status) );
-	}
-
 exit:
-	if ( status != IB_SUCCESS )
-	{
-		if ( p_hca->initialized == TRUE )
-		{
 			srp_close_ca( p_hca );
 		}
-	}
 
 	SRP_EXIT( SRP_DBG_PNP );
 
@@ -138,43 +126,6 @@
 }
 
 
-/* srp_close_ca_cb */
-/*!
-Notifies StorPort when CA has closed
-
- at param p_context - session being closed
-
- at return - none
-*/
-void
-srp_close_ca_cb(
-	IN void *p_context)
-{
-	srp_session_t       *p_srp_session = (srp_session_t *)p_context;
-	SCSI_REQUEST_BLOCK  *p_srb         =
p_srp_session->p_shutdown_srb;
-
-	SRP_ENTER( SRP_DBG_PNP );
-
-	if ( p_srb != NULL )
-	{
-		p_srb->SrbStatus = SRB_STATUS_SUCCESS;
-		SRP_TRACE( SRP_DBG_DEBUG,
-				   ("Returning SrbStatus %s(0x%x) for
Function = %s(0x%x), Path = 0x%x, Target = 0x%x, Lun = 0x%x\n",
-				   g_srb_status_name[p_srb->SrbStatus],
-				   p_srb->SrbStatus,
-				   g_srb_function_name[p_srb->Function],
-				   p_srb->Function,
-				   p_srb->PathId,
-				   p_srb->TargetId,
-				   p_srb->Lun) );
-		StorPortNotification( RequestComplete,
p_srp_session->p_hba->p_ext, p_srb );
-	}
-
-	cl_event_signal( &p_srp_session->hca.hca_destroyed_event );
-
-	SRP_EXIT( SRP_DBG_PNP );
-}
-
 /* srp_close_ca */
 /*!
 Closes the channel adapter
@@ -189,36 +140,15 @@
 {
 	SRP_ENTER( SRP_DBG_PNP );
 
-	if ( p_hca->initialized == TRUE )
+	if( p_hca->h_ca )
 	{
-		cl_status_t cl_status;
+		p_hca->p_hba->ifc.close_ca( p_hca->h_ca, ib_sync_destroy
);
+		SRP_PRINT( TRACE_LEVEL_INFORMATION ,SRP_DBG_DEBUG,
("Closed Channel Adapter.\n") );
 
-		SRP_TRACE( SRP_DBG_DEBUG, ("Closing Channel Adapter.\n")
);
 
-		cl_status = cl_event_init( &p_hca->hca_destroyed_event,
TRUE );
-		if ( cl_status != CL_SUCCESS )
-		{
-			SRP_TRACE( SRP_DBG_ERROR, ("Cannot Initialize
HCA Destroyed Event. Status = %d\n", cl_status) );
-			p_hca->p_hba->ifc.close_ca( p_hca->h_ca, NULL );
 		}
-		else
-		{
-			p_hca->p_hba->ifc.close_ca( p_hca->h_ca,
srp_close_ca_cb );
 
-			cl_status = cl_event_wait_on(
&p_hca->hca_destroyed_event, EVENT_NO_TIMEOUT, FALSE );
-			if ( cl_status != CL_SUCCESS )
-			{
-				SRP_TRACE( SRP_DBG_ERROR, ("Wait On HCA
Destroyed Event Failed. Status = %d\n", cl_status) );
-			}
-
-			cl_event_destroy( &p_hca->hca_destroyed_event );
-		}
-
-		SRP_TRACE( SRP_DBG_DEBUG,
-			("Closed Channel Adapter.\n") );
-
 		cl_memclr( p_hca, sizeof( *p_hca ) );
-	}
 
 	SRP_EXIT( SRP_DBG_PNP );
 }
@@ -247,7 +177,7 @@
 	status = p_hca->p_hba->ifc.query_ca( p_hca->h_ca, NULL,
&ca_attr_size );
 	if ( status != IB_INSUFFICIENT_MEMORY )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Query Channel Adapter. Status = %d\n",
status) );
 		goto exit;
 	}
@@ -255,7 +185,7 @@
 	p_ca_attr = cl_zalloc( ca_attr_size );
 	if ( p_ca_attr == NULL )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 				   ("Memory Allocation Error: Cannot
Create CA Attributes.\n") );
 		goto exit;
 	}
@@ -263,7 +193,7 @@
 	status = p_hca->p_hba->ifc.query_ca( p_hca->h_ca, p_ca_attr,
&ca_attr_size );
 	if ( status != IB_SUCCESS )
 	{
-		SRP_TRACE( SRP_DBG_ERROR,
+		SRP_PRINT(TRACE_LEVEL_ERROR,SRP_DBG_ERROR,
 			("Cannot Query Channel Adapter. Status = %d\n",
status) );
 	}
 	else
@@ -296,7 +226,6 @@
 
 	cl_memclr( p_hca, sizeof( *p_hca ) );
 
-	p_hca->initialized = FALSE;
 	p_hca->p_hba = p_hba;
 
 	SRP_EXIT( SRP_DBG_PNP );
@@ -304,18 +233,3 @@
 	return ( IB_SUCCESS );
 }
 
-/* srp_free_hca */
-/*!
-Frees hca resources
-
- at param p_hca  - pointer to the hca structure
-
- at return -  none
-*/
-void
-srp_free_hca(
-	IN OUT  srp_hca_t   *p_hca  )
-{
-	cl_memclr( p_hca, sizeof( *p_hca ) );
-}
-
Index: kernel/srp_hca.h
===================================================================
--- kernel/srp_hca.h	(revision 1647)
+++ kernel/srp_hca.h	(working copy)
@@ -40,7 +40,6 @@
 
 typedef struct _srp_hca
 {
-	BOOLEAN					initialized;
 	srp_hba_t				*p_hba;
 
 	ib_net64_t				ca_guid;
@@ -50,7 +49,6 @@
 	uint64_t				vaddr;
 	net32_t					lkey;
 	net32_t					rkey;
-	cl_event_t				hca_destroyed_event;
 
 }	srp_hca_t;
 
@@ -75,8 +73,4 @@
 	IN	OUT			srp_hca_t
*p_hca,
 	IN				srp_hba_t
*p_hba );
 
-void
-srp_free_hca(
-	IN	OUT			srp_hca_t
*p_hca  );
-
 #endif  /* _SRP_HCA_H_ */
Index: kernel/srp_session.c
===================================================================
--- kernel/srp_session.c	(revision 1647)
+++ kernel/srp_session.c	(working copy)
@@ -54,7 +54,7 @@
 
 	p_srp_session->connection.state = SRP_CONNECTION_CLOSING;
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Session Object ref_cnt = %d\n",
p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 
 	SRP_EXIT( SRP_DBG_PNP );
 }
@@ -81,11 +81,27 @@
 
 	srp_close_ca( &p_srp_session->hca );
 
+	if ( p_srp_session->p_shutdown_srb != NULL )
+	{
+		p_srp_session->p_shutdown_srb->SrbStatus =
SRB_STATUS_SUCCESS;
+		SRP_PRINT(TRACE_LEVEL_INFORMATION , SRP_DBG_DEBUG,
+			("Returning SrbStatus %s(0x%x) for Function =
%s(0x%x), "
+			"Path = 0x%x, Target = 0x%x, Lun = 0x%x\n",
+
g_srb_status_name[p_srp_session->p_shutdown_srb->SrbStatus],
+			p_srp_session->p_shutdown_srb->SrbStatus,
+
p_srp_session->p_shutdown_srb[p_srp_session->p_shutdown_srb->Function],
+			p_srp_session->p_shutdown_srb->Function,
+			p_srp_session->p_shutdown_srb->PathId,
+			p_srp_session->p_shutdown_srb->TargetId,
+			p_srp_session->p_shutdown_srb->Lun) );
+		StorPortNotification( RequestComplete,
p_srp_session->p_hba->p_ext,
+			p_srp_session->p_shutdown_srb );
+	}
+
 	srp_free_connection( &p_srp_session->connection );
 	srp_destroy_descriptors( &p_srp_session->descriptors );
-	srp_free_hca( &p_srp_session->hca );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Session Object ref_cnt = %d\n",
p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 
 	SRP_EXIT( SRP_DBG_PNP );
 }
@@ -109,11 +125,11 @@
 
 	p_srp_session = PARENT_STRUCT( p_obj, srp_session_t, obj );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("Before DeInit Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("Before DeInit
Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 
 	cl_obj_deinit( p_obj );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("After DeInit Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("After DeInit
Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 
 	cl_free( p_srp_session );
 
@@ -146,7 +162,7 @@
 
 	if ( cl_memcmp( p_svc_entry->name, SRP_SERVICE_NAME_PREFIX,
strlen(SRP_SERVICE_NAME_PREFIX)) != 0 )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("Service Name Not Properly Formatted.\n") );
 		status = IB_INVALID_SERVICE_TYPE;
 		goto exit;
@@ -171,7 +187,7 @@
 		ntstatus = RtlCharToInteger( current_digit, 16,
&id_extension );
 		if ( ntstatus != STATUS_SUCCESS )
 		{
-			SRP_TRACE_EXIT( SRP_DBG_ERROR,
+			SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR
,
 				("Target Id Extension INVALID.\n") );
 			status = IB_INVALID_PARAMETER;
 			break;
@@ -222,7 +238,7 @@
 	p_srp_session = (srp_session_t*)cl_zalloc( sizeof(srp_session_t)
);
 	if ( p_srp_session == NULL )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("Failed to allocate srp_session_t
structure.\n") );
 		*p_status = IB_INSUFFICIENT_MEMORY;
 		goto exit;
@@ -245,16 +261,16 @@
 	}
 
 	cl_obj_construct( &p_srp_session->obj, SRP_OBJ_TYPE_SESSION );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("After Construct Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("After Construct
Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 	cl_status = cl_obj_init( &p_srp_session->obj,
 
CL_DESTROY_ASYNC,
 
__srp_destroying_session,
 
__srp_cleanup_session,
 
__srp_free_session );
-	SRP_TRACE( SRP_DBG_VERBOSE, ("After Init Session Object ref_cnt
= %d\n", p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("After Init
Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 	if( cl_status != CL_SUCCESS )
 	{
-		SRP_TRACE_EXIT( SRP_DBG_ERROR,
+		SRP_PRINT_EXIT(TRACE_LEVEL_ERROR ,SRP_DBG_ERROR ,
 			("cl_obj_init returned %s\n",
cl_status_text[cl_status]) );
 
 		cl_free( p_srp_session );
@@ -267,7 +283,7 @@
 					   &p_srp_session->p_hba->obj,
 					   &p_srp_session->obj );
 
-	SRP_TRACE( SRP_DBG_VERBOSE, ("After Insert Rel Session Object
ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
+	SRP_PRINT(TRACE_LEVEL_VERBOSE,SRP_DBG_DEBUG, ("After Insert Rel
Session Object ref_cnt = %d\n", p_srp_session->obj.ref_cnt) );
 
 exit:
 	SRP_EXIT( SRP_DBG_PNP );
@@ -302,24 +318,15 @@
 
&p_srp_session->p_hba->p_srp_path_record->path_rec.sgid,
 
p_srp_session );
 	if ( status != IB_SUCCESS )
-	{
-		srp_free_hca( &p_srp_session->hca );
 		goto exit;
-	}
 
 	status = srp_connect( &p_srp_session->connection,
 						  &p_srp_session->hca,
 						  1, /*
initiator_extension */
 
(uint8_t)p_srp_session->p_hba->ioc_info.profile.send_msg_depth,
 						  p_srp_session );
-	if ( status != IB_SUCCESS )
-	{
-		srp_free_hca( &p_srp_session->hca );
-	}
 
 exit:
-
 	SRP_EXIT( SRP_DBG_PNP );
-
 	return ( status );
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: srp_wpp.patch
Type: application/octet-stream
Size: 91640 bytes
Desc: srp_wpp.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060904/9207fafc/attachment.obj>


More information about the ofw mailing list