summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2005-04-19 08:21:48 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2005-04-19 08:21:48 +0000
commit90a9ae2e48f09bb46038c9dd15954e8ecb6df391 (patch)
tree48cb1d83d60028712119a83465388968c93b17f1 /sys/dev
parent1515dac3f44395b86eb4a2bd730cf6e165823673 (diff)
be more cautious when processing CMV interrupts.
drop every CMV reply that is not a CR or CW ack.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/ueagle.c19
-rw-r--r--sys/dev/usb/ueaglereg.h3
2 files changed, 12 insertions, 10 deletions
diff --git a/sys/dev/usb/ueagle.c b/sys/dev/usb/ueagle.c
index da4dcb9d8dd..0d9218961fb 100644
--- a/sys/dev/usb/ueagle.c
+++ b/sys/dev/usb/ueagle.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ueagle.c,v 1.1 2005/04/16 14:55:10 damien Exp $ */
+/* $OpenBSD: ueagle.c,v 1.2 2005/04/19 08:21:46 damien Exp $ */
/*-
* Copyright (c) 2003-2005
@@ -665,17 +665,18 @@ ueagle_cmv_intr(struct ueagle_softc *sc, struct ueagle_cmv *cmv)
/* synchronize our current CMV index with the modem */
sc->index = UGETW(cmv->wIndex) + 1;
- /* handle spontaneous CMVs */
- if (cmv->bFunction == UEAGLE_MODEMREADY) {
+ switch (cmv->bFunction) {
+ case UEAGLE_MODEMREADY:
wakeup(UEAGLE_COND_READY(sc));
- return;
- }
+ break;
- /* if it is the ack of a previous CR, save the data field */
- if (cmv->bFunction == UEAGLE_CR_ACK)
+ case UEAGLE_CR_ACK:
sc->data = UGETDATA(cmv->dwData);
-
- wakeup(UEAGLE_COND_CMV(sc));
+ /* FALLTHROUGH */
+ case UEAGLE_CW_ACK:
+ wakeup(UEAGLE_COND_CMV(sc));
+ break;
+ }
}
Static void
diff --git a/sys/dev/usb/ueaglereg.h b/sys/dev/usb/ueaglereg.h
index f6e2ed8b843..50da45ce610 100644
--- a/sys/dev/usb/ueaglereg.h
+++ b/sys/dev/usb/ueaglereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ueaglereg.h,v 1.1 2005/04/16 14:55:10 damien Exp $ */
+/* $OpenBSD: ueaglereg.h,v 1.2 2005/04/19 08:21:47 damien Exp $ */
/*-
* Copyright (c) 2003-2005
@@ -82,6 +82,7 @@ struct ueagle_cmv {
#define UEAGLE_CR 0x10
#define UEAGLE_CW 0x11
#define UEAGLE_CR_ACK 0x12
+#define UEAGLE_CW_ACK 0x13
#define UEAGLE_MODEMREADY 0x71
uWord wIndex;