Module Name: src
Committed By: erh
Date: Mon May 14 04:28:28 UTC 2012
Modified Files:
src/share/man/man4: uhid.4
src/sys/dev/usb: uhid.c
Log Message:
Implement USB_GET_DEVICE_DESC for uhid devices so there's a way to get the
product and vendor information.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/share/man/man4/uhid.4
cvs rdiff -u -r1.86 -r1.87 src/sys/dev/usb/uhid.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man4/uhid.4
diff -u src/share/man/man4/uhid.4:1.20 src/share/man/man4/uhid.4:1.21
--- src/share/man/man4/uhid.4:1.20 Wed Apr 30 13:10:54 2008
+++ src/share/man/man4/uhid.4 Mon May 14 04:28:27 2012
@@ -1,4 +1,4 @@
-.\" $NetBSD: uhid.4,v 1.20 2008/04/30 13:10:54 martin Exp $
+.\" $NetBSD: uhid.4,v 1.21 2012/05/14 04:28:27 erh Exp $
.\"
.\" Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -115,6 +115,8 @@ It should be
or
.Dv UHID_FEATURE_REPORT .
This call may fail if the device does not support this feature.
+.It Dv USB_GET_DEVICE_DESC (usb_device_descriptor_t)
+Return the device descriptor.
.It Dv USB_GET_DEVICEINFO (struct usb_device_info)
Get an information summary for the device.
This call will not issue any USB transactions.
Index: src/sys/dev/usb/uhid.c
diff -u src/sys/dev/usb/uhid.c:1.86 src/sys/dev/usb/uhid.c:1.87
--- src/sys/dev/usb/uhid.c:1.86 Tue Mar 6 03:35:29 2012
+++ src/sys/dev/usb/uhid.c Mon May 14 04:28:28 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: uhid.c,v 1.86 2012/03/06 03:35:29 mrg Exp $ */
+/* $NetBSD: uhid.c,v 1.87 2012/05/14 04:28:28 erh Exp $ */
/*
* Copyright (c) 1998, 2004, 2008 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.86 2012/03/06 03:35:29 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhid.c,v 1.87 2012/05/14 04:28:28 erh Exp $");
#include "opt_compat_netbsd.h"
@@ -570,6 +570,11 @@ uhid_do_ioctl(struct uhid_softc *sc, u_l
*(int *)addr = sc->sc_hdev.sc_report_id;
break;
+ case USB_GET_DEVICE_DESC:
+ *(usb_device_descriptor_t *)addr =
+ *usbd_get_device_descriptor(sc->sc_hdev.sc_parent->sc_udev);
+ break;
+
case USB_GET_DEVICEINFO:
usbd_fill_deviceinfo(sc->sc_hdev.sc_parent->sc_udev,
(struct usb_device_info *)addr, 0);