Problem in Continuous reader.

HI,

I’m trying to configure a continuous reader for an interrupt endpoint in an USB device.
When I use the following function,
status = WdfUsbTargetPipeConfigContinuousReader(
DevContext->UsbInterruptPipe,
&interruptConfig)

I’m getting an invalid status. I used WdfUsbInterfaceGetConfiguredPipe() to get an handle to the pipe object. When using a debugger, I can see that it returns a valid handle but I don’t know why the continuous reader is failing.Is continuous reader supported in WDF for Interrupt endpoint?. If it is plz advice me on what I should do to get this working.
The driver is running on a Vista platform.
Thanx in advance…

Should I have initialized “interruptConfig.NumPendingReads” before calling WdfUsbTargetPipeConfigContinuousReader()??. As of now its showing zero.

Did you initialize your &interruptConfig struct with the initialization macro first?

Hi Chris,
I did initialize &interruptConfig with the macro. Even if I set the NumPendingReads, WdfUsbTargetPipeConfigContinuousReader() still fails. I am using WdfIOTargetStart in EvtDeviceD0Entry() and WdfIOTargetStop in EvtDeviceD0Exit().

What is the exact NTSTATUS value that are you getting back from WdfUsbTargetPipeConfigContinuousReader()? after the error, what does !wdfkd.wdflogdump say?

d

Hi doron,

WdfUsbTargetPipeConfigContinuousReader() is returning status 0xc0000010.

STATUS_INVALID_DEVICE_REQUEST is returned under any of the following conditions

  1. The EP is not bulk or interrrupt
  2. The EP has a direction of OUT
  3. you have already called WdfUsbTargetPipeConfigContinuousReader() successfully on the WDFUSBPIPE

and possibly a couple of other edge cases which I don’t think you are hitting. Are you calling WdfUsbTargetPipeConfigContinuousReader in EvtDevicePrepareHardware()? Also, when you get the error, break in and run !wdfkd.wdflogdump. It should tell you why the error was returned.

d

Hi doron,

The status that WdfUsbTargetPipeConfigContinuousReader() is returning now has changed to a long value." -1073741306". I am calling WdfUsbTargetPipeConfigContinuousReader() from EvtDevicePrepareHardware(). Also !wdfkd.wdflogdump is not working for some reason. It says,

" 0: kd> !wdfkd.wdflogdump wdf_usb
Trace searchpath is:

Trace format prefix is: %7!u!: %!FUNC! -
error: Could not retrieve WDF IFR log header for driver wdf_usb ."

HI,

The problem is fixed now.
I initialized the NumPendingReads of the WDF_USB_CONTINUOUS_READER_CONFIG structure to a value(10) greater than the default value(2).
Also in WDF_USB_CONTINUOUS_READER_CONFIG_INIT. I increased the size of transfer length to 1024.
Now everything is working properly. But I still don’t know how this fixes the problem.

10 is the max number of pending reads, although i don’t think you will see any benefit from that great a number. typically 2-3 work the best.

What was your prevoius transfer length? was it a multiple of max packet size? by default, it has to be a multiple, otherwise you can cause babble on the bus. To change this default, you must call WdfUsbTargetPipeSetNoMaximumPacketSizeCheck first before initializing the reader.

When reporting NTSTATUS values to the community/list, use hex please, not decimal. -1073741306 = 0xC0000206 = STATUS_INVALID_BUFFER_SIZE. This would confirm that you were not initializing the reader with a transfer length that was a multiple of max packet size.

To use !wdfkd.wdflogdump, you must also set the tmf file path. read http://blogs.msdn.com/doronh/archive/2006/07/31/684531.aspx on how to set this up. Once this is setup properly, !wdflogdump will work and would have told you the exact reason why the call failed.

d

Thanks for all the info doron. Will remember not to use decimals when posrting again.