Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Implement USB_GET_DEVICE_DESC for uhid devices so there's a ...



details:   https://anonhg.NetBSD.org/src/rev/7cc3514bcefc
branches:  trunk
changeset: 779257:7cc3514bcefc
user:      erh <erh%NetBSD.org@localhost>
date:      Mon May 14 04:28:27 2012 +0000

description:
Implement USB_GET_DEVICE_DESC for uhid devices so there's a way to get the
product and vendor information.

diffstat:

 share/man/man4/uhid.4 |  4 +++-
 sys/dev/usb/uhid.c    |  9 +++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r 4faba9a568c2 -r 7cc3514bcefc share/man/man4/uhid.4
--- a/share/man/man4/uhid.4     Sun May 13 19:29:59 2012 +0000
+++ b/share/man/man4/uhid.4     Mon May 14 04:28:27 2012 +0000
@@ -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 @@
 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.
diff -r 4faba9a568c2 -r 7cc3514bcefc sys/dev/usb/uhid.c
--- a/sys/dev/usb/uhid.c        Sun May 13 19:29:59 2012 +0000
+++ b/sys/dev/usb/uhid.c        Mon May 14 04:28:27 2012 +0000
@@ -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 @@
                *(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);



Home | Main Index | Thread Index | Old Index