diff options
author | jhb <jhb@FreeBSD.org> | 2008-06-13 12:14:22 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2008-06-13 12:14:22 +0000 |
commit | b3ec9d20e2e35d17969bd802375c6c5816f967f5 (patch) | |
tree | 827ecd904c434918c85f857189d4350deb2665a8 /sys/dev/ex/if_ex_isa.c | |
parent | 90df49173a351bd63219cd9afdd388548864602a (diff) | |
download | FreeBSD-src-b3ec9d20e2e35d17969bd802375c6c5816f967f5.zip FreeBSD-src-b3ec9d20e2e35d17969bd802375c6c5816f967f5.tar.gz |
Make ex(4) MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware.
- Use a private watchdog timer.
- Setup interrupt handler after ether_ifattach().
- Use bus_foo() rather than bus_space_foo() and remove bus space tag and
handle from softc.
Tested by: imp
Diffstat (limited to 'sys/dev/ex/if_ex_isa.c')
-rw-r--r-- | sys/dev/ex/if_ex_isa.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/dev/ex/if_ex_isa.c b/sys/dev/ex/if_ex_isa.c index 84b71a2..31b00a3 100644 --- a/sys/dev/ex/if_ex_isa.c +++ b/sys/dev/ex/if_ex_isa.c @@ -126,7 +126,6 @@ ex_isa_identify(driver_t *driver, device_t parent) int tmp; const char * desc; struct ex_softc sc; - struct resource *res; int rid; if (bootverbose) @@ -134,16 +133,15 @@ ex_isa_identify(driver_t *driver, device_t parent) for (ioport = 0x200; ioport < 0x3a0; ioport += 0x10) { rid = 0; - res = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, + sc.ioport = bus_alloc_resource(parent, SYS_RES_IOPORT, &rid, ioport, ioport, 0x10, RF_ACTIVE); - if (res == NULL) + if (sc.ioport == NULL) continue; - sc.bst = rman_get_bustag(res); - sc.bsh = rman_get_bushandle(res); /* No board found at address */ if (!ex_look_for_card(&sc)) { - bus_release_resource(parent, SYS_RES_IOPORT, rid, res); + bus_release_resource(parent, SYS_RES_IOPORT, rid, + sc.ioport); continue; } @@ -157,7 +155,8 @@ ex_isa_identify(driver_t *driver, device_t parent) DELAY(500); if (bootverbose) printf("ex: card at 0x%03lx in PnP mode!\n", (unsigned long)ioport); - bus_release_resource(parent, SYS_RES_IOPORT, rid, res); + bus_release_resource(parent, SYS_RES_IOPORT, rid, + sc.ioport); continue; } @@ -179,7 +178,7 @@ ex_isa_identify(driver_t *driver, device_t parent) desc = "Intel Pro/10"; } - bus_release_resource(parent, SYS_RES_IOPORT, rid, res); + bus_release_resource(parent, SYS_RES_IOPORT, rid, sc.ioport); child = BUS_ADD_CHILD(parent, ISA_ORDER_SPECULATIVE, "ex", -1); device_set_desc_copy(child, desc); device_set_driver(child, driver); @@ -313,13 +312,6 @@ ex_isa_attach(device_t dev) goto bad; } - error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET, - NULL, ex_intr, (void *)sc, &sc->ih); - if (error) { - device_printf(dev, "bus_setup_intr() failed!\n"); - goto bad; - } - return(0); bad: ex_release_resources(dev); |