Add isa support:
o write isa driver routines. o factor detach routine in sn_detach.
This commit is contained in:
parent
84c6b37d74
commit
6763347475
@ -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
|
||||
*/
|
||||
|
@ -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 }
|
||||
};
|
||||
|
@ -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),
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user