summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/fwohci_pci.c
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2007-06-06 14:31:36 +0000
committersimokawa <simokawa@FreeBSD.org>2007-06-06 14:31:36 +0000
commit6052bc5731ca66f7ae519ab26941c42ceef6daaf (patch)
treebda94d3de727b214eea64936b54deb3b46a61f52 /sys/dev/firewire/fwohci_pci.c
parent27c6e3f25e2c0ab488171e7704cea4e8b215f483 (diff)
downloadFreeBSD-src-6052bc5731ca66f7ae519ab26941c42ceef6daaf.zip
FreeBSD-src-6052bc5731ca66f7ae519ab26941c42ceef6daaf.tar.gz
MFp4: MPSAFE firewire stack.
- lock its own locks and drop Giant. - create its own taskqueue thread. - split interrupt routine - use interrupt filter as a fast interrupt. - run watchdog timer in taskqueue so that it should be serialized with the bottom half. - add extra sanity check for transaction labels. disable ad-hoc workaround for unknown tlabels. - add sleep/wakeup synchronization primitives - don't reset OHCI in fwohci_stop()
Diffstat (limited to 'sys/dev/firewire/fwohci_pci.c')
-rw-r--r--sys/dev/firewire/fwohci_pci.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c
index ddc4f48..b21bb28 100644
--- a/sys/dev/firewire/fwohci_pci.c
+++ b/sys/dev/firewire/fwohci_pci.c
@@ -302,6 +302,7 @@ fwohci_pci_attach(device_t self)
firewire_debug = bootverbose;
#endif
+ mtx_init(FW_GMTX(&sc->fc), "firewire", NULL, MTX_DEF);
fwohci_pci_init(self);
rid = PCI_CBMEM;
@@ -335,12 +336,12 @@ fwohci_pci_attach(device_t self)
err = bus_setup_intr(self, sc->irq_res,
-#if FWOHCI_TASKQUEUE
INTR_TYPE_NET | INTR_MPSAFE,
+#if FWOHCI_INTFILT
+ fwohci_filt, NULL, sc, &sc->ih);
#else
- INTR_TYPE_NET,
-#endif
NULL, (driver_intr_t *) fwohci_intr, sc, &sc->ih);
+#endif
#if defined(__DragonFly__) || __FreeBSD_version < 500000
/* XXX splcam() should mask this irq for sbp.c*/
err = bus_setup_intr(self, sc->irq_res, INTR_TYPE_CAM,
@@ -376,7 +377,7 @@ fwohci_pci_attach(device_t self)
/*flags*/BUS_DMA_ALLOCNOW,
#if defined(__FreeBSD__) && __FreeBSD_version >= 501102
/*lockfunc*/busdma_lock_mutex,
- /*lockarg*/&Giant,
+ /*lockarg*/FW_GMTX(&sc->fc),
#endif
&sc->fc.dmat);
if (err != 0) {
@@ -448,6 +449,7 @@ fwohci_pci_detach(device_t self)
}
fwohci_detach(sc, self);
+ mtx_destroy(FW_GMTX(&sc->fc));
splx(s);
return 0;
@@ -492,7 +494,7 @@ fwohci_pci_add_child(device_t dev, int order, const char *name, int unit)
{
struct fwohci_softc *sc;
device_t child;
- int s, err = 0;
+ int err = 0;
sc = (struct fwohci_softc *)device_get_softc(dev);
child = device_add_child(dev, name, unit);
@@ -516,6 +518,7 @@ fwohci_pci_add_child(device_t dev, int order, const char *name, int unit)
* interrupt is disabled during the boot process.
*/
if (cold) {
+ int s;
DELAY(250); /* 2 cycles */
s = splfw();
fwohci_poll((void *)sc, 0, -1);
OpenPOWER on IntegriCloud