summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/uhid.c
diff options
context:
space:
mode:
authorn_hibma <n_hibma@FreeBSD.org>1999-05-09 20:13:51 +0000
committern_hibma <n_hibma@FreeBSD.org>1999-05-09 20:13:51 +0000
commitee4d1deb7c9a611d947906a247addb5186c7597b (patch)
tree49302b4214127c6725a0398f03b64e21832aa835 /sys/dev/usb/uhid.c
parent00d71de444cebd8e8fb9f1a6f538b0e25756fcbd (diff)
downloadFreeBSD-src-ee4d1deb7c9a611d947906a247addb5186c7597b.zip
FreeBSD-src-ee4d1deb7c9a611d947906a247addb5186c7597b.tar.gz
Enable the support for a file interface on the HID driver for
easy testing of the HID reports that come back. Submitted by: MAEKAWA Masahide <bishop@rr.iij4u.or.jp>
Diffstat (limited to 'sys/dev/usb/uhid.c')
-rw-r--r--sys/dev/usb/uhid.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 1729a92..4792809 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -52,6 +52,7 @@
#include <sys/ioctl.h>
#elif defined(__FreeBSD__)
#include <sys/ioccom.h>
+#include <sys/conf.h>
#include <sys/filio.h>
#include <sys/module.h>
#include <sys/bus.h>
@@ -114,12 +115,31 @@ struct uhid_softc {
#define UHID_CHUNK 128 /* chunk size for read */
#define UHID_BSIZE 1020 /* buffer size */
+#if defined(__NetBSD__)
int uhidopen __P((dev_t, int, int, struct proc *));
int uhidclose __P((dev_t, int, int, struct proc *p));
int uhidread __P((dev_t, struct uio *uio, int));
int uhidwrite __P((dev_t, struct uio *uio, int));
int uhidioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
int uhidpoll __P((dev_t, int, struct proc *));
+#elif defined(__FreeBSD__)
+d_open_t uhidopen;
+d_close_t uhidclose;
+d_read_t uhidread;
+d_write_t uhidwrite;
+d_ioctl_t uhidioctl;
+d_poll_t uhidpoll;
+
+#define UHID_CDEV_MAJOR 122
+
+static struct cdevsw uhid_cdevsw = {
+ uhidopen, uhidclose, uhidread, uhidwrite,
+ uhidioctl, nostop, nullreset, nodevtotty,
+ uhidpoll, nommap, nostrat,
+ "uhid", NULL, -1
+};
+#endif
+
void uhid_intr __P((usbd_request_handle, usbd_private_handle, usbd_status));
void uhid_disco __P((void *));
@@ -542,5 +562,6 @@ uhidpoll(dev, events, p)
}
#if defined(__FreeBSD__)
-DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass, usbd_driver_load, 0);
+DEV_DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass,
+ UHID_CDEV_MAJOR, NOMAJ, uhid_cdevsw, usbd_driver_load, 0);
#endif
OpenPOWER on IntegriCloud