svn commit: r194068 - head/sys/dev/usb/input
Andrew Thompson
thompsa at FreeBSD.org
Fri Jun 12 16:04:34 UTC 2009
Author: thompsa
Date: Fri Jun 12 16:04:32 2009
New Revision: 194068
URL: http://svn.freebsd.org/changeset/base/194068
Log:
Change ums_probe() so it does not need to fetch the usb_interface_descriptor.
Submitted by: Hans Petter Selasky
Modified:
head/sys/dev/usb/input/ums.c
Modified: head/sys/dev/usb/input/ums.c
==============================================================================
--- head/sys/dev/usb/input/ums.c Fri Jun 12 16:03:38 2009 (r194067)
+++ head/sys/dev/usb/input/ums.c Fri Jun 12 16:04:32 2009 (r194068)
@@ -332,7 +332,6 @@ static int
ums_probe(device_t dev)
{
struct usb_attach_arg *uaa = device_get_ivars(dev);
- struct usb_interface_descriptor *id;
void *d_ptr;
int error;
uint16_t d_len;
@@ -342,12 +341,13 @@ ums_probe(device_t dev)
if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
- id = usb2_get_interface_descriptor(uaa->iface);
-
- if ((id == NULL) ||
- (id->bInterfaceClass != UICLASS_HID))
+ if (uaa->info.bInterfaceClass != UICLASS_HID)
return (ENXIO);
+ if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) &&
+ (uaa->info.bInterfaceProtocol == UIPROTO_MOUSE))
+ return (0);
+
error = usb2_req_get_hid_desc(uaa->device, NULL,
&d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
@@ -357,9 +357,6 @@ ums_probe(device_t dev)
if (hid_is_collection(d_ptr, d_len,
HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)))
error = 0;
- else if ((id->bInterfaceSubClass == UISUBCLASS_BOOT) &&
- (id->bInterfaceProtocol == UIPROTO_MOUSE))
- error = 0;
else
error = ENXIO;
More information about the svn-src-head
mailing list