On Thu, 23 May 2013, Alan Stern wrote: > On Thu, 23 May 2013, Thomas Pugliese wrote: > > > Hi, > > I am attempting to get a wireless USB mass storage device to work with > > an HWA as the host controller. Everything works fine as long as the SCSI > > reads are smaller than 4kbytes. When the usb-storage driver receives the > > first 16kB read, it breaks it up into 4-4kB URBs and sends it to the HWA > > host controller. This causes problems because the max packet size of the > > bulk in endpoint on the wireless device is 3854 bytes. It responds to the > > host poll request with 7kB of data (2x3.5kB packets) which causes a babble > > since the host was only expecting 4kB. > > > > Is there a way to get the usb-storage driver to send the entire buffer > > down to the HCD in a single URB instead of breaking it up? I assume it > > has something to do with the SG or DMA settings when the HCD is created > > but I'm not sure what the correct settings are. > > You're right -- the host controller driver must support SG transfers. > I have no idea what would be involved in adding this support to the HWA > driver. > > > Another option would be > > for usb-storage to take into account the max packet size when segmenting > > the requests and make sure all but the last segment are multiples of the > > max packet size. > > usb-storage doesn't break requests up at all. The requests are already > segmented by the block layer, which transfers data in multiples of the > page size (which is 4 KB). I think you will have a very difficult time > breaking up 4-KB units into pieces that are multiples of 3.5 KB. The > only solution is to use bounce buffers. > > Alan Stern > > Thanks Alan, Wireless USB does allow the host to force the device to use a smaller packet size than it advertises in its endpoint descriptor as long as the size is a multiple of 512 bytes. I can update the HWA so that it will impose a packet size on the device that divides evenly into 4k and submit a patch once is working. Tom -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html