diff options
author | wollman <wollman@FreeBSD.org> | 1996-02-06 18:51:28 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1996-02-06 18:51:28 +0000 |
commit | 25ee6cca2a6483ef8d489b2eb60f0fbe475a32f2 (patch) | |
tree | e789decafa3124e34fc14cb210cda149ccb87570 /sys/dev/ep | |
parent | 2dfb2421458a36326af35171e59f21fbf98ab24f (diff) | |
download | FreeBSD-src-25ee6cca2a6483ef8d489b2eb60f0fbe475a32f2.zip FreeBSD-src-25ee6cca2a6483ef8d489b2eb60f0fbe475a32f2.tar.gz |
Clean up Ethernet drivers:
- fill in and use ifp->if_softc
- use if_bpf rather than private cookie variables
- change bpf interface to take advantage of this
- call ether_ifattach() directly from Ethernet drivers
- delete kludge in if_attach() that did this indirectly
Diffstat (limited to 'sys/dev/ep')
-rw-r--r-- | sys/dev/ep/if_ep.c | 18 | ||||
-rw-r--r-- | sys/dev/ep/if_epreg.h | 3 |
2 files changed, 11 insertions, 10 deletions
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c index c072171..66e305c 100644 --- a/sys/dev/ep/if_ep.c +++ b/sys/dev/ep/if_ep.c @@ -38,7 +38,7 @@ */ /* - * $Id: if_ep.c,v 1.38 1996/01/26 09:27:22 phk Exp $ + * $Id: if_ep.c,v 1.39 1996/01/29 03:16:12 gibbs Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -449,6 +449,7 @@ epattach(is) GO_WINDOW(0); outw(BASE + EP_W0_RESOURCE_CFG, SET_IRQ(irq)); + ifp->if_softc = sc; ifp->if_unit = is->id_unit; ifp->if_name = "ep"; ifp->if_mtu = ETHERMTU; @@ -459,6 +460,7 @@ epattach(is) ifp->if_watchdog = epwatchdog; if_attach(ifp); + ether_ifattach(ifp); /* device attach does transition from UNCONFIGURED to IDLE state */ kdc_ep[is->id_unit].kdc_state=DC_IDLE; @@ -506,7 +508,7 @@ epattach(is) sc->top = sc->mcur = 0; #if NBPFILTER > 0 - bpfattach(&sc->bpf, ifp, DLT_EN10MB, sizeof(struct ether_header)); + bpfattach(ifp, DLT_EN10MB, sizeof(struct ether_header)); #endif return 1; } @@ -680,7 +682,7 @@ static void epstart(ifp) struct ifnet *ifp; { - register struct ep_softc *sc = &ep_softc[ifp->if_unit]; + register struct ep_softc *sc = ifp->if_softc; register u_int len; register struct mbuf *m; struct mbuf *top; @@ -759,8 +761,8 @@ startagain: outb(BASE + EP_W1_TX_PIO_WR_1, 0); /* Padding */ #if NBPFILTER > 0 - if (sc->bpf) { - bpf_mtap(sc->bpf, top); + if (sc->arpcom.ac_if.if_bpf) { + bpf_mtap(&sc->arpcom.ac_if, top); } #endif @@ -1083,8 +1085,8 @@ all_pkt: top->m_pkthdr.len = sc->cur_len; #if NBPFILTER > 0 - if (sc->bpf) { - bpf_mtap(sc->bpf, top); + if (sc->arpcom.ac_if.if_bpf) { + bpf_mtap(&sc->arpcom.ac_if, top); /* * Note that the interface cannot be in promiscuous mode if there are @@ -1153,7 +1155,7 @@ epioctl(ifp, cmd, data) caddr_t data; { register struct ifaddr *ifa = (struct ifaddr *) data; - struct ep_softc *sc = &ep_softc[ifp->if_unit]; + struct ep_softc *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *) data; int s, error = 0; diff --git a/sys/dev/ep/if_epreg.h b/sys/dev/ep/if_epreg.h index a9b3593..2dc6b59 100644 --- a/sys/dev/ep/if_epreg.h +++ b/sys/dev/ep/if_epreg.h @@ -31,7 +31,7 @@ */ /* - * $Id: if_epreg.h,v 1.9 1996/01/29 03:16:14 gibbs Exp $ + * $Id: if_epreg.h,v 1.10 1996/01/30 22:55:43 mpp Exp $ * * Promiscuous mode added and interrupt logic slightly changed * to reduce the number of adapter failures. Transceiver select @@ -61,7 +61,6 @@ struct ep_softc { short rx_latency; short rx_avg_pkt; short cur_len; - caddr_t bpf; /* BPF "magic cookie" */ u_short ep_connectors; /* Connectors on this card. */ int stat; /* some flags */ #define F_RX_FIRST 0x1 |