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.
This commit is contained in:
Josef Karthauser 2002-01-21 03:35:55 +00:00
parent dcd7d9b7b7
commit ed98caba5f
2 changed files with 25 additions and 2 deletions

View File

@ -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;

View File

@ -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;