Permalink
Browse files

usbutils: Print MaxStreams and Mult for USB 3.0 devices.

Add the ability to print the MaxStreams and Mult fields from the
SuperSpeed Endpoint Companion Descriptors.  Only print them for the
correct endpoint types (MaxStreams is only valid for bulk endpoints, and
Mult is only valid for isochronous endpoints).

TODO: Print wBytesPerInterval from the SuperSpeed Endpoint Companion
Descriptor.

Sample output for a USB Attached SCSI device prototype with an alt setting
that supports bulk streams looks like:

    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           4
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     98
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               1
        INTERFACE CLASS:  04 24 01 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst              16
        MaxStreams          65536
        INTERFACE CLASS:  04 24 03 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               6
        MaxStreams          65536
        INTERFACE CLASS:  04 24 04 00
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0400  1x 1024 bytes
        bInterval               0
        bMaxBurst               1
        MaxStreams          65536
        INTERFACE CLASS:  04 24 02 00

Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information...
Sarah Sharp authored and gregkh committed Sep 1, 2010
1 parent 5f7c200 commit 4bb88d7972020fe776150a104354a5769fbc8991
Showing with 9 additions and 0 deletions.
  1. +9 −0 lsusb.c
View
@@ -775,6 +775,15 @@ static void dump_endpoint(struct usb_dev_handle *dev, struct usb_interface_descr
break;
case USB_DT_SS_ENDPOINT_COMP:
printf(" bMaxBurst %15u\n", buf[2] + 1);
+ /* Print bulk streams info or isoc "Mult" */
+ if ((endpoint->bmAttributes & 3) == 2 &&
+ (buf[3] & 0x1f))
+ printf(" MaxStreams %14u\n",
+ (unsigned) 1 << buf[3]);
+ if ((endpoint->bmAttributes & 3) == 1 &&
+ (buf[3] & 0x3))
+ printf(" Mult %20u\n",
+ buf[3] & 0x3);
break;
default:
/* often a misplaced class descriptor */

0 comments on commit 4bb88d7

Please sign in to comment.