From owner-p4-projects@FreeBSD.ORG Sun Sep 13 12:06:13 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E0F2D10656CB; Sun, 13 Sep 2009 12:06:12 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A551110656C7 for ; Sun, 13 Sep 2009 12:06:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF968FC17 for ; Sun, 13 Sep 2009 12:06:12 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DC6COE005976 for ; Sun, 13 Sep 2009 12:06:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n8DC6C3u005974 for perforce@freebsd.org; Sun, 13 Sep 2009 12:06:12 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 13 Sep 2009 12:06:12 GMT Message-Id: <200909131206.n8DC6C3u005974@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 168496 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 12:06:13 -0000 http://perforce.freebsd.org/chv.cgi?CH=168496 Change 168496 by hselasky@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("\n"); + else + printf("\n"); + return; + } + + if (strcmp(field, "bmAttributes") == 0) { + switch (value & 0x03) { + case 0: + printf("\n"); + break; + case 1: + switch (value & 0x0C) { + case 0x00: + printf("\n"); + break; + case 0x04: + printf("\n"); + break; + case 0x08: + printf("\n"); + break; + default: + printf("\n"); + break; + } + break; + case 2: + printf("\n"); + break; + default: + printf("\n"); + break; + } + return; + } } - if (value == 0) { - printf(" \n"); + + if ((field[0] == 'i') && (field[1] != 'd')) { + /* Indirect String Descriptor */ + if (value == 0) { + printf(" \n"); + return; + } + if (libusb20_dev_req_string_simple_sync(pdev, value, + temp_string, sizeof(temp_string))) { + printf(" \n"); + return; + } + printf(" <%s>\n", temp_string); return; } - if (libusb20_dev_req_string_simple_sync(pdev, value, - temp_string, sizeof(temp_string))) { - printf(" \n"); - return; - } - printf(" <%s>\n", temp_string); - return; + + /* No additional information */ + printf("\n"); } static void