summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2021-02-11 06:55:11 +0000
committeranton <anton@cvs.openbsd.org>2021-02-11 06:55:11 +0000
commit8f8f28bba9d7ae83ea03171660856062c99ba976 (patch)
tree9d6bd245732c514035497412bf1e411b92285aa2 /sys/dev
parent0b37b0cb5c609c4c0dddf28f21795bcd8043bd3f (diff)
Add uhidev_unset_report_dev(), doing the opposite of
uhidev_set_report_dev(). Needed by some upcoming changes to uhidpp. ok mglocker@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhidev.c12
-rw-r--r--sys/dev/usb/uhidev.h3
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/dev/usb/uhidev.c b/sys/dev/usb/uhidev.c
index 2999e40cc52..ed072c741d0 100644
--- a/sys/dev/usb/uhidev.c
+++ b/sys/dev/usb/uhidev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.c,v 1.87 2021/02/11 06:53:44 anton Exp $ */
+/* $OpenBSD: uhidev.c,v 1.88 2021/02/11 06:55:10 anton Exp $ */
/* $NetBSD: uhidev.c,v 1.14 2003/03/11 16:44:00 augustss Exp $ */
/*
@@ -1013,3 +1013,13 @@ uhidev_set_report_dev(struct uhidev_softc *sc, struct uhidev *dev, int repid)
sc->sc_subdevs[repid] = dev;
return 0;
}
+
+int
+uhidev_unset_report_dev(struct uhidev_softc *sc, int repid)
+{
+ if (repid >= sc->sc_nrepid)
+ return EINVAL;
+
+ sc->sc_subdevs[repid] = NULL;
+ return 0;
+}
diff --git a/sys/dev/usb/uhidev.h b/sys/dev/usb/uhidev.h
index 5caba3d8304..7cce36f515d 100644
--- a/sys/dev/usb/uhidev.h
+++ b/sys/dev/usb/uhidev.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhidev.h,v 1.26 2021/02/04 16:18:34 anton Exp $ */
+/* $OpenBSD: uhidev.h,v 1.27 2021/02/11 06:55:10 anton Exp $ */
/* $NetBSD: uhidev.h,v 1.3 2002/10/08 09:56:17 dan Exp $ */
/*
@@ -96,3 +96,4 @@ int uhidev_get_report_async(struct uhidev_softc *, int, int, void *, int,
void *, void (*)(void *, int, void *, int));
usbd_status uhidev_write(struct uhidev_softc *, void *, int);
int uhidev_set_report_dev(struct uhidev_softc *, struct uhidev *, int);
+int uhidev_unset_report_dev(struct uhidev_softc *, int);