From: leonidk Date: Wed, 5 Sep 2007 15:38:08 +0000 (+0000) Subject: [ALL] map cl_status_t type to NTSTATUS type (only for kernel) X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2580e3550d2be166470bb109fc3f5210d93127af;p=~shefty%2Frdma-win.git [ALL] map cl_status_t type to NTSTATUS type (only for kernel) git-svn-id: svn://openib.tc.cornell.edu/gen1@779 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- diff --git a/branches/Ndi/core/al/kernel/al_cm_cep.c b/branches/Ndi/core/al/kernel/al_cm_cep.c index 51ea1c31..3f67262f 100644 --- a/branches/Ndi/core/al/kernel/al_cm_cep.c +++ b/branches/Ndi/core/al/kernel/al_cm_cep.c @@ -3293,8 +3293,8 @@ create_cep_mgr( { gp_cep_mgr->obj.pfn_destroy( &gp_cep_mgr->obj, NULL ); AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_vector_init failed with status %s.\n", - CL_STATUS_MSG(cl_status)) ); + ("cl_vector_init failed with status %#x.\n", + cl_status) ); return ib_convert_cl_status( cl_status ); } diff --git a/branches/Ndi/core/al/kernel/al_ioc_pnp.c b/branches/Ndi/core/al/kernel/al_ioc_pnp.c index 0970e61a..b175de85 100644 --- a/branches/Ndi/core/al/kernel/al_ioc_pnp.c +++ b/branches/Ndi/core/al/kernel/al_ioc_pnp.c @@ -717,7 +717,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -725,7 +725,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -733,7 +733,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -743,7 +743,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_qpool_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_qpool_init returned %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -752,7 +752,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_qpool_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_qpool_init returned %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -761,7 +761,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_qpool_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_qpool_init returned %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -771,7 +771,7 @@ __init_ioc_pnp( if( cl_status != CL_SUCCESS ) { AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_timer_init failed with %s\n", cl_status_text[cl_status]) ); + ("cl_timer_init failed with %#x\n", cl_status) ); return ib_convert_cl_status( cl_status ); } diff --git a/branches/Ndi/core/al/kernel/al_pnp.c b/branches/Ndi/core/al/kernel/al_pnp.c index df7dffa5..4ec7da20 100644 --- a/branches/Ndi/core/al/kernel/al_pnp.c +++ b/branches/Ndi/core/al/kernel/al_pnp.c @@ -203,8 +203,8 @@ create_pnp( { __pnp_free( &gp_pnp->obj ); AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_ptr_vector_init failed with status %s.\n", - CL_STATUS_MSG( cl_status )) ); + ("cl_ptr_vector_init failed with status %#x.\n", + cl_status) ); return IB_ERROR; } @@ -1184,8 +1184,8 @@ pnp_ca_event( { cl_free( p_event_rec ); AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, - ("cl_ptr_vector_set_size failed with status %s.\n", - CL_STATUS_MSG( cl_status )) ); + ("cl_ptr_vector_set_size failed with status %#x.\n", + cl_status) ); return ib_convert_cl_status( cl_status ); } diff --git a/branches/Ndi/core/bus/kernel/bus_iou_mgr.c b/branches/Ndi/core/bus/kernel/bus_iou_mgr.c index 81ce2cdd..7a9e4a88 100644 --- a/branches/Ndi/core/bus/kernel/bus_iou_mgr.c +++ b/branches/Ndi/core/bus/kernel/bus_iou_mgr.c @@ -305,7 +305,7 @@ create_iou_mgr( { free_iou_mgr( &gp_iou_mgr->obj ); BUS_TRACE_EXIT( BUS_DBG_ERROR, - ("cl_mutex_init returned %s.\n", cl_status_text[cl_status]) ); + ("cl_mutex_init returned %#x.\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -316,7 +316,7 @@ create_iou_mgr( { free_iou_mgr( &gp_iou_mgr->obj ); BUS_TRACE_EXIT( BUS_DBG_ERROR, - ("cl_obj_init returned %s.\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x.\n", cl_status) ); return ib_convert_cl_status( cl_status ); } diff --git a/branches/Ndi/core/bus/kernel/bus_port_mgr.c b/branches/Ndi/core/bus/kernel/bus_port_mgr.c index 704e2eb0..4bee7c10 100644 --- a/branches/Ndi/core/bus/kernel/bus_port_mgr.c +++ b/branches/Ndi/core/bus/kernel/bus_port_mgr.c @@ -299,7 +299,7 @@ create_port_mgr( { free_port_mgr( &gp_port_mgr->obj ); BUS_TRACE_EXIT( BUS_DBG_ERROR, - ("cl_mutex_init returned %s.\n", cl_status_text[cl_status]) ); + ("cl_mutex_init returned %#x.\n", cl_status) ); return ib_convert_cl_status( cl_status ); } @@ -310,7 +310,7 @@ create_port_mgr( { free_port_mgr( &gp_port_mgr->obj ); BUS_TRACE_EXIT( BUS_DBG_ERROR, - ("cl_obj_init returned %s.\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x.\n", cl_status) ); return ib_convert_cl_status( cl_status ); } diff --git a/branches/Ndi/core/complib/kernel/cl_driver.c b/branches/Ndi/core/complib/kernel/cl_driver.c index 2efa9876..d587cdee 100644 --- a/branches/Ndi/core/complib/kernel/cl_driver.c +++ b/branches/Ndi/core/complib/kernel/cl_driver.c @@ -48,7 +48,7 @@ cl_to_ntstatus( case CL_INVALID_OPERATION: return STATUS_NOT_SUPPORTED; case CL_INVALID_SETTING: - return STATUS_INVALID_PARAMETER_1; + return STATUS_INVALID_PARAMETER_MIX; case CL_INVALID_PARAMETER: return STATUS_INVALID_PARAMETER; case CL_INSUFFICIENT_RESOURCES: diff --git a/branches/Ndi/core/iou/kernel/iou_ioc_mgr.c b/branches/Ndi/core/iou/kernel/iou_ioc_mgr.c index eb313641..b3356a28 100644 --- a/branches/Ndi/core/iou/kernel/iou_ioc_mgr.c +++ b/branches/Ndi/core/iou/kernel/iou_ioc_mgr.c @@ -290,7 +290,7 @@ ioc_mgr_init( { free_ioc_mgr( &p_ioc_mgr->obj ); IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, - ("cl_mutex_init returned %s.\n", cl_status_text[cl_status]) ); + ("cl_mutex_init returned %#x.\n", cl_status) ); return IB_ERROR; } @@ -301,7 +301,7 @@ ioc_mgr_init( { free_ioc_mgr( &p_ioc_mgr->obj ); IOU_PRINT_EXIT( TRACE_LEVEL_ERROR, IOU_DBG_ERROR, - ("cl_obj_init returned %s.\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x.\n", cl_status) ); return IB_ERROR; } diff --git a/branches/Ndi/hw/mt23108/kernel/hca_driver.c b/branches/Ndi/hw/mt23108/kernel/hca_driver.c index bc2de2f1..39a1eba6 100644 --- a/branches/Ndi/hw/mt23108/kernel/hca_driver.c +++ b/branches/Ndi/hw/mt23108/kernel/hca_driver.c @@ -291,7 +291,7 @@ DriverEntry( { CL_DEINIT; HCA_TRACE_EXIT( HCA_DBG_ERROR, - ("mlnx_hobs_init returned %s.\n", cl_status_text[cl_status]) ); + ("mlnx_hobs_init returned %#x.\n", cl_status) ); return cl_to_ntstatus( cl_status ); } // cl_memclr( mlnx_hca_array, MLNX_MAX_HCA * sizeof(ci_interface_t) ); @@ -422,8 +422,8 @@ hca_add_device( //{ // IoDeleteDevice( p_dev_obj ); // HCA_TRACE_EXIT( HCA_DBG_ERROR, - // ("cl_mutex_init returned %s.\n", cl_status_text[status]) ); - // return cl_to_ntstatus( status ); + // ("cl_mutex_init returned %#x.\n", cl_status) ); + // return cl_to_ntstatus( cl_status ); //} //cl_event_signal( &p_ext->mutex ); diff --git a/branches/Ndi/hw/mthca/kernel/hca_driver.c b/branches/Ndi/hw/mthca/kernel/hca_driver.c index a91abe59..417da7e3 100644 --- a/branches/Ndi/hw/mthca/kernel/hca_driver.c +++ b/branches/Ndi/hw/mthca/kernel/hca_driver.c @@ -196,7 +196,7 @@ DriverEntry( if( cl_status != CL_SUCCESS ) { HCA_PRINT( TRACE_LEVEL_ERROR ,HCA_DBG_INIT , - ("mlnx_hcas_init returned %s.\n", cl_status_text[cl_status])); + ("mlnx_hcas_init returned %#x.\n", cl_status)); return cl_to_ntstatus( cl_status ); } // cl_memclr( mlnx_hca_array, MLNX_MAX_HCA * sizeof(ci_interface_t) ); diff --git a/branches/Ndi/inc/complib/cl_types.h b/branches/Ndi/inc/complib/cl_types.h index 5e43f54d..fa4e4df1 100644 --- a/branches/Ndi/inc/complib/cl_types.h +++ b/branches/Ndi/inc/complib/cl_types.h @@ -249,6 +249,37 @@ typedef uint64_t net64_t; * * SYNOPSIS */ +#ifdef CL_KERNEL + +typedef enum _cl_status +{ + CL_SUCCESS = STATUS_SUCCESS, + CL_ERROR = STATUS_DRIVER_INTERNAL_ERROR, + CL_INVALID_STATE = STATUS_INVALID_DEVICE_STATE, + CL_INVALID_OPERATION = STATUS_NOT_SUPPORTED, + CL_INVALID_SETTING = STATUS_INVALID_PARAMETER_MIX, + CL_INVALID_PARAMETER = STATUS_INVALID_PARAMETER, + CL_INSUFFICIENT_RESOURCES = STATUS_INSUFFICIENT_RESOURCES, + CL_INSUFFICIENT_MEMORY = STATUS_NO_MEMORY, + CL_INVALID_PERMISSION = STATUS_ACCESS_DENIED, + CL_COMPLETED = STATUS_EVENT_DONE, + CL_NOT_DONE = STATUS_ABANDONED, + CL_PENDING = STATUS_PENDING, + CL_TIMEOUT = STATUS_TIMEOUT, + CL_CANCELED = STATUS_CANCELLED, + CL_REJECT = STATUS_REQUEST_NOT_ACCEPTED, + CL_OVERRUN = STATUS_DATA_OVERRUN, + CL_NOT_FOUND = STATUS_NOT_FOUND, + CL_UNAVAILABLE = STATUS_DEVICE_NOT_READY, + CL_BUSY = STATUS_DEVICE_BUSY, + CL_DISCONNECT = STATUS_LOCAL_DISCONNECT, + CL_DUPLICATE = STATUS_DUPLICATE_NAME, + CL_INVALID_REQUEST = STATUS_INVALID_DEVICE_REQUEST + +} cl_status_t; + +#else + typedef enum _cl_status { CL_SUCCESS = 0, @@ -277,6 +308,9 @@ typedef enum _cl_status CL_STATUS_COUNT /* should be the last value */ } cl_status_t; + +#endif + /* * SEE ALSO * Data Types, CL_STATUS_MSG @@ -289,9 +323,10 @@ extern "C" #endif /* __cplusplus */ +#ifndef CL_KERNEL /* Status values above converted to text for easier printing. */ CL_EXPORT const char* cl_status_text[CL_STATUS_COUNT]; - +#endif #ifndef cl_panic /****f* Component Library: Error Trapping/cl_panic diff --git a/branches/Ndi/tests/alts/createanddestroycq.c b/branches/Ndi/tests/alts/createanddestroycq.c index 778033c1..2867af77 100644 --- a/branches/Ndi/tests/alts/createanddestroycq.c +++ b/branches/Ndi/tests/alts/createanddestroycq.c @@ -146,8 +146,8 @@ alts_cq( if( cl_status != CL_SUCCESS ) { ALTS_PRINT( ALTS_DBG_ERROR, - ("cl_event_init returned status %s\n", - cl_status_text[cl_status]) ); + ("cl_event_init returned status %#x\n", + cl_status) ); break; } cq_create.h_wait_obj = &cq_event; diff --git a/branches/Ndi/ulp/ipoib/kernel/ipoib_adapter.c b/branches/Ndi/ulp/ipoib/kernel/ipoib_adapter.c index 27e0cb18..fdcd379f 100644 --- a/branches/Ndi/ulp/ipoib/kernel/ipoib_adapter.c +++ b/branches/Ndi/ulp/ipoib/kernel/ipoib_adapter.c @@ -180,7 +180,7 @@ ipoib_create_adapter( { __adapter_free( &p_adapter->obj ); IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_obj_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -299,7 +299,7 @@ adapter_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_perf_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_perf_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -307,7 +307,7 @@ adapter_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -315,7 +315,7 @@ adapter_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -324,7 +324,7 @@ adapter_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_qpool_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_qpool_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -335,8 +335,8 @@ adapter_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_vector_init for ip_vector returned %s\n", - CL_STATUS_MSG(cl_status)) ); + ("cl_vector_init for ip_vector returned %#x\n", + cl_status) ); return IB_ERROR; } diff --git a/branches/Ndi/ulp/ipoib/kernel/ipoib_driver.c b/branches/Ndi/ulp/ipoib/kernel/ipoib_driver.c index 6c7daef0..540c9b7e 100644 --- a/branches/Ndi/ulp/ipoib/kernel/ipoib_driver.c +++ b/branches/Ndi/ulp/ipoib/kernel/ipoib_driver.c @@ -2127,8 +2127,8 @@ __ipoib_set_net_addr( cl_obj_unlock( &p_adapter->obj ); IPOIB_PRINT(TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, ("Port %d - OID_GEN_NETWORK_LAYER_ADDRESSES - " - "Failed to set IP vector capacity: %s\n", port_num, - CL_STATUS_MSG(cl_status)) ); + "Failed to set IP vector capacity: %#x\n", port_num, + cl_status) ); IPOIB_EXIT( IPOIB_DBG_OID ); return NDIS_STATUS_RESOURCES; } diff --git a/branches/Ndi/ulp/ipoib/kernel/ipoib_port.c b/branches/Ndi/ulp/ipoib/kernel/ipoib_port.c index 8a5898d2..787d2d37 100644 --- a/branches/Ndi/ulp/ipoib/kernel/ipoib_port.c +++ b/branches/Ndi/ulp/ipoib/kernel/ipoib_port.c @@ -601,7 +601,7 @@ __port_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -609,7 +609,7 @@ __port_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_spinlock_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_spinlock_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -666,7 +666,7 @@ __port_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_obj_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x\n", cl_status) ); return IB_ERROR; } @@ -674,7 +674,7 @@ __port_init( if( cl_status != CL_SUCCESS ) { IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_obj_insert_rel returned %s\n", cl_status_text[cl_status]) ); + ("cl_obj_insert_rel returned %#x\n", cl_status) ); cl_obj_destroy( &p_port->obj ); return IB_ERROR; } @@ -998,8 +998,8 @@ __buf_mgr_init( NdisWriteErrorLogEntry( p_port->p_adapter->h_adapter, EVENT_IPOIB_RECV_POOL, 1, cl_status ); IPOIB_PRINT_EXIT( TRACE_LEVEL_ERROR, IPOIB_DBG_ERROR, - ("cl_qpool_init for recvs returned %s\n", - cl_status_text[cl_status]) ); + ("cl_qpool_init for recvs returned %#x\n", + cl_status) ); return IB_INSUFFICIENT_MEMORY; } diff --git a/branches/Ndi/ulp/srp/kernel/srp_hba.c b/branches/Ndi/ulp/srp/kernel/srp_hba.c index f760ce0d..09d69c49 100644 --- a/branches/Ndi/ulp/srp/kernel/srp_hba.c +++ b/branches/Ndi/ulp/srp/kernel/srp_hba.c @@ -239,7 +239,7 @@ srp_hba_create( if( cl_status != CL_SUCCESS ) { SRP_PRINT_EXIT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR, - ("cl_obj_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x\n", cl_status) ); return IB_ERROR; } diff --git a/branches/Ndi/ulp/srp/kernel/srp_session.c b/branches/Ndi/ulp/srp/kernel/srp_session.c index d2deb56d..502e4d7b 100644 --- a/branches/Ndi/ulp/srp/kernel/srp_session.c +++ b/branches/Ndi/ulp/srp/kernel/srp_session.c @@ -291,7 +291,7 @@ srp_new_session( if( cl_status != CL_SUCCESS ) { SRP_PRINT_EXIT( TRACE_LEVEL_ERROR, SRP_DBG_ERROR, - ("cl_obj_init returned %s\n", cl_status_text[cl_status]) ); + ("cl_obj_init returned %#x\n", cl_status) ); cl_free( p_srp_session ); p_srp_session = NULL;