Reading 1024 bytes from mass storage device using 3 frames gives USB_ERR_STALLED
Hans Petter Selasky
hselasky at c2i.net
Tue Feb 12 07:37:52 UTC 2013
On Monday 11 February 2013 20:44:25 Aman Sawrup wrote:
> Hi Hans,
>
> I have a couple of questions about usbd_xfer_max_framelen() and
> usbd_xfer_max_len():
>
> You mentioned the frame length should be a multiple of
> usbd_xfer_max_framelen(). If there is only 1 frame in the transfer, is it
> okay if the frame length is less than usbd_xfer_max_framelen()? When I set
> the frame length to 8 bytes for SCSI OP Read Capacity, it works without
> error. Similarly, when I set the frame length to 254 bytes for SCSI OP
> Inquiry, it also works without error. usbd_xfer_max_len() returns 131,072
> bytes, which is the value of UMASS_BULK_SIZE. I'm able to transfer
> 131,072 bytes, using only a single frame, without error. You mentioned
> each frame in encoded in one or more USB packets with each packet size
> presumably being wMaxPacketSize (512 byte). Does that mean the controller
> code (i.e. ehci.c) will split up the single 131,072 byte frame into 256
> USB packets, 512 bytes each packet? I ask because I'm debugging an issue
> where the USB EHCI host controller does a DMA write into physical address
> 0. Thanks
> Aman
Hi Aman,
Only the last frame you send is allowed to be non-multiple of
usbd_xfer_max_framelen().
512
1024
512
13
Is OK.
512
13
1024
Is NOK.
You should also set the flag for single short frame ok and not multi short
frame ok.
--HPS
More information about the freebsd-usb
mailing list