From owner-freebsd-bugs@FreeBSD.ORG Thu Aug 28 13:20:17 2003 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 82E1C16A4C0 for ; Thu, 28 Aug 2003 13:20:17 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id F0D4443FF9 for ; Thu, 28 Aug 2003 13:20:13 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with ESMTP id h7SKKDUp090600 for ; Thu, 28 Aug 2003 13:20:13 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.9/8.12.9/Submit) id h7SKKDBF090599; Thu, 28 Aug 2003 13:20:13 -0700 (PDT) Resent-Date: Thu, 28 Aug 2003 13:20:13 -0700 (PDT) Resent-Message-Id: <200308282020.h7SKKDBF090599@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Hal Burch Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AC39716A4BF for ; Thu, 28 Aug 2003 13:13:31 -0700 (PDT) Received: from exgw2.lumeta.com (exgw4.lumeta.com [65.246.240.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id B5EB943FE0 for ; Thu, 28 Aug 2003 13:13:30 -0700 (PDT) (envelope-from hburch@lumeta.com) Received: from lucy.corp.lumeta.com (h65-246-245-10.lumeta.com [65.246.245.10]) by exgw2.lumeta.com (Postfix) with ESMTP id 5323F373865 for ; Thu, 28 Aug 2003 16:13:30 -0400 (EDT) Received: from localhost (localhost.corp.lumeta.com [127.0.0.1]) by lucy.corp.lumeta.com (Postfix) with ESMTP id 33DD4A8938 for ; Thu, 28 Aug 2003 16:13:30 -0400 (EDT) Received: from lucy.corp.lumeta.com ([127.0.0.1]) by localhost (lucy.corp.lumeta.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09212-04 for ; Thu, 28 Aug 2003 16:13:29 -0400 (EDT) Received: from hburch.corp.lumeta.com (hburch.corp.lumeta.com [65.246.246.59]) by lucy.corp.lumeta.com (Postfix) with ESMTP id AE4C9A8934 for ; Thu, 28 Aug 2003 16:13:29 -0400 (EDT) Received: by hburch.corp.lumeta.com (Postfix, from userid 2007) id 65A42256; Thu, 28 Aug 2003 16:13:28 -0400 (EDT) Message-Id: <20030828201328.65A42256@hburch.corp.lumeta.com> Date: Thu, 28 Aug 2003 16:13:28 -0400 (EDT) From: Hal Burch To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: kern/56097: Empty vendor string overrides known X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Hal Burch List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2003 20:20:17 -0000 >Number: 56097 >Category: kern >Synopsis: Empty vendor string overrides known >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Aug 28 13:20:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Hal Burch >Release: FreeBSD 4.9-PRERELEASE i386 >Organization: Lumeta Corporation >Environment: FreeBSD hburch-lap.hburch.com 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #23: Thu Aug 28 15:03:26 EDT 2003 root@hburch-lap.hburch.com:/usr/src/sys/compile/LOCAL i386 >Description: Bought a USB "Pen Drive lite 2.0" (128MB). Plugged in. Reported as: # usbdevs -v Controller /dev/usb0: addr 1: self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00 port 1 addr 2: power 500 mA, config 1, USB DISK 2.0(0x1300), (0x0d7d), rev 0.50 port 2 powered Added lines to usbdevs: vendor APACER 0x0d7d Apacer product APACER PENDRIVE 0x1300 USB Pen Drive 2.0 No change to output after rebuilding (including make -f Makefile.usbdevs) >How-To-Repeat: See description. >Fix: usbd_devinfo_vp() is getting an empty string from its usbd_get_string() call on the vendor, instead of NULL. This means usb_knowndevs in not consulted. Add lines between grabbing those char *s and the USBVERBOSE ifdef to set vendor to NULL if it is the empty string (similarly for product). This causes vendor to be filled-out, although the product name read overrules usb_knowndevs (this appears to be a conscience decision made by the NetBSD folks): # usbdevs -v Controller /dev/usb0: addr 1: self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00 port 1 addr 2: power 500 mA, config 1, USB DISK 2.0(0x1300), Apacer(0x0d7d), rev 0.50 port 2 powered Patch against usb_subr.c 1.23.2.8 (although only minor changes appear needed for 1.57, I do not have a 5.x box): *** /tmp/usb_subr.c Thu Aug 28 16:05:34 2003 --- ./usb_subr.c Thu Aug 28 16:06:15 2003 *************** *** 229,234 **** --- 229,238 ---- vendor = usbd_get_string(dev, udd->iManufacturer, v); product = usbd_get_string(dev, udd->iProduct, p); + if (vendor && !*vendor) + vendor = NULL; + if (product && !*product) + product = NULL; #ifdef USBVERBOSE if (vendor == NULL || product == NULL) { for(kdp = usb_knowndevs; >Release-Note: >Audit-Trail: >Unformatted: