Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Feb 2013 08:38:54 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Aman Sawrup <aman.sawrup@bluecoat.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Reading 1024 bytes from mass storage device using 3 frames gives USB_ERR_STALLED
Message-ID:  <201302120838.54414.hselasky@c2i.net>
In-Reply-To: <51194A19.40203@bluecoat.com>
References:  <1360360082956-5785167.post@n5.nabble.com> <201302090001.57258.hselasky@c2i.net> <51194A19.40203@bluecoat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302120838.54414.hselasky>