Re: [PATCH 1/4] usb: wusbcore: set the RPIPE wMaxPacketSize value correctly

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

 




On Thu, 24 Oct 2013, Sergei Shtylyov wrote:

> Hello.
> 
> On 10/23/2013 11:44 PM, Thomas Pugliese wrote:
> 
> > For isochronous endpoints, set the RPIPE wMaxPacketSize value using
> > wOverTheAirPacketSize from the endpoint companion descriptor instead of
> > wMaxPacketSize from the normal endpoint descriptor.
> 
> > Signed-off-by: Thomas Pugliese <thomas.pugliese@xxxxxxxxx>
> > ---
> >   drivers/usb/wusbcore/wa-rpipe.c |    5 ++++-
> >   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> > diff --git a/drivers/usb/wusbcore/wa-rpipe.c
> > b/drivers/usb/wusbcore/wa-rpipe.c
> > index 1ed068a..b48e74c 100644
> > --- a/drivers/usb/wusbcore/wa-rpipe.c
> > +++ b/drivers/usb/wusbcore/wa-rpipe.c
> > @@ -334,7 +334,10 @@ static int rpipe_aim(struct wa_rpipe *rpipe, struct
> > wahc *wa,
> >   	/* FIXME: compute so seg_size > ep->maxpktsize */
> >   	rpipe->descr.wBlocks = cpu_to_le16(16);		/* given */
> >   	/* ep0 maxpktsize is 0x200 (WUSB1.0[4.8.1]) */
> > -	rpipe->descr.wMaxPacketSize = cpu_to_le16(ep->desc.wMaxPacketSize);
> > +	if (usb_endpoint_xfer_isoc(&ep->desc))
> > +		rpipe->descr.wMaxPacketSize = epcd->wOverTheAirPacketSize;
> > +	else
> > +		rpipe->descr.wMaxPacketSize = ep->desc.wMaxPacketSize;
> 
>    Did you intentionally remove cpu_to_le16()? It doesn't seem to go together
> well with the above statement...
> 
> WBR, Sergei
> 
> 

Yes, removing the cpu_to_le16 is intentional.  Both sides of the 
assignment are fields of USB descriptors and are already __le16 so 
byteswapping would be the wrong thing to do.  I forgot to mention that.

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