usb: usbtest: bmAttributes would better be masked
authorHuang Rui <ray.huang@amd.com>
Mon, 23 Sep 2013 16:03:43 +0000 (00:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Sep 2013 00:27:01 +0000 (17:27 -0700)
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 use usb_endpoint_type routine to mask bmAttributes with
USB_ENDPOINT_XFERTYPE_MASK to judge the transfter type later.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/usbtest.c

index aa28ac8c7607deeb49136340f0def4dd5f6fa05d..3e91d3e98ee871c99c88b37e328499853c853481 100644 (file)
@@ -120,7 +120,7 @@ get_endpoints(struct usbtest_dev *dev, struct usb_interface *intf)
                        struct usb_host_endpoint        *e;
 
                        e = alt->endpoint + ep;
-                       switch (e->desc.bmAttributes) {
+                       switch (usb_endpoint_type(&e->desc)) {
                        case USB_ENDPOINT_XFER_BULK:
                                break;
                        case USB_ENDPOINT_XFER_ISOC: