summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2002-01-21 03:35:55 +0000
committerjoe <joe@FreeBSD.org>2002-01-21 03:35:55 +0000
commit2a5c822c6c779312f6d91e906acd3ae54e556416 (patch)
tree32bd4985c8e8148ce70c537d8dfbdac0b332d499 /sys
parent4e0549db5573bd438ce183a3604b25b9ee373c32 (diff)
downloadFreeBSD-src-2a5c822c6c779312f6d91e906acd3ae54e556416.zip
FreeBSD-src-2a5c822c6c779312f6d91e906acd3ae54e556416.tar.gz
Merge from NetBSD:
uhci.c: -r1.82 uhcivar.h: -r1.22 date: 2000/01/26 10:04:39; author: augustss; state: Exp; Try to avoid accessing the HC if it is dead. Suggested by mycroft.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/uhci.c24
-rw-r--r--sys/dev/usb/uhcivar.h3
2 files changed, 25 insertions, 2 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 2d2b823..33c2b76 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $NetBSD: uhci.c,v 1.80 2000/01/19 01:16:38 augustss Exp $ */
+/* $NetBSD: uhci.c,v 1.82 2000/01/26 10:04:38 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -1129,6 +1129,7 @@ uhci_intr(void *arg)
/* no acknowledge needed */
printf("%s: host controller halted\n",
USBDEVNAME(sc->sc_bus.bdev));
+ sc->sc_dying = 1;
}
if (ack) { /* acknowledge the ints */
@@ -1671,6 +1672,9 @@ uhci_device_bulk_start(usbd_xfer_handle xfer)
DPRINTFN(3, ("uhci_device_bulk_transfer: xfer=%p len=%d flags=%d\n",
xfer, xfer->length, xfer->flags));
+ if (sc->sc_dying)
+ return (USBD_IOERROR);
+
#ifdef DIAGNOSTIC
if (xfer->rqflags & URQ_REQUEST)
panic("uhci_device_bulk_transfer: a request\n");
@@ -1833,6 +1837,9 @@ uhci_device_ctrl_start(usbd_xfer_handle xfer)
uhci_softc_t *sc = (uhci_softc_t *)xfer->pipe->device->bus;
usbd_status err;
+ if (sc->sc_dying)
+ return (USBD_IOERROR);
+
#ifdef DIAGNOSTIC
if (!(xfer->rqflags & URQ_REQUEST))
panic("uhci_device_ctrl_transfer: not a request\n");
@@ -1876,6 +1883,9 @@ uhci_device_intr_start(usbd_xfer_handle xfer)
usbd_status err;
int i, s;
+ if (sc->sc_dying)
+ return (USBD_IOERROR);
+
DPRINTFN(3,("uhci_device_intr_transfer: xfer=%p len=%d flags=%d\n",
xfer, xfer->length, xfer->flags));
@@ -2172,6 +2182,9 @@ uhci_device_isoc_enter(usbd_xfer_handle xfer)
"nframes=%d\n",
iso->inuse, iso->next, xfer, xfer->nframes));
+ if (sc->sc_dying)
+ return;
+
if (xfer->status == USBD_IN_PROGRESS) {
/* This request has already been entered into the frame list */
printf("uhci_device_isoc_enter: xfer=%p in frame list\n", xfer);
@@ -2235,6 +2248,9 @@ uhci_device_isoc_start(usbd_xfer_handle xfer)
DPRINTFN(5,("uhci_device_isoc_start: xfer=%p\n", xfer));
+ if (sc->sc_dying)
+ return (USBD_IOERROR);
+
#ifdef DIAGNOSTIC
if (xfer->status != USBD_IN_PROGRESS)
printf("uhci_device_isoc_start: not in progress %p\n", xfer);
@@ -2833,6 +2849,9 @@ uhci_root_ctrl_start(usbd_xfer_handle xfer)
usb_port_status_t ps;
usbd_status err;
+ if (sc->sc_dying)
+ return (USBD_IOERROR);
+
#ifdef DIAGNOSTIC
if (!(xfer->rqflags & URQ_REQUEST))
panic("uhci_root_ctrl_transfer: not a request\n");
@@ -3210,6 +3229,9 @@ uhci_root_intr_start(usbd_xfer_handle xfer)
DPRINTFN(3, ("uhci_root_intr_transfer: xfer=%p len=%d flags=%d\n",
xfer, xfer->length, xfer->flags));
+ if (sc->sc_dying)
+ return (USBD_IOERROR);
+
sc->sc_ival = MS_TO_TICKS(xfer->pipe->endpoint->edesc->bInterval);
usb_timeout(uhci_timo, xfer, sc->sc_ival, xfer->timo_handle);
sc->sc_has_timo = xfer;
diff --git a/sys/dev/usb/uhcivar.h b/sys/dev/usb/uhcivar.h
index be50295..5183f84 100644
--- a/sys/dev/usb/uhcivar.h
+++ b/sys/dev/usb/uhcivar.h
@@ -1,4 +1,4 @@
-/* $NetBSD: uhcivar.h,v 1.21 2000/01/18 20:11:01 augustss Exp $ */
+/* $NetBSD: uhcivar.h,v 1.22 2000/01/26 10:04:39 augustss Exp $ */
/* $FreeBSD$ */
/*
@@ -163,6 +163,7 @@ typedef struct uhci_softc {
char sc_isreset;
char sc_suspend;
+ char sc_dying;
LIST_HEAD(, uhci_intr_info) sc_intrhead;
OpenPOWER on IntegriCloud