Re: packet size problem
David Vrabel <[email protected]> Thu, 20 Mar 2008 13:11:50 +0000
| Newsgroups | gmane.linux.drivers.uwb,gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
CC'd linux-usb-devel since this is more of a USB problem than a UWB one. AntonioLin wrote: > Dear Inaky and Reinette, > > I had download and used the Linux UWB driver luwb-1.8.9. I got a > problem and want to consult you. > > I am sorry that I don't exactly know the way to report this. So I send > email directly. If it's not suitable, I apologize for it. > > I described my problem as follows: > > (1)Operation Environvent: > Linux Distribution:CentOS5 > PC-CPU: Intel P3 > Kernel: 2.6.21 > Driver: luwb-1.8.9 > Host:USB-IF HWA based PDK > Device:Wireless USB MassStorage Device.(LucidPort) > > (2)Problem Description: > (1)Storage driver sent a CBW(Command Blo Wrapper) to read 63 > sectors.(63*512 = 32256 bytes) > > (2)USB Core(?) split this request into 9 inbound URBs.(1*2560+7*4096+1*1024) Yes, USB core assumes that when creating URBs from a sg list that each element in the list is a valid portion of the transfer (i.e, all but the last are a multiple of wMaxPacketSize). Either a) USB core should consider wMaxPacketSize when creating URBs in usb_sg_init(); or b) the USB mass storage device should ensure it only submits sg lists that can be split into valid URBs. Both of these will require that data in an invalid sg list is copied into a virtually contiguous buffer (which can then be submitted in a single URB). (The real solution is for the host controllers to support scatter-gather DMA.) > (3)Since Device's max packet size is 1024 bytes. But the first URB ask > for 2560 > bytes which are not a multiple of 1024 bytes. > > (4)So when HWA asks for the last 512 bytes of first URB, device still > returns > 1024 bytes. Then HWA will reply transfer request fail to driver. > > (5)The same problem exists when device's max packet size is larger than 512 > bytes. > > I also attached related partial kernel log message. > > Thank you. > > Best Regards, > > Antonio <http://www.alcormicro.com> -- David Vrabel, Senior Software Engineer, Drivers CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562 Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/