Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb More DIAGNOSTIC messages.
details: https://anonhg.NetBSD.org/src/rev/aba57cb4a5b9
branches: trunk
changeset: 474871:aba57cb4a5b9
user: augustss <augustss%NetBSD.org@localhost>
date: Sat Jul 24 01:40:19 1999 +0000
description:
More DIAGNOSTIC messages.
diffstat:
sys/dev/usb/ukbd.c | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diffs (43 lines):
diff -r 0ce732a56e29 -r aba57cb4a5b9 sys/dev/usb/ukbd.c
--- a/sys/dev/usb/ukbd.c Fri Jul 23 22:45:23 1999 +0000
+++ b/sys/dev/usb/ukbd.c Sat Jul 24 01:40:19 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ukbd.c,v 1.37 1999/06/30 06:44:23 augustss Exp $ */
+/* $NetBSD: ukbd.c,v 1.38 1999/07/24 01:40:19 augustss Exp $ */
/*
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -385,13 +385,18 @@
struct ukbd_softc *sc = v;
usbd_status r;
+ /* Should only be called to change state */
+ if (sc->sc_enabled == on) {
+#ifdef DIAGNOSTIC
+ printf("ukbd_enable: %s: bad call on=%d\n",
+ USBDEVNAME(sc->sc_dev), on);
+#endif
+ return (EBUSY);
+ }
+
DPRINTF(("ukbd_enable: sc=%p on=%d\n", sc, on));
if (on) {
/* Set up interrupt pipe. */
- if (sc->sc_enabled)
- return (EBUSY);
-
- sc->sc_enabled = 1;
r = usbd_open_pipe_intr(sc->sc_iface, sc->sc_ep_addr,
USBD_SHORT_XFER_OK,
&sc->sc_intrpipe, sc, &sc->sc_ndata,
@@ -402,9 +407,8 @@
/* Disable interrupts. */
usbd_abort_pipe(sc->sc_intrpipe);
usbd_close_pipe(sc->sc_intrpipe);
-
- sc->sc_enabled = 0;
}
+ sc->sc_enabled = on;
return (0);
}
Home |
Main Index |
Thread Index |
Old Index