aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <greg@kroah.com>2018-11-26 16:42:45 +0100
committerGitHub <noreply@github.com>2018-11-26 16:42:45 +0100
commit3b4a2bfc223c023844c5349f3cfdb79bb6065647 (patch)
tree1886d4c34891f6e19698d5b130dd2913788942a9
parent20aa7c6b77375ef9a6504f83661b3b4b5dbb075b (diff)
parentb3071546bb8c24fe208dbefda9bc84685e871bfc (diff)
downloadusbutils-3b4a2bfc223c023844c5349f3cfdb79bb6065647.tar.gz
Merge pull request #77 from philipl/master
Add support for Billboard Alt Mode descriptor (and a formatting fix)
-rw-r--r--lsusb.c22
-rw-r--r--lsusb.py.in2
2 files changed, 23 insertions, 1 deletions
diff --git a/lsusb.c b/lsusb.c
index c7d7ae1..55c7818 100644
--- a/lsusb.c
+++ b/lsusb.c
@@ -60,6 +60,7 @@
#define USB_DC_PLATFORM 0x05
#define USB_DC_SUPERSPEEDPLUS 0x0a
#define USB_DC_BILLBOARD 0x0d
+#define USB_DC_BILLBOARD_ALT_MODE 0x0f
#define USB_DC_CONFIGURATION_SUMMARY 0x10
/* Conventional codes for class-specific descriptors. The convention is
@@ -159,6 +160,7 @@ static void dump_midistreaming_endpoint(const unsigned char *buf);
static void dump_hub(const char *prefix, const unsigned char *p, int tt_type);
static void dump_ccid_device(const unsigned char *buf);
static void dump_billboard_device_capability_desc(libusb_device_handle *dev, unsigned char *buf);
+static void dump_billboard_alt_mode_capability_desc(libusb_device_handle *dev, unsigned char *buf);
/* ---------------------------------------------------------------------- */
@@ -3481,6 +3483,23 @@ static void dump_billboard_device_capability_desc(libusb_device_handle *dev, uns
free (url);
}
+static void dump_billboard_alt_mode_capability_desc(libusb_device_handle *dev, unsigned char *buf)
+{
+ if (buf[0] != 8) {
+ fprintf(stderr, " Bad Billboard Alternate Mode Capability descriptor.\n");
+ return;
+ }
+
+ printf(" Billboard Alternate Mode Capability:\n"
+ " bLength %5u\n"
+ " bDescriptorType %5u\n"
+ " bDevCapabilityType %5u\n"
+ " bIndex %5u\n"
+ " dwAlternateModeVdo 0x%02X%02X%02X%02X\n",
+ buf[0], buf[1], buf[2], buf[3],
+ buf[4], buf[5], buf[6], buf[7]);
+}
+
static void dump_bos_descriptor(libusb_device_handle *fd)
{
/* Total length of BOS descriptors varies.
@@ -3565,6 +3584,9 @@ static void dump_bos_descriptor(libusb_device_handle *fd)
case USB_DC_BILLBOARD:
dump_billboard_device_capability_desc(fd, buf);
break;
+ case USB_DC_BILLBOARD_ALT_MODE:
+ dump_billboard_alt_mode_capability_desc(fd, buf);
+ break;
case USB_DC_CONFIGURATION_SUMMARY:
printf(" Configuration Summary Device Capability:\n");
desc_dump(fd, desc_usb3_dc_configuration_summary,
diff --git a/lsusb.py.in b/lsusb.py.in
index 11325df..125996a 100644
--- a/lsusb.py.in
+++ b/lsusb.py.in
@@ -441,7 +441,7 @@ class UsbDevice:
plural = " "
else:
plural = "s"
- str = "%-16s %s%04x:%04x%s %02x %s%5sMbit/s %s %iIF%s (%s%s%s)" % \
+ str = "%-16s %s%04x:%04x%s %02x %s%6sMbit/s %5s %iIF%s (%s%s%s)" % \
(" " * self.level + self.fname,
cols[1], self.vid, self.pid, cols[0],
self.iclass, self.usbver, self.speed, self.maxpower,