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:

> On Fri, Apr 01, 2011 at 01:36:00PM +0200, Michal Nazarewicz wrote:
> > On Fri, 01 Apr 2011 12:19:59 +0200, Felipe Balbi <balbi@xxxxxx> wrote:
> > >we shouldn't assume that value because on SuperSpeed, we have
> > >1024 as wMaxPacketSize.
> > 
> > The more I look at the code, the more I wonder whether this 511
> > constant is a consequence of wMaxPacketSize being 512 or mass
> > storage using 512-byte blocks when reading/writing data from/to
> > backing file.
> 
> My understanding is that the code is trying to align the size of
> transfers to wMaxPacketSize, see that it also sets short_not_ok flag on
> the same path.
> 
> Alan, what do you say ?

The situation is complicated.  Michal is right that the 511 value
refers to the block size, not the maxpacket size.  However the logic in
this routine assumes that the maxpacket size divides the block size,
and with SuperSpeed that won't be true unless the block size is
increased to 1024.  Fixing the assumption will require more than
changing this one line.

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