diff options
author | imp <imp@FreeBSD.org> | 2000-12-13 01:47:19 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2000-12-13 01:47:19 +0000 |
commit | e1fe72742c53537e4980deffe6803189c00560fa (patch) | |
tree | ccf3d6ebc59b043b73c59182f1c8b25512734875 | |
parent | ac4f44c24e80fa2aed5a82cfeeafffe9ff6d77a0 (diff) | |
download | FreeBSD-src-e1fe72742c53537e4980deffe6803189c00560fa.zip FreeBSD-src-e1fe72742c53537e4980deffe6803189c00560fa.tar.gz |
Add isa support:
o write isa driver routines.
o factor detach routine in sn_detach.
-rw-r--r-- | sys/dev/sn/if_sn.c | 11 | ||||
-rw-r--r-- | sys/dev/sn/if_sn_isa.c | 13 | ||||
-rw-r--r-- | sys/dev/sn/if_sn_pccard.c | 13 | ||||
-rw-r--r-- | sys/dev/sn/if_snvar.h | 1 |
4 files changed, 18 insertions, 20 deletions
diff --git a/sys/dev/sn/if_sn.c b/sys/dev/sn/if_sn.c index ad3a3b8..64c1bef 100644 --- a/sys/dev/sn/if_sn.c +++ b/sys/dev/sn/if_sn.c @@ -244,6 +244,17 @@ sn_attach(device_t dev) } +int +sn_detach(device_t dev) +{ + struct sn_softc *sc = device_get_softc(dev); + + sc->arpcom.ac_if.if_flags &= ~IFF_RUNNING; + ether_ifdetach(&sc->arpcom.ac_if, ETHER_BPF_SUPPORTED); + sn_deactivate(dev); + return 0; +} + /* * Reset and initialize the chip */ diff --git a/sys/dev/sn/if_sn_isa.c b/sys/dev/sn/if_sn_isa.c index c48d4bc..d31c2df 100644 --- a/sys/dev/sn/if_sn_isa.c +++ b/sys/dev/sn/if_sn_isa.c @@ -40,10 +40,10 @@ #include <machine/bus.h> #include <machine/resource.h> +#include <net/ethernet.h> #include <net/if.h> #include <net/if_arp.h> - #include <isa/isavar.h> #include <dev/sn/if_snvar.h> @@ -64,20 +64,17 @@ sn_isa_probe (device_t dev) static int sn_isa_attach (device_t dev) { -#if 0 /* currently not tested */ - struct sn_softc *sc = device_get_softc(dev); -#endif + struct sn_softc *sc = device_get_softc(dev); -#if 0 /* currently not tested */ - sc->pccard_enaddr = 0; -#endif - return (0); + sc->pccard_enaddr = 0; + return (sn_attach(dev)); } static device_method_t sn_isa_methods[] = { /* Device interface */ DEVMETHOD(device_probe, sn_isa_probe), DEVMETHOD(device_attach, sn_isa_attach), + DEVMETHOD(device_detach, sn_detach), { 0, 0 } }; diff --git a/sys/dev/sn/if_sn_pccard.c b/sys/dev/sn/if_sn_pccard.c index 34a4e19..bb005ae 100644 --- a/sys/dev/sn/if_sn_pccard.c +++ b/sys/dev/sn/if_sn_pccard.c @@ -107,22 +107,11 @@ sn_pccard_attach(device_t dev) return (sn_attach(dev)); } -static int -sn_pccard_detach(device_t dev) -{ - struct sn_softc *sc = device_get_softc(dev); - - sc->arpcom.ac_if.if_flags &= ~IFF_RUNNING; - ether_ifdetach(&sc->arpcom.ac_if, ETHER_BPF_SUPPORTED); - sn_deactivate(dev); - return 0; -} - static device_method_t sn_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pccard_compat_probe), DEVMETHOD(device_attach, pccard_compat_attach), - DEVMETHOD(device_detach, sn_pccard_detach), + DEVMETHOD(device_detach, sn_detach), /* Card interface */ DEVMETHOD(card_compat_match, sn_pccard_match), diff --git a/sys/dev/sn/if_snvar.h b/sys/dev/sn/if_snvar.h index 4d7b1d8..0770500 100644 --- a/sys/dev/sn/if_snvar.h +++ b/sys/dev/sn/if_snvar.h @@ -52,6 +52,7 @@ struct sn_softc { int sn_probe(device_t, int); int sn_attach(device_t); +int sn_detach(device_t); void sn_intr(void *); int sn_activate(device_t); |