summaryrefslogtreecommitdiffstats
path: root/sys/dev/snc/if_snc_cbus.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-08-04 19:19:18 +0000
committerjhb <jhb@FreeBSD.org>2008-08-04 19:19:18 +0000
commit82bee699d17057265199df7a5bc137655bdfae9e (patch)
tree3d1e8eab296c92d2e69ccb8f79d304033f98dd3a /sys/dev/snc/if_snc_cbus.c
parent448cbffe9ead78f0eef9320b85edc254321106d5 (diff)
downloadFreeBSD-src-82bee699d17057265199df7a5bc137655bdfae9e.zip
FreeBSD-src-82bee699d17057265199df7a5bc137655bdfae9e.tar.gz
Add locking to snc(4) so it is MPSAFE:
- Add a mutex to the softc to protect the softc and device hardware. - Use a private timer routine to drive the transmit watchdog timer instead of using if_watchdog/if_timer. - If if_alloc() fails during attach, fail the attach with an error rather than panic'ing. - Clear RUNNING and OACTIVE only in sncstop(). - Don't mess with IFF_UP. - Don't leak 'struct ifnet' on detach. - Setup interrupt handler after ether_ifattach(). - Call ether_ifdetach() rather than if_detach() in the pccard detach routine. Tested by: no one despite repeated requests
Diffstat (limited to 'sys/dev/snc/if_snc_cbus.c')
-rw-r--r--sys/dev/snc/if_snc_cbus.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/sys/dev/snc/if_snc_cbus.c b/sys/dev/snc/if_snc_cbus.c
index f280de3..e859b7a 100644
--- a/sys/dev/snc/if_snc_cbus.c
+++ b/sys/dev/snc/if_snc_cbus.c
@@ -150,7 +150,7 @@ snc_isa_probe(dev)
bus_set_resource(dev, SYS_RES_IOPORT, rid,
port, SNEC_NREGS);
res = bus_alloc_resource(dev, SYS_RES_IOPORT, &rid,
- 0, ~0, SNEC_NREGS,
+ 0ul, ~0ul, SNEC_NREGS,
0 /* !RF_ACTIVE */);
if (res) break;
}
@@ -181,7 +181,6 @@ snc_isa_attach(dev)
device_t dev;
{
struct snc_softc *sc = device_get_softc(dev);
- int error;
bzero(sc, sizeof(struct snc_softc));
@@ -189,14 +188,6 @@ snc_isa_attach(dev)
snc_alloc_memory(dev, 0);
snc_alloc_irq(dev, 0, 0);
- error = bus_setup_intr(dev, sc->irq, INTR_TYPE_NET,
- NULL, sncintr, sc, &sc->irq_handle);
- if (error) {
- printf("snc_isa_attach: bus_setup_intr() failed\n");
- snc_release_resources(dev);
- return (error);
- }
-
/* This interface is always enabled. */
sc->sc_enabled = 1;
OpenPOWER on IntegriCloud