aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHidetoshi Shimokawa <simokawa@FreeBSD.org>2003-08-04 05:43:02 +0000
committerHidetoshi Shimokawa <simokawa@FreeBSD.org>2003-08-04 05:43:02 +0000
commit183498934bdc4eedcb346ef8fdb32415e2f30d27 (patch)
treeea7d6fd07372d1061e8f09bca0f1582282dec77d
parent30c1156451507f7b5f47d8b5822a433793f95e30 (diff)
Notes
-rw-r--r--sys/dev/firewire/fwohci.c8
-rw-r--r--sys/dev/firewire/fwohci_pci.c13
2 files changed, 14 insertions, 7 deletions
diff --git a/sys/dev/firewire/fwohci.c b/sys/dev/firewire/fwohci.c
index f3ca25679a1c..b007f7646a77 100644
--- a/sys/dev/firewire/fwohci.c
+++ b/sys/dev/firewire/fwohci.c
@@ -584,6 +584,11 @@ fwohci_init(struct fwohci_softc *sc, device_t dev)
device_printf(dev, "OHCI version %x.%x (ROM=%d)\n",
(reg>>16) & 0xff, reg & 0xff, (reg>>24) & 1);
+ if (((reg>>16) & 0xff) < 1) {
+ device_printf(dev, "invalid OHCI version\n");
+ return (ENXIO);
+ }
+
/* Available Isochrounous DMA channel probe */
OWRITE(sc, OHCI_IT_MASK, 0xffffffff);
OWRITE(sc, OHCI_IR_MASK, 0xffffffff);
@@ -1690,7 +1695,8 @@ fwohci_stop(struct fwohci_softc *sc, device_t dev)
| OHCI_INT_DMA_ARRQ | OHCI_INT_DMA_ARRS
| OHCI_INT_PHY_BUS_R);
- fw_drain_txq(&sc->fc);
+ if (sc->fc.arq !=0 && sc->fc.arq->maxq > 0)
+ fw_drain_txq(&sc->fc);
/* XXX Link down? Bus reset? */
return 0;
diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c
index 0ac6b0040374..513343ae97ee 100644
--- a/sys/dev/firewire/fwohci_pci.c
+++ b/sys/dev/firewire/fwohci_pci.c
@@ -346,8 +346,14 @@ fwohci_pci_detach(device_t self)
s = splfw();
- fwohci_stop(sc, self);
+ if (sc->bsr)
+ fwohci_stop(sc, self);
+
bus_generic_detach(self);
+ if (sc->fc.bdev) {
+ device_delete_child(self, sc->fc.bdev);
+ sc->fc.bdev = NULL;
+ }
/* disable interrupts that might have been switched on */
if (sc->bst && sc->bsh)
@@ -366,11 +372,6 @@ fwohci_pci_detach(device_t self)
sc->ih = NULL;
}
- if (sc->fc.bdev) {
- device_delete_child(self, sc->fc.bdev);
- sc->fc.bdev = NULL;
- }
-
if (sc->irq_res) {
bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
sc->irq_res = NULL;