KMDF USB MaxTransferSize

We recently discovered that on Windows 2000 with a USB 1.1 hub that the
maximum transfer size is 4K. When using a USB 2.0 hub the maximum
transfer size is much larger (we only tested to 64K). The driver we are
testing with is based on the WDF 1.1 OSRUSBFX2 “final” driver.

Is there a reason that the KMDF sets the maximum transfer size to 4K
when a USB 1.1 hub is being used? We are considering changing it to a
larger value but we are concerned that this may have negative
consequences. Assuming that changing the maximum transfer size isn’t an
issue I didn’t see any way to do this using the KMD framework so I
assume we will need to do this using the WDM APIs.

Thanks for any information,

  • Steve -

If you are using the usb 2.0 stack, the max transfer size in the select
config (or interface) URB is ignored. Max xfer is only used for the
win2k gold 1.1 stack.

Also, you should use KMDF v1.5 since it has some areas of improvement
here. If you still think that the max xfer size is important, you can
build your own select config URB w/the correct max xfer size per
endpoint and pass that to WdfUsbDeviceTargetSelectConfig

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Whitman, Steve
Sent: Friday, January 19, 2007 7:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF USB MaxTransferSize

We recently discovered that on Windows 2000 with a USB 1.1 hub that the
maximum transfer size is 4K. When using a USB 2.0 hub the maximum
transfer size is much larger (we only tested to 64K). The driver we are
testing with is based on the WDF 1.1 OSRUSBFX2 “final” driver.

Is there a reason that the KMDF sets the maximum transfer size to 4K
when a USB 1.1 hub is being used? We are considering changing it to a
larger value but we are concerned that this may have negative
consequences. Assuming that changing the maximum transfer size isn’t an
issue I didn’t see any way to do this using the KMD framework so I
assume we will need to do this using the WDM APIs.

Thanks for any information,

  • Steve -

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

>Is there a reason that the KMDF sets the maximum transfer size to 4K

when a USB 1.1 hub is being used?

This is IIRC a property of w2k’s USB stack and UHCD driver, not KMDF. You can
do nothing with this.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Hello Doron,

Thanks for the reply. I understand that the usb 2.0 stack ignores the
maximum transfer for XP but the documents indicate that this is not
ignored in Windows 2000.

I am using KMDF v1.5 but when we first started we had the v1.1 release
and used the OSRUSBFX2 driver as the starting point. Since the
application is attempting to perform reads that are much larger than 4K
we either need to increase the maximum transfer size or the driver needs
to perform multiple transactions for each application request.

  • Steve -

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-276273-
xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, January 20, 2007 12:39 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] KMDF USB MaxTransferSize

If you are using the usb 2.0 stack, the max transfer size in the
select
config (or interface) URB is ignored. Max xfer is only used for the
win2k gold 1.1 stack.

Also, you should use KMDF v1.5 since it has some areas of improvement
here. If you still think that the max xfer size is important, you can
build your own select config URB w/the correct max xfer size per
endpoint and pass that to WdfUsbDeviceTargetSelectConfig

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Whitman, Steve
Sent: Friday, January 19, 2007 7:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF USB MaxTransferSize

We recently discovered that on Windows 2000 with a USB 1.1 hub that
the
maximum transfer size is 4K. When using a USB 2.0 hub the maximum
transfer size is much larger (we only tested to 64K). The driver we
are
testing with is based on the WDF 1.1 OSRUSBFX2 “final” driver.

Is there a reason that the KMDF sets the maximum transfer size to 4K
when a USB 1.1 hub is being used? We are considering changing it to a
larger value but we are concerned that this may have negative
consequences. Assuming that changing the maximum transfer size isn’t
an
issue I didn’t see any way to do this using the KMD framework so I
assume we will need to do this using the WDM APIs.

Thanks for any information,

  • Steve -

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


BEGIN-ANTISPAM-VOTING-LINKS

