Re: [PATCH] usb: gadget: file_storage: don't assume wMaxPacketSize to be 512

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 1 Apr 2011, Felipe Balbi wrote:

> Hi again,
> 
> On Fri, Apr 01, 2011 at 06:34:42PM +0300, Felipe Balbi wrote:
> > > The correct approach is to align on the larger of the block size and
> > > the maxpacket size (provided one is a multiple of the other, which
> > > isn't always true with wireless USB!).  In theory short transfers
> 
> How about this instead ? (completely untested, compile tested only)

No good.  Changing the block size isn't so easy.  In addition to all 
the 512 and 511 values, you have to change a number of places that do 
<< 9 or >> 9.

> I still need to be sure if I'm using the correct endpoints on all
> locations, I'm a bit confused about do_read_capacity() and do_verify()
> will spend more time with this approach if you think it's good enough.
> At least we won't be lying to host saying block size is 512 but aligning
> on 1024 bytes in SuperSpeed. What do you think ?

It's a bad idea.  I advise against using a variable block size; keep it 
set to 512.

Alan Stern

--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux