summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhid.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-04-15 09:14:28 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-04-15 09:14:28 +0000
commit7b3d33ade85bbb91644090b39e1d10645747a407 (patch)
tree067cb6ae84b43262aee298b2502debdca9eb4e9c /sys/dev/usb/uhid.c
parenta26bb7a1ed69631c46838721abd3907e153d0a98 (diff)
Modify the uhidev_*_report() methods to always take a report ID argument
instead of using the default, per-driver, one. This is a step to move away from the 1 report ID <-> 1 driver design which is no longer true since the addition of upd(4). ok andre@
Diffstat (limited to 'sys/dev/usb/uhid.c')
-rw-r--r--sys/dev/usb/uhid.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index a2966a1ecf9..51b3e89a8ba 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhid.c,v 1.56 2014/03/19 08:59:37 mpi Exp $ */
+/* $OpenBSD: uhid.c,v 1.57 2014/04/15 09:14:27 mpi Exp $ */
/* $NetBSD: uhid.c,v 1.57 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -269,7 +269,8 @@ uhid_do_read(struct uhid_softc *sc, struct uio *uio, int flag)
DPRINTFN(1, ("uhidread immed\n"));
extra = sc->sc_hdev.sc_report_id != 0;
err = uhidev_get_report(&sc->sc_hdev, UHID_INPUT_REPORT,
- buffer, sc->sc_hdev.sc_isize + extra);
+ sc->sc_hdev.sc_report_id, buffer,
+ sc->sc_hdev.sc_isize + extra);
if (err)
return (EIO);
return (uiomove(buffer+extra, sc->sc_hdev.sc_isize, uio));
@@ -346,7 +347,7 @@ uhid_do_write(struct uhid_softc *sc, struct uio *uio, int flag)
error = uiomove(sc->sc_obuf, size, uio);
if (!error) {
err = uhidev_set_report(&sc->sc_hdev, UHID_OUTPUT_REPORT,
- sc->sc_obuf, size);
+ sc->sc_hdev.sc_report_id, sc->sc_obuf, size);
if (err)
error = EIO;
}
@@ -410,7 +411,8 @@ uhid_do_ioctl(struct uhid_softc *sc, u_long cmd, caddr_t addr,
if (*(int *)addr) {
extra = sc->sc_hdev.sc_report_id != 0;
err = uhidev_get_report(&sc->sc_hdev, UHID_INPUT_REPORT,
- buffer, sc->sc_hdev.sc_isize + extra);
+ sc->sc_hdev.sc_report_id, buffer,
+ sc->sc_hdev.sc_isize + extra);
if (err)
return (EOPNOTSUPP);