[PATCH v2 3/4] usbutils: Print MaxStreams and Mult for USB 3.0 devices.

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

 



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

Now with less pow!

Sarah

 lsusb.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lsusb.c b/lsusb.c
index a25ad69..a739859 100644
--- a/lsusb.c
+++ b/lsusb.c
@@ -770,6 +770,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 */
-- 
1.6.3.3

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