summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/if_ep.c
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1996-02-06 18:51:28 +0000
committerwollman <wollman@FreeBSD.org>1996-02-06 18:51:28 +0000
commit25ee6cca2a6483ef8d489b2eb60f0fbe475a32f2 (patch)
treee789decafa3124e34fc14cb210cda149ccb87570 /sys/i386/isa/if_ep.c
parent2dfb2421458a36326af35171e59f21fbf98ab24f (diff)
downloadFreeBSD-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/i386/isa/if_ep.c')
-rw-r--r--sys/i386/isa/if_ep.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/i386/isa/if_ep.c b/sys/i386/isa/if_ep.c
index c072171..66e305c 100644
--- a/sys/i386/isa/if_ep.c
+++ b/sys/i386/isa/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;
OpenPOWER on IntegriCloud