How does USB bus driver know when a short data transfer is ended

hi all:

(1) How does the XP USB infrastructure (USB bus driver, etc.) know when a USB bulk in transfer is complete for a transaction that is less than the max packet size?

The reason I ask is that I have one device (OSR dev board for USB) that operates as I think it should – the IRP I submit for 64 bytes (with the short transfer ok flag) successfully completes returning with 30 bytes, which is all the OSR device had. (The OSR board is designed to be in loopback mode - so I previously send it 30 bytes to fill it’s buffers for my subsequent read).

The other device I’m using doesn’t behave correctly in my opinion - my IRP never completes even though the data is transferred. (Function driver does have short transfer flag set.)

In general:

  1. How does the XP side detect the end of a transfer for a bulk in operation when the data size is not a multiple of the max packet size?
  2. How does the XP side detect the end of a transfer for a bulk in operation when the data size is a multiple of the max packet size?
  3. How about for bulk out? What does the embedded side typically get from the XP side for dealing with various bulk out transfer sizes.

thanks very much!

>>1) How does the XP side detect the end of a transfer for a bulk in operation when the data size is not a multiple of the max packet size?
On receiving a short packet.

>2) How does the XP side detect the end of a transfer for a bulk in operation when the data size is a multiple of the max packet size?
Mostly device send a zero-length packet.
>3) How about for bulk out? What does the embedded side typically get from the XP side for dealing with various bulk out transfer sizes.
Occurrence of one of following condition will tell the firmware that this is last packet:

  • Has it got as much data as expected
  • If the size of last packet is less then 64 (or whatever the max packet size is 8,16,32 or 64))
  • on receiving of zero-length packet.

Hope this helps.
Dev

Thanks, that was very helpful!
----- Original Message -----
From: xxxxx@wipro.commailto:xxxxx
To: Windows System Software Devs Interest Listmailto:xxxxx
Sent: Friday, September 23, 2005 10:43 AM
Subject: RE:[ntdev] How does USB bus driver know when a short data transfer is ended

>>1) How does the XP side detect the end of a transfer for a bulk in operation when the data size is not a multiple of the max packet size?
On receiving a short packet.
>>2) How does the XP side detect the end of a transfer for a bulk in operation when the data size is a multiple of the max packet size?
Mostly device send a zero-length packet.
>>3) How about for bulk out? What does the embedded side typically get from the XP side for dealing with various bulk out transfer sizes.
Occurrence of one of following condition will tell the firmware that this is last packet:
- Has it got as much data as expected
- If the size of last packet is less then 64 (or whatever the max packet size is 8,16,32 or 64))
- on receiving of zero-length packet.

Hope this helps.
Dev


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com</mailto:xxxxx></mailto:xxxxx>