summaryrefslogtreecommitdiff
path: root/sys/dev/usb/ukbd.c
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2014-12-11 18:39:29 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2014-12-11 18:39:29 +0000
commit477855b2148747cf0d884fbb75161e499ca2e59b (patch)
tree355e99d084405d2b06ae181119aaf6f669ff74ee /sys/dev/usb/ukbd.c
parenta43ef9f4e1de588a8b9d1d58f293c60cc514c11a (diff)
Change uhidev(4) set/get report functions in various way.
Always pass the parent uhidev(4) descriptor corresponding to the single USB device with multiple reportIDs instead of a child. Make uhidev_get_report() aware of non NUL reportID by prepending a byte to the given buffer, just like uhidev_set_report{,async}() already do. Return the number of bytes written or read upon success and -1 otherwise. This allow callers to deal with short reads without having do mess with xfer error codes madness. Reviewed and tested by David Higgs.
Diffstat (limited to 'sys/dev/usb/ukbd.c')
-rw-r--r--sys/dev/usb/ukbd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/usb/ukbd.c b/sys/dev/usb/ukbd.c
index 856bbe50671..5420ceec78e 100644
--- a/sys/dev/usb/ukbd.c
+++ b/sys/dev/usb/ukbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ukbd.c,v 1.68 2014/08/21 14:52:55 mpi Exp $ */
+/* $OpenBSD: ukbd.c,v 1.69 2014/12/11 18:39:27 mpi Exp $ */
/* $NetBSD: ukbd.c,v 1.85 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -363,8 +363,8 @@ ukbd_set_leds(void *v, int leds)
return;
if (sc->sc_ledsize && hidkbd_set_leds(kbd, leds, &res) != 0)
- uhidev_set_report_async(&sc->sc_hdev, UHID_OUTPUT_REPORT,
- sc->sc_hdev.sc_report_id, &res, 1);
+ uhidev_set_report_async(sc->sc_hdev.sc_parent,
+ UHID_OUTPUT_REPORT, sc->sc_hdev.sc_report_id, &res, 1);
}
int