Teach CanIt if this mail (ID 7241696) is spam:
Spam: http://mail-
gw.cognex.com/canit/b.php?c=s&i=7241696&m=7343a1fdd764
Not spam: http://mail-
gw.cognex.com/canit/b.php?c=n&i=7241696&m=7343a1fdd764
Forget vote: http://mail-
gw.cognex.com/canit/b.php?c=f&i=7241696&m=7343a1fdd764

END-ANTISPAM-VOTING-LINKS

To clarify, Win2k will only look at MaximumTransferSize if the v1.1
stack is running. If you are running the v2.0 stack on win2k,
MaximumTransferSize is ignored. To reiterate, only the v1.1 stack on
win2k looks at this value and the v2.0 stack does not (on all supported
OS’s).

I think on v1.1 win2k you will need to stage your reads. Like I
previous mentioned, you can build your own select config urb and then
use WDF_USB_DEVICE_SELECT_CONFIG_PARAMS_INIT_URB to send it via
WdfUsbTargetDeviceSelectConfig(). This will allow you to specify the
MaximumTransferSize for your endpoints, although like Maxim pointed out
earlier, there is a limit to the size you may specify (I don’t remember
what it is offhand though).

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Whitman, Steve
Sent: Monday, January 22, 2007 5:12 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] KMDF USB MaxTransferSize

Hello Doron,

Thanks for the reply. I understand that the usb 2.0 stack ignores the
maximum transfer for XP but the documents indicate that this is not
ignored in Windows 2000.

I am using KMDF v1.5 but when we first started we had the v1.1 release
and used the OSRUSBFX2 driver as the starting point. Since the
application is attempting to perform reads that are much larger than 4K
we either need to increase the maximum transfer size or the driver needs
to perform multiple transactions for each application request.

  • Steve -

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-276273-
xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: Saturday, January 20, 2007 12:39 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] KMDF USB MaxTransferSize

If you are using the usb 2.0 stack, the max transfer size in the
select
config (or interface) URB is ignored. Max xfer is only used for the
win2k gold 1.1 stack.

Also, you should use KMDF v1.5 since it has some areas of improvement
here. If you still think that the max xfer size is important, you can
build your own select config URB w/the correct max xfer size per
endpoint and pass that to WdfUsbDeviceTargetSelectConfig

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Whitman, Steve
Sent: Friday, January 19, 2007 7:41 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] KMDF USB MaxTransferSize

We recently discovered that on Windows 2000 with a USB 1.1 hub that
the
maximum transfer size is 4K. When using a USB 2.0 hub the maximum
transfer size is much larger (we only tested to 64K). The driver we
are
testing with is based on the WDF 1.1 OSRUSBFX2 “final” driver.

Is there a reason that the KMDF sets the maximum transfer size to 4K
when a USB 1.1 hub is being used? We are considering changing it to a
larger value but we are concerned that this may have negative
consequences. Assuming that changing the maximum transfer size isn’t
an
issue I didn’t see any way to do this using the KMD framework so I
assume we will need to do this using the WDM APIs.

Thanks for any information,

  • Steve -

Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


BEGIN-ANTISPAM-VOTING-LINKS

Teach CanIt if this mail (ID 7241696) is spam:
Spam: http://mail-
gw.cognex.com/canit/b.php?c=s&i=7241696&m=7343a1fdd764
Not spam: http://mail-
gw.cognex.com/canit/b.php?c=n&i=7241696&m=7343a1fdd764
Forget vote: http://mail-
gw.cognex.com/canit/b.php?c=f&i=7241696&m=7343a1fdd764

END-ANTISPAM-VOTING-LINKS


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Whitman, Steve wrote:

I am using KMDF v1.5 but when we first started we had the
v1.1 release and used the OSRUSBFX2 driver as the starting
point. Since the application is attempting to perform reads
that are much larger than 4K we either need to increase the
maximum transfer size or the driver needs to perform multiple
transactions for each application request.

What I would do is let KMDF handle the I/O to the device (in terms of actual bulk reads) using a continuous reader, and then implement a buffering scheme inside your driver.

For example, if you get a read from userspace for (say) 64K, then you can pend that read in a manual queue and wait until the continuous reader has filled up your buffer to (at least) 64K.

The fakemodem sample has a good example of how to do this.