Hello NG,

I am currently testing our self-developed USB device driver. It works fine
on most machines. However on a few machines it seems as if a reading
operation which has been passed down the stack does not return. Meaning the
completion routine is never called and therefore the IRP is never completed.
As my application is performing synchronous IO-operation on the device my
application hangs up and can be ended only by killing it through the task
manager. I found this strange driver behaviour by implementing several debug
traces in a checked version of the driver and watching that traces with
debug view. Debugging the driver with WinDBG also did not bring anything
new. Here a short code snippet how I pass down the IRP to the lower driver:

//***************************************************************************************************************************************
pNextStack=IoGetNextIrpStackLocation(pIrp);

pNextStack->MajorFunction=IRP_MJ_INTERNAL_DEVICE_CONTROL;

pNextStack->Parameters.Others.Argument1=(PVOID)pUrb;

pNextStack->Parameters.DeviceIoControl.IoControlCode=IOCTL_INTERNAL_USB_SUBMIT_URB;

IoSetCompletionRoutine(pIrp, ReadCompletion, pReadContext, TRUE, TRUE,
TRUE);

IoMarkIrpPending(pIrp);

ntStatus=IoCallDriver(pDeviceInfo->pNextDeviceObject, pIrp);

return STATUS_PENDING;
//***************************************************************************************************************************************

What can be the reason for not getting the IRP completed? Any ideas?

Thanks in advance

Benji

Re: USB communication hangs by Tim

Tim
Tue Jun 05 01:21:54 CDT 2007

"Benji" <benji@community.nospam> wrote:
>
>I am currently testing our self-developed USB device driver. It works fine
>on most machines. However on a few machines it seems as if a reading
>operation which has been passed down the stack does not return. Meaning the
>completion routine is never called and therefore the IRP is never completed.

Are you sure the device is actually supplying enough data to satisfy the
URB? Remember that a bulk URB will wait until the entire read is
satisfied.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Re: USB communication hangs by Marc

Marc
Wed Jun 06 14:55:19 CDT 2007

> Remember that a bulk URB will wait until the entire read is satisfied.

Or possibly a short packet.

Also, be careful how you handle transfers that are a multiple of
MaxPacketSize.

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics


"Tim Roberts" <timr@probo.com> wrote in message
news:170a631pk44qo37q2smth1m95cpeg9qcgt@4ax.com...
> "Benji" <benji@community.nospam> wrote:
>>
>>I am currently testing our self-developed USB device driver. It works fine
>>on most machines. However on a few machines it seems as if a reading
>>operation which has been passed down the stack does not return. Meaning
>>the
>>completion routine is never called and therefore the IRP is never
>>completed.
>
> Are you sure the device is actually supplying enough data to satisfy the
> URB? Remember that a bulk URB will wait until the entire read is
> satisfied.
> --
> Tim Roberts, timr@probo.com
> Providenza & Boekelheide, Inc.