From 14c32b5f40c5ee3bd5649c3737f359f7e65e6944 Mon Sep 17 00:00:00 2001 From: sam Date: Thu, 14 Nov 2002 23:54:55 +0000 Subject: 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 --- sys/dev/cnw/if_cnw.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'sys/dev/cnw') diff --git a/sys/dev/cnw/if_cnw.c b/sys/dev/cnw/if_cnw.c index 80ebef5..84bdced 100644 --- a/sys/dev/cnw/if_cnw.c +++ b/sys/dev/cnw/if_cnw.c @@ -850,8 +850,7 @@ cnw_start(ifp) bpf_mtap(ifp->if_bpf, m0); #endif #else /* FreeBSD */ - if (ifp->if_bpf) - bpf_mtap(ifp, m0); + BPF_MTAP(ifp, m0); #endif cnw_transmit(sc, m0); @@ -1024,7 +1023,6 @@ cnw_recv(sc) struct ifnet *ifp = &sc->sc_ethercom.ec_if; #else struct ifnet *ifp = &sc->arpcom.ac_if; - struct ether_header *eh; #endif struct mbuf *m; @@ -1053,19 +1051,10 @@ cnw_recv(sc) if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); #endif -#else /* FreeBSD */ - if (ifp->if_bpf) - bpf_mtap(ifp, m); #endif /* Pass the packet up. */ -#if !defined(__FreeBSD__) (*ifp->if_input)(ifp, m); -#else - eh = mtod(m, struct ether_header *); - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, eh, m) ; -#endif } } @@ -1660,7 +1649,7 @@ static int cnw_pccard_attach(device_t dev) /* * Call MI attach routine. */ - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, sc->arpcom.ac_enaddr); /* callout_handle_init(&sc->cnw_stat_ch); */ return(0); -- cgit v1.1