diff options
author | dg <dg@FreeBSD.org> | 1995-12-05 02:01:59 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-12-05 02:01:59 +0000 |
commit | 8156a5707a8830d1ce5658e103e6780f22cfc8dd (patch) | |
tree | 85cbbd7c1e0b938f939f958fcf5fd93d4c5c5406 /sys/i386/isa/if_ze.c | |
parent | fd5819ba7c85b8236d4b1f4cc3340e673229a93a (diff) | |
download | FreeBSD-src-8156a5707a8830d1ce5658e103e6780f22cfc8dd.zip FreeBSD-src-8156a5707a8830d1ce5658e103e6780f22cfc8dd.tar.gz |
all:
Removed ifnet.if_init and ifnet.if_reset as they are generally unused.
Change the parameter passed to if_watchdog to be a ifnet * rather than
a unit number. All of this is an attempt to move toward not needing an
array of softc pointers (which is usually static in size) to point to
the driver softc.
if_ed.c:
Changed some of the argument passing to some functions to make a little
more sense.
if_ep.c, if_vx.c:
Killed completely bogus use of if_timer. It was being set in such a way
that the interface was being reset once per second (blech!).
Diffstat (limited to 'sys/i386/isa/if_ze.c')
-rw-r--r-- | sys/i386/isa/if_ze.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/sys/i386/isa/if_ze.c b/sys/i386/isa/if_ze.c index 15fefc1..6d964a1 100644 --- a/sys/i386/isa/if_ze.c +++ b/sys/i386/isa/if_ze.c @@ -47,7 +47,7 @@ */ /* - * $Id: if_ze.c,v 1.23 1995/10/28 15:39:12 phk Exp $ + * $Id: if_ze.c,v 1.24 1995/11/18 08:39:28 bde Exp $ */ #include "ze.h" @@ -113,11 +113,11 @@ */ struct ze_softc { + struct arpcom arpcom; /* ethernet common */ + caddr_t maddr; u_long iobase, irq; - struct arpcom arpcom; /* ethernet common */ - char *type_str; /* pointer to type string */ char *mau; /* type of media access unit */ u_short nic_addr; /* NIC (DS8390) I/O bus address */ @@ -158,7 +158,7 @@ static int ze_resume __P((void *visa_dev)); extern int ze_attach __P((struct isa_device *isa_dev)); extern void ze_reset __P((int unit)); extern void ze_stop __P((int unit)); -extern void ze_watchdog __P((int unit)); +extern void ze_watchdog __P((struct ifnet *ifp)); extern void ze_init __P((int unit)); static inline void ze_xmit __P((struct ifnet *ifp)); extern void ze_start __P((struct ifnet *ifp)); @@ -622,11 +622,9 @@ ze_attach(isa_dev) ifp->if_unit = isa_dev->id_unit; ifp->if_name = "ze" ; ifp->if_mtu = ETHERMTU; - ifp->if_init = ze_init; ifp->if_output = ether_output; ifp->if_start = ze_start; ifp->if_ioctl = ze_ioctl; - ifp->if_reset = ze_reset; ifp->if_watchdog = ze_watchdog; ifp->if_flags = (IFF_BROADCAST | IFF_SIMPLEX); @@ -741,15 +739,15 @@ ze_stop(unit) * generate an interrupt after a transmit has been started on it. */ void -ze_watchdog(unit) - int unit; +ze_watchdog(ifp) + struct ifnet *ifp; { #if 1 - struct ze_softc *sc = &ze_softc[unit]; + struct ze_softc *sc = (struct ze_softc *)ifp; u_char isr, imr; u_short imask; - if(!(sc->arpcom.ac_if.if_flags & IFF_UP)) + if(!(ifp->if_flags & IFF_UP)) return; /* select page zero */ outb (sc->nic_addr + ED_P0_CR, @@ -768,12 +766,12 @@ ze_watchdog(unit) imask = inb(IO_ICU2) << 8 | inb(IO_ICU1); log (LOG_ERR, "ze%d: device timeout, isr=%02x, imr=%02x, imask=%04x\n", - unit, isr, imr, imask); + ifp->if_unit, isr, imr, imask); #else - log(LOG_ERR, "ze%d: device timeout\n", unit); + log(LOG_ERR, "ze%d: device timeout\n", ifp->if_unit); #endif - ze_reset(unit); + ze_reset(ifp->if_unit); } /* |