summaryrefslogtreecommitdiff
path: root/sys/dev/ed
diff options
context:
space:
mode:
authorSam Leffler <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
committerSam Leffler <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
commit673d91916d8748ecccff3635f1b15cc602a3898e (patch)
tree84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/ed
parent9ef8b52020603fd01bf683a44d1c1ec25cd4ce09 (diff)
Notes
Diffstat (limited to 'sys/dev/ed')
-rw-r--r--sys/dev/ed/if_ed.c30
-rw-r--r--sys/dev/ed/if_ed_pccard.c2
2 files changed, 10 insertions, 22 deletions
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index 118ff28c40ec..5ad04e30ec67 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -1642,7 +1642,7 @@ ed_attach(sc, unit, flags)
/*
* Attach the interface
*/
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(ifp, sc->arpcom.ac_enaddr);
}
/* device attach does transition from UNCONFIGURED to IDLE state */
@@ -2127,9 +2127,7 @@ outloop:
/*
* Tap off here if there is a bpf listener.
*/
- if (ifp->if_bpf) {
- bpf_mtap(ifp, m0);
- }
+ BPF_MTAP(ifp, m0);
m_freem(m0);
@@ -2565,13 +2563,6 @@ ed_ioctl(ifp, command, data)
s = splimp();
switch (command) {
-
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
-
case SIOCSIFFLAGS:
/*
@@ -2631,7 +2622,7 @@ ed_ioctl(ifp, command, data)
#endif
default:
- error = EINVAL;
+ error = ether_ioctl(ifp, command, data);
}
(void) splx(s);
return (error);
@@ -2683,6 +2674,7 @@ ed_get_packet(sc, buf, len)
char *buf;
u_short len;
{
+ struct ifnet *ifp = &sc->arpcom.ac_if;
struct ether_header *eh;
struct mbuf *m;
@@ -2690,7 +2682,7 @@ ed_get_packet(sc, buf, len)
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return;
- m->m_pkthdr.rcvif = &sc->arpcom.ac_if;
+ m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len;
/*
@@ -2721,11 +2713,11 @@ ed_get_packet(sc, buf, len)
* Don't read in the entire packet if we know we're going to drop it
* and no bpf is active.
*/
- if (!sc->arpcom.ac_if.if_bpf && BDG_ACTIVE( (&sc->arpcom.ac_if) ) ) {
+ if (!ifp->if_bpf && BDG_ACTIVE( (ifp) ) ) {
struct ifnet *bif;
ed_ring_copy(sc, buf, (char *)eh, ETHER_HDR_LEN);
- bif = bridge_in_ptr(&sc->arpcom.ac_if, eh) ;
+ bif = bridge_in_ptr(ifp, eh) ;
if (bif == BDG_DROP) {
m_freem(m);
return;
@@ -2739,13 +2731,9 @@ ed_get_packet(sc, buf, len)
*/
ed_ring_copy(sc, buf, (char *)eh, len);
- /*
- * Remove link layer address.
- */
- m->m_pkthdr.len = m->m_len = len - sizeof(struct ether_header);
- m->m_data += sizeof(struct ether_header);
+ m->m_pkthdr.len = m->m_len = len;
- ether_input(&sc->arpcom.ac_if, eh, m);
+ (*ifp->if_input)(ifp, m);
}
/*
diff --git a/sys/dev/ed/if_ed_pccard.c b/sys/dev/ed/if_ed_pccard.c
index 4f915eefc937..06737afac193 100644
--- a/sys/dev/ed/if_ed_pccard.c
+++ b/sys/dev/ed/if_ed_pccard.c
@@ -106,7 +106,7 @@ ed_pccard_detach(device_t dev)
}
ed_stop(sc);
ifp->if_flags &= ~IFF_RUNNING;
- ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifdetach(ifp);
sc->gone = 1;
bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
ed_release_resources(dev);