From owner-svn-src-all@FreeBSD.ORG Wed Dec 9 23:14:53 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 975E01065679; Wed, 9 Dec 2009 23:14:53 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 857728FC15; Wed, 9 Dec 2009 23:14:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nB9NErtg043759; Wed, 9 Dec 2009 23:14:53 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nB9NErno043757; Wed, 9 Dec 2009 23:14:53 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200912092314.nB9NErno043757@svn.freebsd.org> From: Andrew Thompson Date: Wed, 9 Dec 2009 23:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200339 - stable/8/usr.sbin/usbconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2009 23:14:53 -0000 Author: thompsa Date: Wed Dec 9 23:14:53 2009 New Revision: 200339 URL: http://svn.freebsd.org/changeset/base/200339 Log: MFC r198833 Add more verbose output when dumping the configuration descriptor. Modified: stable/8/usr.sbin/usbconfig/dump.c Directory Properties: stable/8/usr.sbin/usbconfig/ (props changed) Modified: stable/8/usr.sbin/usbconfig/dump.c ============================================================================== --- stable/8/usr.sbin/usbconfig/dump.c Wed Dec 9 23:12:52 2009 (r200338) +++ stable/8/usr.sbin/usbconfig/dump.c Wed Dec 9 23:14:53 2009 (r200339) @@ -100,21 +100,66 @@ dump_field(struct libusb20_device *pdev, printf("%s%s = 0x%04x ", plevel, field, value); - if ((field[0] != 'i') || (field[1] == 'd')) { - printf("\n"); - return; - } - if (value == 0) { - 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 (libusb20_dev_req_string_simple_sync(pdev, value, - temp_string, sizeof(temp_string))) { - 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; } - printf(" <%s>\n", temp_string); - return; + + /* No additional information */ + printf("\n"); } static void