From 7b3d33ade85bbb91644090b39e1d10645747a407 Mon Sep 17 00:00:00 2001 From: Martin Pieuchot Date: Tue, 15 Apr 2014 09:14:28 +0000 Subject: 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@ --- sys/dev/usb/uhid.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/dev/usb/uhid.c') 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); -- cgit v1.2.3