PERFORCE change 168496 for review
Hans Petter Selasky
hselasky at FreeBSD.org
Sun Sep 13 12:06:13 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=168496
Change 168496 by hselasky at hselasky_laptop001 on 2009/09/13 12:05:14
usbconfig:
- add more verbose output when dumping the configuration
descriptor.
Affected files ...
.. //depot/projects/usb/src/usr.sbin/usbconfig/dump.c#14 edit
Differences ...
==== //depot/projects/usb/src/usr.sbin/usbconfig/dump.c#14 (text+ko) ====
@@ -100,21 +100,66 @@
printf("%s%s = 0x%04x ", plevel, field, value);
- if ((field[0] != 'i') || (field[1] == 'd')) {
- printf("\n");
- return;
+ if (strlen(plevel) == 8) {
+ /* Endpoint Descriptor */
+
+ if (strcmp(field, "bEndpointAddress") == 0) {
+ if (value & 0x80)
+ printf("<IN>\n");
+ else
+ printf("<OUT>\n");
+ return;
+ }
+
+ if (strcmp(field, "bmAttributes") == 0) {
+ switch (value & 0x03) {
+ case 0:
+ printf("<CONTROL>\n");
+ break;
+ case 1:
+ switch (value & 0x0C) {
+ case 0x00:
+ printf("<ISOCHRONOUS>\n");
+ break;
+ case 0x04:
+ printf("<ASYNC-ISOCHRONOUS>\n");
+ break;
+ case 0x08:
+ printf("<ADAPT-ISOCHRONOUS>\n");
+ break;
+ default:
+ printf("<SYNC-ISOCHRONOUS>\n");
+ break;
+ }
+ break;
+ case 2:
+ printf("<BULK>\n");
+ break;
+ default:
+ printf("<INTERRUPT>\n");
+ break;
+ }
+ return;
+ }
}
- if (value == 0) {
- printf(" <no string>\n");
+
+ if ((field[0] == 'i') && (field[1] != 'd')) {
+ /* Indirect String Descriptor */
+ if (value == 0) {
+ printf(" <no string>\n");
+ return;
+ }
+ if (libusb20_dev_req_string_simple_sync(pdev, value,
+ temp_string, sizeof(temp_string))) {
+ printf(" <retrieving string failed>\n");
+ return;
+ }
+ printf(" <%s>\n", temp_string);
return;
}
- if (libusb20_dev_req_string_simple_sync(pdev, value,
- temp_string, sizeof(temp_string))) {
- printf(" <retrieving string failed>\n");
- return;
- }
- printf(" <%s>\n", temp_string);
- return;
+
+ /* No additional information */
+ printf("\n");
}
static void
More information about the p4-projects
mailing list