USB 2 Bulk Transfer Size Question

Hello all
I am developing a USB driver to stream data from USB 2 device at high speed
bulk endpoint.
My question is:

The USB transfer buffer size should be a multiple of the endpoing packet
size?

From testing the transfer only success when the buffer is multiple of the
packet size (512 bytes * N).

Is this a limitation or there are a bug in the USB firmware?

I am developing under windows XP SP 2 using DriverWorks library.
The USB device is based on a cypress chip.

Thanks

It does not have to be. This might be a limitiation of the driver suite
you are using. Also, be aware that if you are transferring < max packet
size for the last packet from the device to the host that you can cause
babble if the host (e.g. your driver) is asking for N bytes and the
device sends anything from N+1 -> MaxPacketSize

d

– I can spell, I just can’t type.
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Hesham Desouky
Sent: Monday, July 10, 2006 4:01 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] USB 2 Bulk Transfer Size Question
Importance: High

Hello all
I am developing a USB driver to stream data from USB 2 device at high
speed bulk endpoint.
My question is:

The USB transfer buffer size should be a multiple of the endpoing packet
size?

From testing the transfer only success when the buffer is multiple of
the packet size (512 bytes * N).

Is this a limitation or there are a bug in the USB firmware?

I am developing under windows XP SP 2 using DriverWorks library.
The USB device is based on a cypress chip.

Thanks


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

Note that DriverWorks is a discontinued product; in fact, latest issue
of NT Insider includes a briefing announcing it demise. So, there won’t
be any updates or upgrades available for the package–which could be a
problem trying to support Vista.

You should consider using the KMDF for new projects. It will make you’re
life much easier and it will ensure you have an upgrade path for
Vista. Also, there’s a USB example (KMDF10\src\kmdf\osrusbfx2) available
that includes support for bulk transfers.

As Doron indicated, transfers do NOT have to be integer multiples of the
packet size; however, in creating the transfer request (URB), the
USBD_SHORT_TRANSFER_OK flag should be set. The KMDF (I believe) sets
this flag by default.

Hesham Desouky wrote:

Hello all
I am developing a USB driver to stream data from USB 2 device at high
speed bulk endpoint.
My question is:

The USB transfer buffer size should be a multiple of the endpoing packet
size?

From testing the transfer only success when the buffer is multiple of
the packet size (512 bytes * N).

Is this a limitation or there are a bug in the USB firmware?

I am developing under windows XP SP 2 using DriverWorks library.
The USB device is based on a cypress chip.

Thanks

Yes, KMDF will set the flag for you in all cases.

d

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Larry Bovie
Sent: Monday, July 10, 2006 11:35 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] USB 2 Bulk Transfer Size Question

Note that DriverWorks is a discontinued product; in fact, latest issue
of NT Insider includes a briefing announcing it demise. So, there won’t
be any updates or upgrades available for the package–which could be a
problem trying to support Vista.

You should consider using the KMDF for new projects. It will make you’re
life much easier and it will ensure you have an upgrade path for
Vista. Also, there’s a USB example (KMDF10\src\kmdf\osrusbfx2) available
that includes support for bulk transfers.

As Doron indicated, transfers do NOT have to be integer multiples of the
packet size; however, in creating the transfer request (URB), the
USBD_SHORT_TRANSFER_OK flag should be set. The KMDF (I believe) sets
this flag by default.

Hesham Desouky wrote:

Hello all
I am developing a USB driver to stream data from USB 2 device at high
speed bulk endpoint.
My question is:

The USB transfer buffer size should be a multiple of the endpoing
packet size?

From testing the transfer only success when the buffer is multiple of

the packet size (512 bytes * N).

Is this a limitation or there are a bug in the USB firmware?

I am developing under windows XP SP 2 using DriverWorks library.
The USB device is based on a cypress chip.

Thanks


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