summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoraugustss <augustss@NetBSD.org>1998-12-03 20:43:19 +0000
committeraugustss <augustss@NetBSD.org>1998-12-03 20:43:19 +0000
commita68f1ef94c56478ddfc86fb60ab16174c04e5cf9 (patch)
tree8fba02bd673b5cdf88c94c5f996f2b9ad8a064bf /sys/dev
parentbedb40a78c1158db0fce8185d130b2a6bc1eedfb (diff)
Handle the case where the device does not support GET_PEPORT better.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/uhid.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index ad3dfb1e17f..41cf9bc2f36 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhid.c,v 1.8 1998/12/02 22:54:52 augustss Exp $ */
+/* $NetBSD: uhid.c,v 1.9 1998/12/03 20:43:19 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -455,9 +455,15 @@ uhidioctl(dev, cmd, addr, flag, p)
break;
case USB_SET_IMMED:
- if (*(int *)addr)
+ if (*(int *)addr) {
+ /* XXX should read into ibuf, but does it matter */
+ r = usbd_get_report(sc->sc_iface, UHID_INPUT_REPORT,
+ sc->sc_iid, sc->sc_ibuf,
+ sc->sc_isize);
+ if (r != USBD_NORMAL_COMPLETION)
+ return (EOPNOTSUPP);
sc->sc_state |= UHID_IMMED;
- else
+ } else
sc->sc_state &= ~UHID_IMMED;
break;