Bug 56097

Summary: Empty vendor string overrides known
Product: Base System Reporter: hburch <hburch>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.9-PRERELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description hburch 2003-08-28 21:20:13 UTC
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)

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):
How-To-Repeat: See description.
Comment 1 MIHIRA Sanpei Yoshiro freebsd_committer freebsd_triage 2004-01-18 12:46:33 UTC
State Changed
From-To: open->closed

Commited src/sys/dev/usb/usb_subr.c rev.1.58, Thanks.