USB Problem in Submit URB to low level USB Driver in Windows 2000

I got an USB Problem in Submit URB to low level USB Driver in Windows 2000
SP2 and VIA chipset (VT83C572, VT82C586/A/B, VT82C596B, VT82C686A USB
Controllers).

I am using UsbBuildGetInterruptOrBulkTransferRequest, setting buffer via
TransferBuffer, length of the buffer in TransferBufferLength and
PipeHandle. Then I am doing SubmitURB to low level USB driver, receiving
Status_Pending and waiting for Completion function to be executed.
The problem is that after 2-3 times of successfully receiving a data from
the device I am getting the following error (assert):

*** Assertion failed: (MemoryDescriptorList->MdlFlags & ( MDL_PAGES_LOCKED
| MDL_PARTIAL)) != 0
*** Source File: F:\nt\private\ntos\mm\iosup.c, line 2136

Could someone give me an advance?

Kind regards,
Svetoslav Enkov, AIVAN7 GMBH


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

> I am using UsbBuildGetInterruptOrBulkTransferRequest, setting buffer via

TransferBuffer, length of the buffer in TransferBufferLength and
PipeHandle
Are you setting the TransferBufferMDL field to NULL? It looks like it’s non-NULL
and that’s what is causing the problem. You should use either TransferBufferMDL
or TransferBuffer - not both.

Also, if your buffer is less than the pipe’s MaximumTransferSize, you should
specify USBD_SHORT_TRANSFER_OK in the TransferFlags.

Good luck,
Lee

*************************** ADVERTISEMENT ******************************
For ALL the latest Soccer news on your club, GAA sports results and the
latest on your F1 stars plus much more check out
http://sport.iol.ie/sport. Sport On-Line… It’s a passion


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

Thanks, Lee!

But I have followed all your suggestions already.
On Complete function the URB TransferBufferMDL is not NULL.
On Intel 810 chipset it works fine, the problem appears only on
VIA chipset.
Also it occurs only after 2-3 successfull passes.

I am attaching you the call stack dump (on 3-rd pass).

Kind regards,
-Svetoslav Enkov,
Aivan7 GmbH

nt!PiProcessDriverInstance+0x62

nt!MmSetAddressRangeModified+0xb5

nt!MmFreeContiguousMemory+0x158

uhcd!UHCD_BeginTransfer+0x1f1

uhcd!UHCD_StartDmaTransfer+0x2f7

hal!HalAllocateAdapterChannel+0x11b

nt!IopAllocateIrpPrivate+0xea

uhcd!UHCD_InitializeDmaTransfer+0x1ea

uhcd!UHCD_EndpointDMAWorker+0x430

uhcd!UHCD_EndpointWorker+0x167

uhcd!UHCD_Transfer_StartIo+0x39b

uhcd!UHCD_StartIo+0x3f8

nt!IoGetBootDiskInformation+0xc5

uhcd!UHCD_URB_Dispatch+0x409

uhcd!UHCD_Dispatch+0x116

nt!IopfCompleteRequest+0x22

usbhub!USBH_PdoUrbFilter+0x107

usbhub!USBH_PdoDispatch+0x15f

usbhub!USBH_HubDispatch+0x46

nt!IopfCompleteRequest+0x22

RFTransmiter!KUsbLowerDevice::SubmitUrb+0x25b [C:\Program
Files\NuMega\SoftICE Driver Suite\DriverWorks\source\kusb.cpp @ 377]

RFTransmiter!KUsbPipe::SubmitUrb+0x73
[C:\PROGRA~1\NuMega\SOFTIC~1\DRIVER~2\include\kusb.h @ 1389]

RFTransmiter!KUsbInterruptTransfer::InterruptTransferComplete+0x174
[D:\WinDriver\RFTransmiter\Driver\sys\RFUsbIntTransfer.cpp @
224]

RFTransmiter!KUsbInterruptTransfer::InterruptTransferCompleteLINK+0x23
[D:\WinDriver\RFTransmiter\Driver\sys\RFUsbIntTransfer.h @
102]

nt!IoCreateStreamFileObjectLite+0x27

USBD!USBD_CompleteRequest+0xa9

uhcd!UHCD_CompleteIrp+0x283

uhcd!UHCD_CompleteTransferDPC+0x663

uhcd!UHCD_IsrDpc+0x211

nt!MiReserveSystemPtes2+0x383

0x81446ce8

0xffdff800

nt!ST+0x484

0x81446ce8

0xffdff800

nt!ST+0x484

0x81446ce8

0xffdff800

nt!ST+0x484

0x81446ce8

I am using UsbBuildGetInterruptOrBulkTransferRequest, setting buffer via
TransferBuffer, length of the buffer in TransferBufferLength and
PipeHandle
Are you setting the TransferBufferMDL field to NULL? It looks like it’s
non-NULL
and that’s what is causing the problem. You should use either
TransferBufferMDL
or TransferBuffer - not both.

Also, if your buffer is less than the pipe’s MaximumTransferSize, you
should
specify USBD_SHORT_TRANSFER_OK in the TransferFlags.

Good luck,
Lee


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

** Reply to message from “Lee Rhodes” on Tue, 19 Feb
2002 15:03:51 GMT

> Also, if your buffer is less than the pipe’s MaximumTransferSize, you should
> specify USBD_SHORT_TRANSFER_OK in the TransferFlags.

USBD_SHORT_TRANSFER_OK tells the stack not to return an error code if a packet
contains less than a full endpoint’s worth of data. It has no connection with
MaximumTransferSize AFAIK.

Sincerely,

Chris Myers
Senior Project Engineer
Quatech, Inc.


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com

I have solved the problem…

The problem was in the memory type for Buffer. I have solved it by
allocating buffer with ExAllocatePool from NonPagedPool. When requesting
data from low-level driver, a MDL must be created, then memory in MDL must
be locked and passed to the low-level driver. On BuildInteruptTransfer must
be used TransferBufferMDL, setting TransferBuffer = NULL.
Now all is working fine on all chipsets. The situation was so strange
because the previous solution without MDL worked well at i810 and not at
other chipsets.

-Svetoslav Enkov
Aivan7 GmbH

On 02/19/02, “xxxxx@aivan7.net” wrote:

I got an USB Problem in Submit URB to low level USB Driver in Windows 2000
SP2 and VIA chipset (VT83C572, VT82C586/A/B, VT82C596B, VT82C686A USB
Controllers).

I am using UsbBuildGetInterruptOrBulkTransferRequest, setting buffer via
TransferBuffer, length of the buffer in TransferBufferLength and
PipeHandle. Then I am doing SubmitURB to low level USB driver, receiving
Status_Pending and waiting for Completion function to be executed.
The problem is that after 2-3 times of successfully receiving a data from
the device I am getting the following error (assert):

*** Assertion failed: (MemoryDescriptorList->MdlFlags & ( MDL_PAGES_LOCKED
| MDL_PARTIAL)) != 0
*** Source File: F:\nt\private\ntos\mm\iosup.c, line 2136

Could someone give me an advance?

Kind regards,
Svetoslav Enkov, AIVAN7 GMBH


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com