Changed struct ifnet to have a pointer to the softc of the underlying
device and a printable "external name" (name + unit number), thus eliminating if_name and if_unit. Updated interface to (*if_watchdog)() and (*if_start)() to take a struct ifnet *, rather than a unit number.
This commit is contained in:
parent
ae87feee24
commit
ac9df157aa
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: if_ie.c,v 1.23 1996/04/10 20:46:16 pk Exp $ */
|
||||
/* $NetBSD: if_ie.c,v 1.24 1996/05/07 01:28:28 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995 Charles Hannum.
|
||||
@ -301,7 +301,7 @@ static void ie_vmereset __P((struct ie_softc *));
|
||||
static void ie_vmeattend __P((struct ie_softc *));
|
||||
static void ie_vmerun __P((struct ie_softc *));
|
||||
|
||||
void iewatchdog __P((int));
|
||||
void iewatchdog __P((struct ifnet *));
|
||||
int ieintr __P((void *));
|
||||
int ieinit __P((struct ie_softc *));
|
||||
int ieioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
@ -651,8 +651,8 @@ ieattach(parent, self, aux)
|
||||
/* XXX should reclaim resources? */
|
||||
return;
|
||||
}
|
||||
ifp->if_unit = sc->sc_dev.dv_unit;
|
||||
ifp->if_name = ie_cd.cd_name;
|
||||
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
|
||||
ifp->if_softc = sc;
|
||||
ifp->if_start = iestart;
|
||||
ifp->if_ioctl = ieioctl;
|
||||
ifp->if_watchdog = iewatchdog;
|
||||
@ -701,10 +701,10 @@ ieattach(parent, self, aux)
|
||||
* an interrupt after a transmit has been started on it.
|
||||
*/
|
||||
void
|
||||
iewatchdog(unit)
|
||||
int unit;
|
||||
iewatchdog(ifp)
|
||||
struct ifnet *ifp;
|
||||
{
|
||||
struct ie_softc *sc = ie_cd.cd_devs[unit];
|
||||
struct ie_softc *sc = ifp->if_softc;
|
||||
|
||||
log(LOG_ERR, "%s: device timeout\n", sc->sc_dev.dv_xname);
|
||||
++sc->sc_arpcom.ac_if.if_oerrors;
|
||||
@ -1411,7 +1411,7 @@ void
|
||||
iestart(ifp)
|
||||
struct ifnet *ifp;
|
||||
{
|
||||
struct ie_softc *sc = ie_cd.cd_devs[ifp->if_unit];
|
||||
struct ie_softc *sc = ifp->if_softc;
|
||||
struct mbuf *m0, *m;
|
||||
u_char *buffer;
|
||||
u_short len;
|
||||
@ -1944,7 +1944,7 @@ ieioctl(ifp, cmd, data)
|
||||
u_long cmd;
|
||||
caddr_t data;
|
||||
{
|
||||
struct ie_softc *sc = ie_cd.cd_devs[ifp->if_unit];
|
||||
struct ie_softc *sc = ifp->if_softc;
|
||||
struct ifaddr *ifa = (struct ifaddr *)data;
|
||||
struct ifreq *ifr = (struct ifreq *)data;
|
||||
int s, error = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user