diff options
author | Sam Leffler <sam@FreeBSD.org> | 2002-11-14 23:54:55 +0000 |
---|---|---|
committer | Sam Leffler <sam@FreeBSD.org> | 2002-11-14 23:54:55 +0000 |
commit | 673d91916d8748ecccff3635f1b15cc602a3898e (patch) | |
tree | 84eb7252cc6a518796c6bf88903ed6e2d12e7b91 /sys/dev/sbni | |
parent | 9ef8b52020603fd01bf683a44d1c1ec25cd4ce09 (diff) | |
download | src-673d91916d8748ecccff3635f1b15cc602a3898e.tar.gz src-673d91916d8748ecccff3635f1b15cc602a3898e.zip |
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
Notes
Notes:
svn path=/head/; revision=106937
Diffstat (limited to 'sys/dev/sbni')
-rw-r--r-- | sys/dev/sbni/if_sbni.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/sys/dev/sbni/if_sbni.c b/sys/dev/sbni/if_sbni.c index 3554cc687bc5..e5d54172a8eb 100644 --- a/sys/dev/sbni/if_sbni.c +++ b/sys/dev/sbni/if_sbni.c @@ -242,7 +242,7 @@ sbni_attach(struct sbni_softc *sc, int unit, struct sbni_flags flags) (csr0 & 0x01 ? 500000 : 2000000) / (1 << flags.rate); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + ether_ifattach(ifp, sc->arpcom.ac_enaddr); } /* device attach does transition from UNCONFIGURED to IDLE state */ @@ -693,8 +693,7 @@ prepare_to_send(struct sbni_softc *sc) sbni_outb(sc, CSR0, sbni_inb(sc, CSR0) | TR_REQ); sc->arpcom.ac_if.if_flags |= IFF_OACTIVE; - if (sc->arpcom.ac_if.if_bpf) - bpf_mtap(&sc->arpcom.ac_if, sc->tx_buf_p); + BPF_MTAP(&sc->arpcom.ac_if, sc->tx_buf_p); } @@ -851,17 +850,14 @@ get_rx_buf(struct sbni_softc *sc) static void indicate_pkt(struct sbni_softc *sc) { + struct ifnet *ifp = &sc->arpcom.ac_if; struct mbuf *m; - struct ether_header *eh; m = sc->rx_buf_p; - m->m_pkthdr.rcvif = &sc->arpcom.ac_if; + m->m_pkthdr.rcvif = ifp; m->m_pkthdr.len = m->m_len = sc->inppos; - eh = mtod(m, struct ether_header *); - /* Remove link layer address and indicate packet */ - m_adj(m, sizeof(struct ether_header)); - ether_input(&sc->arpcom.ac_if, eh, m); + (*ifp->if_input)(ifp, m); sc->rx_buf_p = NULL; } @@ -1063,11 +1059,6 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data) s = splimp(); switch (command) { - case SIOCSIFADDR: - case SIOCGIFADDR: - ether_ioctl(ifp, command, data); - break; - case SIOCSIFFLAGS: /* * If the interface is marked up and stopped, then start it. @@ -1149,7 +1140,8 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t data) break; default: - error = EINVAL; + error = ether_ioctl(ifp, command, data); + break; } splx(s); |