From: Sascha Wildner Date: Wed, 31 Dec 2014 03:46:11 +0000 (+0100) Subject: usbconfig(8): Sync with FreeBSD (decodes bDeviceClass/bInterfaceClass). X-Git-Tag: v4.2.0rc~1227 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/19397f8df3433c756af019c682819a685259d8c9 usbconfig(8): Sync with FreeBSD (decodes bDeviceClass/bInterfaceClass). --- diff --git a/usr.sbin/usbconfig/dump.c b/usr.sbin/usbconfig/dump.c index b62697cef1..a207d2283d 100644 --- a/usr.sbin/usbconfig/dump.c +++ b/usr.sbin/usbconfig/dump.c @@ -1,4 +1,4 @@ -/* $FreeBSD: head/usr.sbin/usbconfig/dump.c 246789 2013-02-14 12:22:40Z hselasky $ */ +/* $FreeBSD: head/usr.sbin/usbconfig/dump.c 274435 2014-11-12 14:52:44Z hselasky $ */ /*- * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. * @@ -110,7 +110,6 @@ dump_field(struct libusb20_device *pdev, const char *plevel, printf(" \n"); return; } - if (strcmp(field, "bmAttributes") == 0) { switch (value & 0x03) { case 0: @@ -142,7 +141,6 @@ dump_field(struct libusb20_device *pdev, const char *plevel, return; } } - if ((field[0] == 'i') && (field[1] != 'd')) { /* Indirect String Descriptor */ if (value == 0) { @@ -157,7 +155,84 @@ dump_field(struct libusb20_device *pdev, const char *plevel, printf(" <%s>\n", temp_string); return; } + if (strlen(plevel) == 2 || strlen(plevel) == 6) { + + /* Device and Interface Descriptor class codes */ + + if (strcmp(field, "bInterfaceClass") == 0 || + strcmp(field, "bDeviceClass") == 0) { + switch (value) { + case 0x00: + printf(" \n"); + break; + case 0x01: + printf("