Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Add ioctl USB_SET_REPORT for uhid. This will al...



details:   https://anonhg.NetBSD.org/src/rev/35251321a992
branches:  trunk
changeset: 483857:35251321a992
user:      augustss <augustss%NetBSD.org@localhost>
date:      Sun Mar 19 22:23:28 2000 +0000

description:
Add ioctl USB_SET_REPORT for uhid.  This will allow manipulating the
feature items.

diffstat:

 sys/dev/usb/uhid.c |  26 +++++++++++++++++++++++++-
 sys/dev/usb/usb.h  |   3 ++-
 2 files changed, 27 insertions(+), 2 deletions(-)

diffs (57 lines):

diff -r cab5d30bfbf5 -r 35251321a992 sys/dev/usb/uhid.c
--- a/sys/dev/usb/uhid.c        Sun Mar 19 22:10:56 2000 +0000
+++ b/sys/dev/usb/uhid.c        Sun Mar 19 22:23:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhid.c,v 1.34 2000/02/29 21:37:01 augustss Exp $       */
+/*     $NetBSD: uhid.c,v 1.35 2000/03/19 22:23:28 augustss Exp $       */
 /*     $FreeBSD: src/sys/dev/usb/uhid.c,v 1.22 1999/11/17 22:33:43 n_hibma Exp $       */
 
 /*
@@ -635,6 +635,30 @@
                        return (EIO);
                break;
 
+       case USB_SET_REPORT:
+               re = (struct usb_ctl_report *)addr;
+               switch (re->report) {
+               case UHID_INPUT_REPORT:
+                       size = sc->sc_isize;
+                       id = sc->sc_iid;
+                       break;
+               case UHID_OUTPUT_REPORT:
+                       size = sc->sc_osize;
+                       id = sc->sc_oid;
+                       break;
+               case UHID_FEATURE_REPORT:
+                       size = sc->sc_fsize;
+                       id = sc->sc_fid;
+                       break;
+               default:
+                       return (EINVAL);
+               }
+               err = usbd_set_report(sc->sc_iface, re->report, id, re->data,
+                         size);
+               if (err)
+                       return (EIO);
+               break;
+
        default:
                return (EINVAL);
        }
diff -r cab5d30bfbf5 -r 35251321a992 sys/dev/usb/usb.h
--- a/sys/dev/usb/usb.h Sun Mar 19 22:10:56 2000 +0000
+++ b/sys/dev/usb/usb.h Sun Mar 19 22:23:28 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb.h,v 1.41 2000/02/29 21:37:01 augustss Exp $        */
+/*     $NetBSD: usb.h,v 1.42 2000/03/19 22:23:28 augustss Exp $        */
 /*     $FreeBSD: src/sys/dev/usb/usb.h,v 1.14 1999/11/17 22:33:46 n_hibma Exp $        */
 
 /*
@@ -571,6 +571,7 @@
 #define USB_GET_REPORT_DESC    _IOR ('U', 21, struct usb_ctl_report_desc)
 #define USB_SET_IMMED          _IOW ('U', 22, int)
 #define USB_GET_REPORT         _IOWR('U', 23, struct usb_ctl_report)
+#define USB_SET_REPORT         _IOW ('U', 24, struct usb_ctl_report)
 
 /* Generic USB device */
 #define USB_GET_CONFIG         _IOR ('U', 100, int)



Home | Main Index | Thread Index | Old Index