Re: [PATCH] usb: usbtest: bmAttributes would better be masked

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

 



On Mon, Sep 23, 2013 at 10:32:30AM -0400, Alan Stern wrote:
> On Mon, 23 Sep 2013, Huang Rui wrote:
> 
> > When transfer type is isochronous, the other bits (bits 5..2) of bmAttributes in
> > endpoint descriptor might not be set zero. So it's better to mask bmAttributes
> > with USB_ENDPOINT_XFERTYPE_MASK to judge the transfter type later.
> > 
> > Signed-off-by: Huang Rui <ray.huang@xxxxxxx>
> > ---
> >  drivers/usb/misc/usbtest.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
> > index aa28ac8..c69f199 100644
> > --- a/drivers/usb/misc/usbtest.c
> > +++ b/drivers/usb/misc/usbtest.c
> > @@ -120,7 +120,8 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)
> >  			struct usb_host_endpoint	*e;
> >  
> >  			e = alt->endpoint + ep;
> > -			switch (e->desc.bmAttributes) {
> > +			switch (e->desc.bmAttributes &
> > +					USB_ENDPOINT_XFERTYPE_MASK) {
> >  			case USB_ENDPOINT_XFER_BULK:
> >  				break;
> >  			case USB_ENDPOINT_XFER_ISOC:
> 
> Use usb_endpoint_type() instead of doing this by hand.
> 

Got it, will update soon.

Thanks,
Rui

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