From owner-freebsd-usb@FreeBSD.ORG Tue Feb 12 07:37:52 2013 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DCF45130 for ; Tue, 12 Feb 2013 07:37:52 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.c2i.net [212.247.154.66]) by mx1.freebsd.org (Postfix) with ESMTP id 63AA69ED for ; Tue, 12 Feb 2013 07:37:51 +0000 (UTC) X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe03.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 209824810; Tue, 12 Feb 2013 08:37:42 +0100 From: Hans Petter Selasky To: Aman Sawrup Subject: Re: Reading 1024 bytes from mass storage device using 3 frames gives USB_ERR_STALLED Date: Tue, 12 Feb 2013 08:38:54 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <1360360082956-5785167.post@n5.nabble.com> <201302090001.57258.hselasky@c2i.net> <51194A19.40203@bluecoat.com> In-Reply-To: <51194A19.40203@bluecoat.com> X-Face: ?p&W)c( =?iso-8859-1?q?+80hU=3B=27=7B=2E=245K+zq=7BoC6y=7C=0A=09/D=27an*6mw?=>j'f:eBsex\Gi, Cc: freebsd-usb@freebsd.org X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Feb 2013 07:37:52 -0000 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