From owner-svn-src-all@FreeBSD.ORG Wed Nov 19 08:55:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DB5D1A8; Wed, 19 Nov 2014 08:55:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EDA65E3; Wed, 19 Nov 2014 08:55:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAJ8t8cC099752; Wed, 19 Nov 2014 08:55:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAJ8t83Z099751; Wed, 19 Nov 2014 08:55:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411190855.sAJ8t83Z099751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Nov 2014 08:55:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r274701 - stable/9/usr.sbin/usbconfig X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 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, 19 Nov 2014 08:55:08 -0000 Author: hselasky Date: Wed Nov 19 08:55:07 2014 New Revision: 274701 URL: https://svnweb.freebsd.org/changeset/base/274701 Log: MFC r274435: Decode more fields when dumping USB descriptors. - Some minor style changes while at it. Modified: stable/9/usr.sbin/usbconfig/dump.c Directory Properties: stable/9/usr.sbin/ (props changed) Modified: stable/9/usr.sbin/usbconfig/dump.c ============================================================================== --- stable/9/usr.sbin/usbconfig/dump.c Wed Nov 19 08:51:15 2014 (r274700) +++ stable/9/usr.sbin/usbconfig/dump.c Wed Nov 19 08:55:07 2014 (r274701) @@ -110,7 +110,6 @@ dump_field(struct libusb20_device *pdev, printf(" \n"); return; } - if (strcmp(field, "bmAttributes") == 0) { switch (value & 0x03) { case 0: @@ -142,7 +141,6 @@ dump_field(struct libusb20_device *pdev, return; } } - if ((field[0] == 'i') && (field[1] != 'd')) { /* Indirect String Descriptor */ if (value == 0) { @@ -157,7 +155,84 @@ dump_field(struct libusb20_device *pdev, 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("