summaryrefslogtreecommitdiffstats
path: root/sys/dev/an
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
committersam <sam@FreeBSD.org>2002-11-14 23:54:55 +0000
commit14c32b5f40c5ee3bd5649c3737f359f7e65e6944 (patch)
tree84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/an
parent10eb947d277840d02ef35d6c6303b64329d53806 (diff)
downloadFreeBSD-src-14c32b5f40c5ee3bd5649c3737f359f7e65e6944.zip
FreeBSD-src-14c32b5f40c5ee3bd5649c3737f359f7e65e6944.tar.gz
network interface driver changes:
o don't strip the Ethernet header from inbound packets; pass packets up the stack intact (required significant changes to some drivers) o reference common definitions in net/ethernet.h (e.g. ETHER_ALIGN) o track ether_ifattach/ether_ifdetach API changes o track bpf changes (use BPF_TAP and BPF_MTAP) o track vlan changes (ifnet capabilities, revised processing scheme, etc.) o use if_input to pass packets "up" o call ether_ioctl for default handling of ioctls Reviewed by: many Approved by: re
Diffstat (limited to 'sys/dev/an')
-rw-r--r--sys/dev/an/if_an.c23
-rw-r--r--sys/dev/an/if_an_isa.c2
-rw-r--r--sys/dev/an/if_an_pccard.c2
-rw-r--r--sys/dev/an/if_an_pci.c2
4 files changed, 12 insertions, 17 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index caecdbf..cada570 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -190,6 +190,10 @@ static char an_conf[256];
/* sysctl vars */
SYSCTL_NODE(_machdep, OID_AUTO, an, CTLFLAG_RD, 0, "dump RID");
+/* XXX violate ethernet/netgraph callback hooks */
+extern void (*ng_ether_attach_p)(struct ifnet *ifp);
+extern void (*ng_ether_detach_p)(struct ifnet *ifp);
+
static int
sysctl_an_dump(SYSCTL_HANDLER_ARGS)
{
@@ -499,7 +503,7 @@ an_attach(sc, unit, flags)
/*
* Call MI attach routine.
*/
- ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifattach(ifp, sc->arpcom.ac_enaddr);
callout_handle_init(&sc->an_stat_ch);
AN_UNLOCK(sc);
@@ -592,9 +596,7 @@ an_rxeof(sc)
rx_frame.an_rx_payload_len);
}
/* dump raw 802.11 packet to bpf and skip ip stack */
- if (ifp->if_bpf != NULL) {
- bpf_tap(ifp, bpf_buf, len);
- }
+ BPF_TAP(ifp, bpf_buf, len);
} else {
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL) {
@@ -654,11 +656,10 @@ an_rxeof(sc)
ifp->if_ipackets++;
/* Receive packet. */
- m_adj(m, sizeof(struct ether_header));
#ifdef ANCACHE
an_cache_store(sc, eh, m, rx_frame.an_rx_signal_strength);
#endif
- ether_input(ifp, eh, m);
+ (*ifp->if_input)(ifp, m);
}
}
@@ -1293,11 +1294,6 @@ an_ioctl(ifp, command, data)
}
switch (command) {
- case SIOCSIFADDR:
- case SIOCGIFADDR:
- case SIOCSIFMTU:
- error = ether_ioctl(ifp, command, data);
- break;
case SIOCSIFFLAGS:
if (ifp->if_flags & IFF_UP) {
if (ifp->if_flags & IFF_RUNNING &&
@@ -1809,7 +1805,7 @@ an_ioctl(ifp, command, data)
an_setdef(sc, &sc->areq);
break;
default:
- error = EINVAL;
+ error = ether_ioctl(ifp, command, data);
break;
}
out:
@@ -2021,8 +2017,7 @@ an_start(ifp)
* If there's a BPF listner, bounce a copy of
* this frame to him.
*/
- if (ifp->if_bpf)
- bpf_mtap(ifp, m0);
+ BPF_MTAP(ifp, m0);
m_freem(m0);
m0 = NULL;
diff --git a/sys/dev/an/if_an_isa.c b/sys/dev/an/if_an_isa.c
index db879a5..45fc3b5 100644
--- a/sys/dev/an/if_an_isa.c
+++ b/sys/dev/an/if_an_isa.c
@@ -140,7 +140,7 @@ an_detach_isa(device_t dev)
an_stop(sc);
ifmedia_removeall(&sc->an_ifmedia);
- ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifdetach(ifp);
bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
an_release_resources(dev);
diff --git a/sys/dev/an/if_an_pccard.c b/sys/dev/an/if_an_pccard.c
index 3cd9223..ddc827a 100644
--- a/sys/dev/an/if_an_pccard.c
+++ b/sys/dev/an/if_an_pccard.c
@@ -144,7 +144,7 @@ an_pccard_detach(device_t dev)
an_stop(sc);
ifmedia_removeall(&sc->an_ifmedia);
ifp->if_flags &= ~IFF_RUNNING;
- ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifdetach(ifp);
sc->an_gone = 1;
bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
an_release_resources(dev);
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c
index f1e320a..b1aa0f3 100644
--- a/sys/dev/an/if_an_pci.c
+++ b/sys/dev/an/if_an_pci.c
@@ -202,7 +202,7 @@ an_detach_pci(device_t dev)
an_stop(sc);
ifmedia_removeall(&sc->an_ifmedia);
- ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
+ ether_ifdetach(ifp);
bus_teardown_intr(dev, sc->irq_res, sc->irq_handle);
an_release_resources(dev);
OpenPOWER on IntegriCloud