ports/163726: sysutils/hal fills device_revision_bcd incorrectly
Stephen Hurd
shurd at sasktel.net
Sat Dec 31 01:40:07 UTC 2011
>Number: 163726
>Category: ports
>Synopsis: sysutils/hal fills device_revision_bcd incorrectly
>Confidential: no
>Severity: serious
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Dec 31 01:40:07 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Stephen Hurd
>Release: 8.2-RELEASE
>Organization:
>Environment:
FreeBSD stephen.hurd.local 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Fri Feb 18 02:24:46 UTC 2011 root at almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
The probe-usb2-device.c:191 (as patched) fills the device revision BCD field using the USB bcd data, resulting in incorrect data being used for matching and the device revision being unavailable to clients.
>How-To-Repeat:
Compare the output of "lhsal" usb_devuce.device_revision_bcd fields to the corresponding "usbconfig dump_device_desc" bcdDevice field.
>Fix:
Change line 191 to use bcdDevice rather than bcdUSB.
Updated patch for files directory attached.
Patch attached with submission follows:
--- hald/freebsd/probing/probe-usb2-device.c.orig 2009-08-24 05:42:29.000000000 -0700
+++ hald/freebsd/probing/probe-usb2-device.c 2011-12-30 17:20:52.000000000 -0800
@@ -148,15 +148,16 @@
bcdspeed = 0x01200;
break;
case LIBUSB20_SPEED_HIGH:
+ case LIBUSB20_SPEED_VARIABLE:
speed = 480.0;
bcdspeed = 0x48000;
break;
case LIBUSB20_SPEED_SUPER:
- speed = 4800.0;
- bcdspeed = 0x480000;
+ speed = 5000.0;
+ bcdspeed = 0x500000;
break;
default:
- ;
+ break;
}
libhal_device_set_property_double(hfp_ctx, hfp_udi, "usb_device.speed",
@@ -169,6 +170,9 @@
case UD_USB_2_0:
version = 2.0;
break;
+ case 0x0250:
+ version = 2.5;
+ break;
case UD_USB_3_0:
version = 3.0;
break;
@@ -184,7 +188,7 @@
libhal_device_set_property_int(hfp_ctx, hfp_udi,
"usb_device.vendor_id", di.udi_vendorNo, &hfp_error);
libhal_device_set_property_int(hfp_ctx, hfp_udi,
- "usb_device.device_revision_bcd", ddesc->bcdUSB, &hfp_error);
+ "usb_device.device_revision_bcd", ddesc->bcdDevice, &hfp_error);
libhal_device_set_property_string(hfp_ctx, hfp_udi,
"usb_device.serial", di.udi_serial, &hfp_error);
libhal_device_set_property_string(hfp_ctx, hfp_udi,
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list