#pragma warning(disable:4706)
static inline void __ndi_flush_que(
- IN ib_cq_handle_t h_cq,
- IN PIO_CSQ Csq,
+ IN ndi_io_csq_t* p_ndi_csq,
IN NTSTATUS completion_code
)
{
PIRP Irp;
- while( Irp = IoCsqRemoveNextIrp( Csq, NULL ) )
+ while( Irp = IoCsqRemoveNextIrp( &p_ndi_csq->csq, NULL ) )
{
cl_ioctl_complete( Irp, completion_code, 0 );
- deref_al_obj( &h_cq->obj );
+ deref_al_obj( &p_ndi_csq->h_cq->obj );
}
}
#pragma warning(default:4706)
{
UNUSED_PARAM( cq_context );
AL_ENTER( AL_DBG_NDI );
- __ndi_flush_que( h_cq, (PIO_CSQ)&h_cq->compl, STATUS_SUCCESS );
+ __ndi_flush_que( &h_cq->compl, STATUS_SUCCESS );
AL_EXIT( AL_DBG_NDI );
}
{
ib_cq_handle_t h_cq = p_err_rec->handle.h_cq;
AL_ENTER( AL_DBG_NDI );
- __ndi_flush_que( h_cq, (PIO_CSQ)&h_cq->compl, STATUS_INTERNAL_ERROR );
- __ndi_flush_que( h_cq, (PIO_CSQ)&h_cq->error, STATUS_INTERNAL_ERROR );
+ __ndi_flush_que( &h_cq->compl, STATUS_INTERNAL_ERROR );
+ __ndi_flush_que( &h_cq->error, STATUS_INTERNAL_ERROR );
AL_EXIT( AL_DBG_NDI );
}
AL_ENTER( AL_DBG_NDI );
if ( h_cq->pfn_user_comp_cb == __ndi_cq_compl_cb )
{
- __ndi_flush_que( h_cq, (PIO_CSQ)&h_cq->compl, STATUS_CANCELLED );
- __ndi_flush_que( h_cq, (PIO_CSQ)&h_cq->error, STATUS_CANCELLED );
+ __ndi_flush_que( &h_cq->compl, STATUS_CANCELLED );
+ __ndi_flush_que( &h_cq->error, STATUS_CANCELLED );
}
AL_EXIT( AL_DBG_NDI );
}
/* for now PeekContext is not used */
}
else
+ {
break;
+ }
nextIrp = NULL;
nextEntry = nextEntry->Flink;
AL_EXIT( AL_DBG_NDI );
}
-static NTSTATUS
-__ndi_init(
+NTSTATUS
+proxy_ndi_init(
IN ib_cq_handle_t h_cq )
{
AL_ENTER( AL_DBG_NDI );
- status = IoCsqInitialize( (PIO_CSQ)&h_cq->compl,
+ status = IoCsqInitialize( &h_cq->compl.csq,
__ndi_insert_irp, __ndi_remove_irp,
__ndi_peek_next_irp, __ndi_acquire_lock,
__ndi_release_lock, __ndi_complete_cancelled_irp );
if ( !NT_SUCCESS( status ) )
goto exit;
- status = IoCsqInitialize( (PIO_CSQ)&h_cq->error,
+ status = IoCsqInitialize( &h_cq->error.csq,
__ndi_insert_irp, __ndi_remove_irp,
__ndi_peek_next_irp, __ndi_acquire_lock,
__ndi_release_lock, __ndi_complete_cancelled_irp );
******************************************************************/
/*
- * Process the ioctl UAL_CREATE_CQ:
+ * Process the ioctl UAL_NDI_CREATE_CQ:
*/
static cl_status_t
__ndi_create_cq(
if( status != IB_SUCCESS )
goto proxy_create_cq_err2;
- if( !NT_SUCCESS( __ndi_init( h_cq ) ) )
- {
- status = IB_ERROR;
- goto proxy_create_cq_err3;
- }
-
status = cpyout_umvbuf( &p_ioctl->out.umv_buf, p_umv_buf );
if( status == IB_SUCCESS )
{
}
else
{
-proxy_create_cq_err3:
h_cq->obj.pfn_destroy( &h_cq->obj, NULL );
proxy_create_cq_err2:
/* enqueue the IRP */
ref_al_obj( &h_cq->obj );
if (p_ioctl->notify_type == NdCqNotifyErrors)
- IoCsqInsertIrp( (PIO_CSQ)&h_cq->error, h_ioctl, NULL );
+ IoCsqInsertIrp( &h_cq->error.csq, h_ioctl, NULL );
else
- IoCsqInsertIrp( (PIO_CSQ)&h_cq->compl, h_ioctl, NULL );
+ IoCsqInsertIrp( &h_cq->compl.csq, h_ioctl, NULL );
*p_ret_bytes = 0;
cl_status = CL_PENDING;