o track either_ifattach/ether_ifdetach API changes
o use if_input for input packet processing o don't strip the Ethernet header for input packets o use BPF_* macros bpf tapping o call ether_ioctl to handle default ioctl case o track vlan changes Reviewed by: many Approved by: re
This commit is contained in:
parent
eec3a0b17f
commit
9ef8b52020
@ -2262,12 +2262,13 @@ dc_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
|
||||
/*
|
||||
* Tell the upper layer(s) we support long frames.
|
||||
*/
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||
|
||||
callout_init(&sc->dc_stat_ch, IS_MPSAFE);
|
||||
|
||||
@ -2322,7 +2323,7 @@ dc_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
dc_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->dc_miibus);
|
||||
@ -2609,7 +2610,6 @@ static void
|
||||
dc_rxeof(sc)
|
||||
struct dc_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct dc_desc *cur_rx;
|
||||
@ -2708,11 +2708,7 @@ dc_rxeof(sc)
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
sc->dc_cdata.dc_rx_prod = i;
|
||||
@ -3260,8 +3256,7 @@ dc_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
|
||||
if (sc->dc_flags & DC_TX_ONE) {
|
||||
ifp->if_flags |= IFF_OACTIVE;
|
||||
@ -3542,11 +3537,6 @@ dc_ioctl(ifp, command, data)
|
||||
DC_LOCK(sc);
|
||||
|
||||
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 &&
|
||||
@ -3583,7 +3573,7 @@ dc_ioctl(ifp, command, data)
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3567,8 +3567,7 @@ tulip_rx_intr(
|
||||
#if !defined(TULIP_COPY_RXDATA)
|
||||
ms->m_pkthdr.len = total_len;
|
||||
ms->m_pkthdr.rcvif = ifp;
|
||||
m_adj(ms, sizeof(struct ether_header));
|
||||
ether_input(ifp, &eh, ms);
|
||||
(*ifp->if_input)(ifp, ms);
|
||||
#else
|
||||
#ifdef BIG_PACKET
|
||||
#error BIG_PACKET is incompatible with TULIP_COPY_RXDATA
|
||||
@ -3577,8 +3576,7 @@ tulip_rx_intr(
|
||||
m_copydata(ms, 0, total_len, mtod(m0, caddr_t));
|
||||
m0->m_len = m0->m_pkthdr.len = total_len;
|
||||
m0->m_pkthdr.rcvif = ifp;
|
||||
m_adj(m0, sizeof(struct ether_header));
|
||||
ether_input(ifp, &eh, m0);
|
||||
(*ifp->if_input)(ifp, m0);
|
||||
m0 = ms;
|
||||
#endif /* ! TULIP_COPY_RXDATA */
|
||||
}
|
||||
@ -4334,8 +4332,7 @@ tulip_txput(
|
||||
/*
|
||||
* bounce a copy to the bpf listener, if any.
|
||||
*/
|
||||
if (sc->tulip_if.if_bpf != NULL)
|
||||
bpf_mtap(&sc->tulip_if, m);
|
||||
BPF_MTAP(&sc->tulip_if, m);
|
||||
|
||||
/*
|
||||
* The descriptors have been filled in. Now get ready
|
||||
@ -4558,12 +4555,6 @@ tulip_ifioctl(
|
||||
s = splimp();
|
||||
#endif
|
||||
switch (cmd) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR: {
|
||||
error = ether_ioctl(ifp, cmd, data);
|
||||
break;
|
||||
}
|
||||
|
||||
case SIOCSIFFLAGS: {
|
||||
tulip_addr_filter(sc); /* reinit multicast filter */
|
||||
tulip_init(sc);
|
||||
@ -4621,7 +4612,7 @@ tulip_ifioctl(
|
||||
}
|
||||
#endif
|
||||
default: {
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, cmd, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4813,7 +4804,7 @@ tulip_attach(
|
||||
|
||||
tulip_reset(sc);
|
||||
|
||||
ether_ifattach(&(sc)->tulip_if, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
|
||||
ifp->if_snd.ifq_maxlen = ifqmaxlen;
|
||||
}
|
||||
|
||||
|
@ -541,11 +541,6 @@ sf_ioctl(ifp, command, data)
|
||||
SF_LOCK(sc);
|
||||
|
||||
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 &&
|
||||
@ -576,7 +571,7 @@ sf_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -834,7 +829,7 @@ sf_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc->arpcom.ac_enaddr);
|
||||
SF_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -855,7 +850,7 @@ sf_detach(dev)
|
||||
SF_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
sf_stop(sc);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
@ -977,7 +972,6 @@ static void
|
||||
sf_rxeof(sc)
|
||||
struct sf_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct sf_rx_bufdesc_type0 *desc;
|
||||
@ -1017,12 +1011,8 @@ sf_rxeof(sc)
|
||||
}
|
||||
m = m0;
|
||||
|
||||
eh = mtod(m, struct ether_header *);
|
||||
ifp->if_ipackets++;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
csr_write_4(sc, SF_CQ_CONSIDX,
|
||||
@ -1404,8 +1394,7 @@ sf_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
|
||||
SF_INC(i, SF_TX_DLIST_CNT);
|
||||
sc->sf_tx_cnt++;
|
||||
|
@ -899,10 +899,6 @@ sk_ioctl(ifp, command, data)
|
||||
SK_IF_LOCK(sc_if);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFMTU:
|
||||
if (ifr->ifr_mtu > SK_JUMBO_MTU)
|
||||
error = EINVAL;
|
||||
@ -945,7 +941,7 @@ sk_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1174,7 +1170,7 @@ sk_attach_xmac(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc_if->arpcom.ac_enaddr);
|
||||
callout_handle_init(&sc_if->sk_tick_ch);
|
||||
|
||||
/*
|
||||
@ -1186,7 +1182,7 @@ sk_attach_xmac(dev)
|
||||
printf("skc%d: no PHY found!\n", sc_if->sk_unit);
|
||||
contigfree(sc_if->sk_rdata,
|
||||
sizeof(struct sk_ring_data), M_DEVBUF);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
SK_UNLOCK(sc);
|
||||
return(ENXIO);
|
||||
}
|
||||
@ -1398,7 +1394,7 @@ sk_detach_xmac(dev)
|
||||
|
||||
ifp = &sc_if->arpcom.ac_if;
|
||||
sk_stop(sc_if);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
bus_generic_detach(dev);
|
||||
if (sc_if->sk_miibus != NULL)
|
||||
device_delete_child(dev, sc_if->sk_miibus);
|
||||
@ -1520,8 +1516,7 @@ sk_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
}
|
||||
|
||||
/* Transmit */
|
||||
@ -1576,7 +1571,6 @@ static void
|
||||
sk_rxeof(sc_if)
|
||||
struct sk_if_softc *sc_if;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct sk_chain *cur_rx;
|
||||
@ -1629,11 +1623,7 @@ sk_rxeof(sc_if)
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
sc_if->sk_cdata.sk_rx_prod = i;
|
||||
|
@ -2127,7 +2127,7 @@ ti_attach(dev)
|
||||
|
||||
mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF | MTX_RECURSE);
|
||||
sc->arpcom.ac_if.if_capabilities = IFCAP_HWCSUM;
|
||||
sc->arpcom.ac_if.if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING;
|
||||
sc->arpcom.ac_if.if_capenable = sc->arpcom.ac_if.if_capabilities;
|
||||
|
||||
/*
|
||||
@ -2366,7 +2366,7 @@ ti_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc->arpcom.ac_enaddr);
|
||||
return(0);
|
||||
|
||||
fail:
|
||||
@ -2416,7 +2416,7 @@ ti_detach(dev)
|
||||
TI_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
ti_stop(sc);
|
||||
|
||||
bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand);
|
||||
@ -2593,9 +2593,6 @@ ti_rxeof(sc)
|
||||
eh = mtod(m, struct ether_header *);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
|
||||
if (ifp->if_hwassist) {
|
||||
m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED |
|
||||
CSUM_DATA_VALID;
|
||||
@ -2605,15 +2602,12 @@ ti_rxeof(sc)
|
||||
}
|
||||
|
||||
/*
|
||||
* If we received a packet with a vlan tag, pass it
|
||||
* to vlan_input() instead of ether_input().
|
||||
* If we received a packet with a vlan tag,
|
||||
* tag it before passing the packet upward.
|
||||
*/
|
||||
if (have_tag) {
|
||||
VLAN_INPUT_TAG(eh, m, vlan_tag);
|
||||
have_tag = vlan_tag = 0;
|
||||
continue;
|
||||
}
|
||||
ether_input(ifp, eh, m);
|
||||
if (have_tag)
|
||||
VLAN_INPUT_TAG(ifp, m, vlan_tag, continue);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
/* Only necessary on the Tigon 1. */
|
||||
@ -2754,12 +2748,7 @@ ti_encap(sc, m_head, txidx)
|
||||
struct mbuf *m;
|
||||
u_int32_t frag, cur, cnt = 0;
|
||||
u_int16_t csum_flags = 0;
|
||||
struct ifvlan *ifv = NULL;
|
||||
|
||||
if ((m_head->m_flags & (M_PROTO1|M_PKTHDR)) == (M_PROTO1|M_PKTHDR) &&
|
||||
m_head->m_pkthdr.rcvif != NULL &&
|
||||
m_head->m_pkthdr.rcvif->if_type == IFT_L2VLAN)
|
||||
ifv = m_head->m_pkthdr.rcvif->if_softc;
|
||||
struct m_tag *mtag;
|
||||
|
||||
m = m_head;
|
||||
cur = frag = *txidx;
|
||||
@ -2774,6 +2763,9 @@ ti_encap(sc, m_head, txidx)
|
||||
else if (m_head->m_flags & M_FRAG)
|
||||
csum_flags |= TI_BDFLAG_IP_FRAG;
|
||||
}
|
||||
|
||||
mtag = VLAN_OUTPUT_TAG(&sc->arpcom.ac_if, m);
|
||||
|
||||
/*
|
||||
* Start packing the mbufs in this chain into
|
||||
* the fragment pointers. Stop when we run out
|
||||
@ -2803,9 +2795,9 @@ ti_encap(sc, m_head, txidx)
|
||||
f->ti_len = m->m_len;
|
||||
f->ti_flags = csum_flags;
|
||||
|
||||
if (ifv != NULL) {
|
||||
if (mtag != NULL) {
|
||||
f->ti_flags |= TI_BDFLAG_VLAN_TAG;
|
||||
f->ti_vlan_tag = ifv->ifv_tag & 0xfff;
|
||||
f->ti_vlan_tag = VLAN_TAG_VALUE(mtag) & 0xfff;
|
||||
} else {
|
||||
f->ti_vlan_tag = 0;
|
||||
}
|
||||
@ -2896,8 +2888,7 @@ ti_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
}
|
||||
|
||||
/* Transmit */
|
||||
@ -3188,10 +3179,6 @@ ti_ioctl(ifp, command, data)
|
||||
TI_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFMTU:
|
||||
if (ifr->ifr_mtu > TI_JUMBO_MTU)
|
||||
error = EINVAL;
|
||||
@ -3254,7 +3241,7 @@ ti_ioctl(ifp, command, data)
|
||||
error = 0;
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -815,7 +815,7 @@ vr_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
VR_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -838,7 +838,7 @@ vr_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
vr_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->vr_miibus);
|
||||
@ -974,7 +974,6 @@ static void
|
||||
vr_rxeof(sc)
|
||||
struct vr_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct vr_chain_onefrag *cur_rx;
|
||||
@ -1052,11 +1051,7 @@ vr_rxeof(sc)
|
||||
m = m0;
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1390,8 +1385,7 @@ vr_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->vr_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->vr_mbuf);
|
||||
|
||||
VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
|
||||
VR_SETBIT16(sc, VR_COMMAND, /*VR_CMD_TX_ON|*/VR_CMD_TX_GO);
|
||||
@ -1576,11 +1570,6 @@ vr_ioctl(ifp, command, data)
|
||||
VR_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFFLAGS:
|
||||
if (ifp->if_flags & IFF_UP) {
|
||||
vr_init(sc);
|
||||
@ -1601,7 +1590,7 @@ vr_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2262,12 +2262,13 @@ dc_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
|
||||
/*
|
||||
* Tell the upper layer(s) we support long frames.
|
||||
*/
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||
|
||||
callout_init(&sc->dc_stat_ch, IS_MPSAFE);
|
||||
|
||||
@ -2322,7 +2323,7 @@ dc_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
dc_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->dc_miibus);
|
||||
@ -2609,7 +2610,6 @@ static void
|
||||
dc_rxeof(sc)
|
||||
struct dc_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct dc_desc *cur_rx;
|
||||
@ -2708,11 +2708,7 @@ dc_rxeof(sc)
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
sc->dc_cdata.dc_rx_prod = i;
|
||||
@ -3260,8 +3256,7 @@ dc_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
|
||||
if (sc->dc_flags & DC_TX_ONE) {
|
||||
ifp->if_flags |= IFF_OACTIVE;
|
||||
@ -3542,11 +3537,6 @@ dc_ioctl(ifp, command, data)
|
||||
DC_LOCK(sc);
|
||||
|
||||
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 &&
|
||||
@ -3583,7 +3573,7 @@ dc_ioctl(ifp, command, data)
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3567,8 +3567,7 @@ tulip_rx_intr(
|
||||
#if !defined(TULIP_COPY_RXDATA)
|
||||
ms->m_pkthdr.len = total_len;
|
||||
ms->m_pkthdr.rcvif = ifp;
|
||||
m_adj(ms, sizeof(struct ether_header));
|
||||
ether_input(ifp, &eh, ms);
|
||||
(*ifp->if_input)(ifp, ms);
|
||||
#else
|
||||
#ifdef BIG_PACKET
|
||||
#error BIG_PACKET is incompatible with TULIP_COPY_RXDATA
|
||||
@ -3577,8 +3576,7 @@ tulip_rx_intr(
|
||||
m_copydata(ms, 0, total_len, mtod(m0, caddr_t));
|
||||
m0->m_len = m0->m_pkthdr.len = total_len;
|
||||
m0->m_pkthdr.rcvif = ifp;
|
||||
m_adj(m0, sizeof(struct ether_header));
|
||||
ether_input(ifp, &eh, m0);
|
||||
(*ifp->if_input)(ifp, m0);
|
||||
m0 = ms;
|
||||
#endif /* ! TULIP_COPY_RXDATA */
|
||||
}
|
||||
@ -4334,8 +4332,7 @@ tulip_txput(
|
||||
/*
|
||||
* bounce a copy to the bpf listener, if any.
|
||||
*/
|
||||
if (sc->tulip_if.if_bpf != NULL)
|
||||
bpf_mtap(&sc->tulip_if, m);
|
||||
BPF_MTAP(&sc->tulip_if, m);
|
||||
|
||||
/*
|
||||
* The descriptors have been filled in. Now get ready
|
||||
@ -4558,12 +4555,6 @@ tulip_ifioctl(
|
||||
s = splimp();
|
||||
#endif
|
||||
switch (cmd) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR: {
|
||||
error = ether_ioctl(ifp, cmd, data);
|
||||
break;
|
||||
}
|
||||
|
||||
case SIOCSIFFLAGS: {
|
||||
tulip_addr_filter(sc); /* reinit multicast filter */
|
||||
tulip_init(sc);
|
||||
@ -4621,7 +4612,7 @@ tulip_ifioctl(
|
||||
}
|
||||
#endif
|
||||
default: {
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, cmd, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -4813,7 +4804,7 @@ tulip_attach(
|
||||
|
||||
tulip_reset(sc);
|
||||
|
||||
ether_ifattach(&(sc)->tulip_if, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(&(sc)->tulip_if, sc->tulip_enaddr);
|
||||
ifp->if_snd.ifq_maxlen = ifqmaxlen;
|
||||
}
|
||||
|
||||
|
@ -665,7 +665,7 @@ pcn_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, (u_int8_t *) eaddr);
|
||||
callout_handle_init(&sc->pcn_stat_ch);
|
||||
PCN_UNLOCK(sc);
|
||||
return(0);
|
||||
@ -691,7 +691,7 @@ pcn_detach(dev)
|
||||
|
||||
pcn_reset(sc);
|
||||
pcn_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
if (sc->pcn_miibus != NULL) {
|
||||
bus_generic_detach(dev);
|
||||
@ -855,9 +855,7 @@ pcn_rxeof(sc)
|
||||
cur_rx->pcn_rxlen - ETHER_CRC_LEN;
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
sc->pcn_cdata.pcn_rx_prod = i;
|
||||
@ -1101,8 +1099,7 @@ pcn_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
|
||||
}
|
||||
|
||||
@ -1312,11 +1309,6 @@ pcn_ioctl(ifp, command, data)
|
||||
PCN_LOCK(sc);
|
||||
|
||||
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 &&
|
||||
@ -1359,7 +1351,7 @@ pcn_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1072,7 +1072,7 @@ rl_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
|
||||
error = bus_setup_intr(dev, sc->rl_irq, INTR_TYPE_NET,
|
||||
rl_intr, sc, &sc->rl_intrhand);
|
||||
@ -1105,7 +1105,7 @@ rl_detach(dev)
|
||||
RL_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
rl_stop(sc);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
@ -1175,7 +1175,6 @@ static void
|
||||
rl_rxeof(sc)
|
||||
struct rl_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
int total_len = 0;
|
||||
@ -1285,12 +1284,8 @@ rl_rxeof(sc)
|
||||
if (m == NULL)
|
||||
continue;
|
||||
|
||||
eh = mtod(m, struct ether_header *);
|
||||
ifp->if_ipackets++;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1564,8 +1559,7 @@ rl_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, RL_CUR_TXMBUF(sc));
|
||||
BPF_MTAP(ifp, RL_CUR_TXMBUF(sc));
|
||||
|
||||
/*
|
||||
* Transmit the frame.
|
||||
@ -1759,11 +1753,6 @@ rl_ioctl(ifp, command, data)
|
||||
RL_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFFLAGS:
|
||||
if (ifp->if_flags & IFF_UP) {
|
||||
rl_init(sc);
|
||||
@ -1784,7 +1773,7 @@ rl_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -541,11 +541,6 @@ sf_ioctl(ifp, command, data)
|
||||
SF_LOCK(sc);
|
||||
|
||||
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 &&
|
||||
@ -576,7 +571,7 @@ sf_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -834,7 +829,7 @@ sf_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc->arpcom.ac_enaddr);
|
||||
SF_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -855,7 +850,7 @@ sf_detach(dev)
|
||||
SF_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
sf_stop(sc);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
@ -977,7 +972,6 @@ static void
|
||||
sf_rxeof(sc)
|
||||
struct sf_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct sf_rx_bufdesc_type0 *desc;
|
||||
@ -1017,12 +1011,8 @@ sf_rxeof(sc)
|
||||
}
|
||||
m = m0;
|
||||
|
||||
eh = mtod(m, struct ether_header *);
|
||||
ifp->if_ipackets++;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
csr_write_4(sc, SF_CQ_CONSIDX,
|
||||
@ -1404,8 +1394,7 @@ sf_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
|
||||
SF_INC(i, SF_TX_DLIST_CNT);
|
||||
sc->sf_tx_cnt++;
|
||||
|
@ -1125,12 +1125,13 @@ sis_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
|
||||
/*
|
||||
* Tell the upper layer(s) we support long frames.
|
||||
*/
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||
|
||||
callout_handle_init(&sc->sis_stat_ch);
|
||||
return(0);
|
||||
@ -1154,7 +1155,7 @@ sis_detach(dev)
|
||||
|
||||
sis_reset(sc);
|
||||
sis_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->sis_miibus);
|
||||
@ -1364,7 +1365,9 @@ sis_rxeof(sc)
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
ether_input(ifp, NULL, m);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
sc->sis_cdata.sis_rx_prod = i;
|
||||
@ -1687,8 +1690,7 @@ sis_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
|
||||
}
|
||||
|
||||
@ -1933,11 +1935,6 @@ sis_ioctl(ifp, command, data)
|
||||
int error = 0;
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFFLAGS:
|
||||
if (ifp->if_flags & IFF_UP) {
|
||||
sis_init(sc);
|
||||
@ -1965,7 +1962,7 @@ sis_ioctl(ifp, command, data)
|
||||
SIS_UNLOCK(sc);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -899,10 +899,6 @@ sk_ioctl(ifp, command, data)
|
||||
SK_IF_LOCK(sc_if);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFMTU:
|
||||
if (ifr->ifr_mtu > SK_JUMBO_MTU)
|
||||
error = EINVAL;
|
||||
@ -945,7 +941,7 @@ sk_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1174,7 +1170,7 @@ sk_attach_xmac(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc_if->arpcom.ac_enaddr);
|
||||
callout_handle_init(&sc_if->sk_tick_ch);
|
||||
|
||||
/*
|
||||
@ -1186,7 +1182,7 @@ sk_attach_xmac(dev)
|
||||
printf("skc%d: no PHY found!\n", sc_if->sk_unit);
|
||||
contigfree(sc_if->sk_rdata,
|
||||
sizeof(struct sk_ring_data), M_DEVBUF);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
SK_UNLOCK(sc);
|
||||
return(ENXIO);
|
||||
}
|
||||
@ -1398,7 +1394,7 @@ sk_detach_xmac(dev)
|
||||
|
||||
ifp = &sc_if->arpcom.ac_if;
|
||||
sk_stop(sc_if);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
bus_generic_detach(dev);
|
||||
if (sc_if->sk_miibus != NULL)
|
||||
device_delete_child(dev, sc_if->sk_miibus);
|
||||
@ -1520,8 +1516,7 @@ sk_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
}
|
||||
|
||||
/* Transmit */
|
||||
@ -1576,7 +1571,6 @@ static void
|
||||
sk_rxeof(sc_if)
|
||||
struct sk_if_softc *sc_if;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct sk_chain *cur_rx;
|
||||
@ -1629,11 +1623,7 @@ sk_rxeof(sc_if)
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
sc_if->sk_cdata.sk_rx_prod = i;
|
||||
|
@ -691,7 +691,6 @@ static void
|
||||
ste_rxeof(sc)
|
||||
struct ste_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct ste_chain_onefrag *cur_rx;
|
||||
@ -751,14 +750,11 @@ ste_rxeof(sc)
|
||||
continue;
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
ifp->if_ipackets++;
|
||||
(*ifp->if_input)(ifp, m);
|
||||
|
||||
cur_rx->ste_ptr->ste_status = 0;
|
||||
count++;
|
||||
@ -1091,12 +1087,13 @@ ste_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc->arpcom.ac_enaddr);
|
||||
|
||||
/*
|
||||
* Tell the upper layer(s) we support long frames.
|
||||
*/
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
ifp->if_capabilities |= IFCAP_VLAN_MTU;
|
||||
|
||||
STE_UNLOCK(sc);
|
||||
return(0);
|
||||
@ -1119,7 +1116,7 @@ ste_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
ste_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->ste_miibus);
|
||||
@ -1165,7 +1162,7 @@ ste_newbuf(sc, c, m)
|
||||
c->ste_mbuf = m_new;
|
||||
c->ste_ptr->ste_status = 0;
|
||||
c->ste_ptr->ste_frag.ste_addr = vtophys(mtod(m_new, caddr_t));
|
||||
c->ste_ptr->ste_frag.ste_len = (1536 + EVL_ENCAPLEN) | STE_FRAG_LAST;
|
||||
c->ste_ptr->ste_frag.ste_len = (1536 + ETHER_VLAN_ENCAP_LEN) | STE_FRAG_LAST;
|
||||
|
||||
return(0);
|
||||
}
|
||||
@ -1338,7 +1335,7 @@ ste_init(xsc)
|
||||
CSR_WRITE_2(sc, STE_IMR, STE_INTRS);
|
||||
|
||||
/* Accept VLAN length packets */
|
||||
CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + EVL_ENCAPLEN);
|
||||
CSR_WRITE_2(sc, STE_MAX_FRAMELEN, ETHER_MAX_LEN + ETHER_VLAN_ENCAP_LEN);
|
||||
|
||||
ste_ifmedia_upd(ifp);
|
||||
|
||||
@ -1442,11 +1439,6 @@ ste_ioctl(ifp, command, data)
|
||||
ifr = (struct ifreq *)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 &&
|
||||
@ -1482,7 +1474,7 @@ ste_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1624,8 +1616,7 @@ ste_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->ste_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->ste_mbuf);
|
||||
|
||||
STE_INC(idx, STE_TX_LIST_CNT);
|
||||
sc->ste_cdata.ste_tx_cnt++;
|
||||
|
@ -2127,7 +2127,7 @@ ti_attach(dev)
|
||||
|
||||
mtx_init(&sc->ti_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
|
||||
MTX_DEF | MTX_RECURSE);
|
||||
sc->arpcom.ac_if.if_capabilities = IFCAP_HWCSUM;
|
||||
sc->arpcom.ac_if.if_capabilities = IFCAP_HWCSUM | IFCAP_VLAN_HWTAGGING;
|
||||
sc->arpcom.ac_if.if_capenable = sc->arpcom.ac_if.if_capabilities;
|
||||
|
||||
/*
|
||||
@ -2366,7 +2366,7 @@ ti_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc->arpcom.ac_enaddr);
|
||||
return(0);
|
||||
|
||||
fail:
|
||||
@ -2416,7 +2416,7 @@ ti_detach(dev)
|
||||
TI_LOCK(sc);
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
ti_stop(sc);
|
||||
|
||||
bus_teardown_intr(dev, sc->ti_irq, sc->ti_intrhand);
|
||||
@ -2593,9 +2593,6 @@ ti_rxeof(sc)
|
||||
eh = mtod(m, struct ether_header *);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
|
||||
if (ifp->if_hwassist) {
|
||||
m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED |
|
||||
CSUM_DATA_VALID;
|
||||
@ -2605,15 +2602,12 @@ ti_rxeof(sc)
|
||||
}
|
||||
|
||||
/*
|
||||
* If we received a packet with a vlan tag, pass it
|
||||
* to vlan_input() instead of ether_input().
|
||||
* If we received a packet with a vlan tag,
|
||||
* tag it before passing the packet upward.
|
||||
*/
|
||||
if (have_tag) {
|
||||
VLAN_INPUT_TAG(eh, m, vlan_tag);
|
||||
have_tag = vlan_tag = 0;
|
||||
continue;
|
||||
}
|
||||
ether_input(ifp, eh, m);
|
||||
if (have_tag)
|
||||
VLAN_INPUT_TAG(ifp, m, vlan_tag, continue);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
/* Only necessary on the Tigon 1. */
|
||||
@ -2754,12 +2748,7 @@ ti_encap(sc, m_head, txidx)
|
||||
struct mbuf *m;
|
||||
u_int32_t frag, cur, cnt = 0;
|
||||
u_int16_t csum_flags = 0;
|
||||
struct ifvlan *ifv = NULL;
|
||||
|
||||
if ((m_head->m_flags & (M_PROTO1|M_PKTHDR)) == (M_PROTO1|M_PKTHDR) &&
|
||||
m_head->m_pkthdr.rcvif != NULL &&
|
||||
m_head->m_pkthdr.rcvif->if_type == IFT_L2VLAN)
|
||||
ifv = m_head->m_pkthdr.rcvif->if_softc;
|
||||
struct m_tag *mtag;
|
||||
|
||||
m = m_head;
|
||||
cur = frag = *txidx;
|
||||
@ -2774,6 +2763,9 @@ ti_encap(sc, m_head, txidx)
|
||||
else if (m_head->m_flags & M_FRAG)
|
||||
csum_flags |= TI_BDFLAG_IP_FRAG;
|
||||
}
|
||||
|
||||
mtag = VLAN_OUTPUT_TAG(&sc->arpcom.ac_if, m);
|
||||
|
||||
/*
|
||||
* Start packing the mbufs in this chain into
|
||||
* the fragment pointers. Stop when we run out
|
||||
@ -2803,9 +2795,9 @@ ti_encap(sc, m_head, txidx)
|
||||
f->ti_len = m->m_len;
|
||||
f->ti_flags = csum_flags;
|
||||
|
||||
if (ifv != NULL) {
|
||||
if (mtag != NULL) {
|
||||
f->ti_flags |= TI_BDFLAG_VLAN_TAG;
|
||||
f->ti_vlan_tag = ifv->ifv_tag & 0xfff;
|
||||
f->ti_vlan_tag = VLAN_TAG_VALUE(mtag) & 0xfff;
|
||||
} else {
|
||||
f->ti_vlan_tag = 0;
|
||||
}
|
||||
@ -2896,8 +2888,7 @@ ti_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, m_head);
|
||||
BPF_MTAP(ifp, m_head);
|
||||
}
|
||||
|
||||
/* Transmit */
|
||||
@ -3188,10 +3179,6 @@ ti_ioctl(ifp, command, data)
|
||||
TI_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFMTU:
|
||||
if (ifr->ifr_mtu > TI_JUMBO_MTU)
|
||||
error = EINVAL;
|
||||
@ -3254,7 +3241,7 @@ ti_ioctl(ifp, command, data)
|
||||
error = 0;
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1348,7 +1348,7 @@ tl_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, sc->arpcom.ac_enaddr);
|
||||
TL_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -1370,7 +1370,7 @@ tl_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
tl_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->tl_miibus);
|
||||
@ -1543,15 +1543,13 @@ tl_intvec_rxeof(xsc, type)
|
||||
sc->tl_cdata.tl_rx_tail->tl_next = cur_rx;
|
||||
sc->tl_cdata.tl_rx_tail = cur_rx;
|
||||
|
||||
eh = mtod(m, struct ether_header *);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
|
||||
/*
|
||||
* Note: when the ThunderLAN chip is in 'capture all
|
||||
* frames' mode, it will receive its own transmissions.
|
||||
* We drop don't need to process our own transmissions,
|
||||
* so we drop them here and continue.
|
||||
*/
|
||||
eh = mtod(m, struct ether_header *);
|
||||
/*if (ifp->if_flags & IFF_PROMISC && */
|
||||
if (!bcmp(eh->ether_shost, sc->arpcom.ac_enaddr,
|
||||
ETHER_ADDR_LEN)) {
|
||||
@ -1559,11 +1557,10 @@ tl_intvec_rxeof(xsc, type)
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m->m_pkthdr.len = m->m_len =
|
||||
total_len - sizeof(struct ether_header);
|
||||
m->m_data += sizeof(struct ether_header);
|
||||
ether_input(ifp, eh, m);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len;
|
||||
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
return(r);
|
||||
@ -2015,8 +2012,7 @@ tl_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->tl_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->tl_mbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2217,11 +2213,6 @@ tl_ioctl(ifp, command, data)
|
||||
s = splimp();
|
||||
|
||||
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 &&
|
||||
@ -2261,7 +2252,7 @@ tl_ioctl(ifp, command, data)
|
||||
}
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -815,7 +815,7 @@ vr_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
VR_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -838,7 +838,7 @@ vr_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
vr_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
bus_generic_detach(dev);
|
||||
device_delete_child(dev, sc->vr_miibus);
|
||||
@ -974,7 +974,6 @@ static void
|
||||
vr_rxeof(sc)
|
||||
struct vr_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct vr_chain_onefrag *cur_rx;
|
||||
@ -1052,11 +1051,7 @@ vr_rxeof(sc)
|
||||
m = m0;
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -1390,8 +1385,7 @@ vr_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->vr_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->vr_mbuf);
|
||||
|
||||
VR_TXOWN(cur_tx) = VR_TXSTAT_OWN;
|
||||
VR_SETBIT16(sc, VR_COMMAND, /*VR_CMD_TX_ON|*/VR_CMD_TX_GO);
|
||||
@ -1576,11 +1570,6 @@ vr_ioctl(ifp, command, data)
|
||||
VR_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFFLAGS:
|
||||
if (ifp->if_flags & IFF_UP) {
|
||||
vr_init(sc);
|
||||
@ -1601,7 +1590,7 @@ vr_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -978,7 +978,7 @@ wb_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
WB_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -1003,7 +1003,7 @@ wb_detach(dev)
|
||||
ifp = &sc->arpcom.ac_if;
|
||||
|
||||
wb_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
/* Delete any miibus and phy devices attached to this interface */
|
||||
bus_generic_detach(dev);
|
||||
@ -1143,7 +1143,6 @@ static void
|
||||
wb_rxeof(sc)
|
||||
struct wb_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m = NULL;
|
||||
struct ifnet *ifp;
|
||||
struct wb_chain_onefrag *cur_rx;
|
||||
@ -1204,11 +1203,7 @@ wb_rxeof(sc)
|
||||
m = m0;
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
ether_input(ifp, eh, m);
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1561,8 +1556,7 @@ wb_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->wb_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->wb_mbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1785,11 +1779,6 @@ wb_ioctl(ifp, command, data)
|
||||
WB_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFFLAGS:
|
||||
if (ifp->if_flags & IFF_UP) {
|
||||
wb_init(sc);
|
||||
@ -1810,7 +1799,7 @@ wb_ioctl(ifp, command, data)
|
||||
error = ifmedia_ioctl(ifp, ifr, &mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1633,7 +1633,7 @@ xl_attach(dev)
|
||||
/*
|
||||
* Call MI attach routine.
|
||||
*/
|
||||
ether_ifattach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifattach(ifp, eaddr);
|
||||
XL_UNLOCK(sc);
|
||||
return(0);
|
||||
|
||||
@ -1657,7 +1657,7 @@ xl_detach(dev)
|
||||
|
||||
xl_reset(sc);
|
||||
xl_stop(sc);
|
||||
ether_ifdetach(ifp, ETHER_BPF_SUPPORTED);
|
||||
ether_ifdetach(ifp);
|
||||
|
||||
/* Delete any miibus and phy devices attached to this interface */
|
||||
if (sc->xl_miibus != NULL) {
|
||||
@ -1847,7 +1847,6 @@ static void
|
||||
xl_rxeof(sc)
|
||||
struct xl_softc *sc;
|
||||
{
|
||||
struct ether_header *eh;
|
||||
struct mbuf *m;
|
||||
struct ifnet *ifp;
|
||||
struct xl_chain_onefrag *cur_rx;
|
||||
@ -1905,13 +1904,9 @@ xl_rxeof(sc)
|
||||
}
|
||||
|
||||
ifp->if_ipackets++;
|
||||
eh = mtod(m, struct ether_header *);
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
m->m_pkthdr.len = m->m_len = total_len;
|
||||
|
||||
/* Remove header from mbuf and pass it on. */
|
||||
m_adj(m, sizeof(struct ether_header));
|
||||
|
||||
if (sc->xl_type == XL_TYPE_905B) {
|
||||
/* Do IP checksum checking. */
|
||||
if (rxstat & XL_RXSTAT_IPCKOK)
|
||||
@ -1927,7 +1922,8 @@ xl_rxeof(sc)
|
||||
m->m_pkthdr.csum_data = 0xffff;
|
||||
}
|
||||
}
|
||||
ether_input(ifp, eh, m);
|
||||
|
||||
(*ifp->if_input)(ifp, m);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2364,8 +2360,7 @@ xl_start(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->xl_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->xl_mbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -2526,8 +2521,7 @@ static void xl_start_90xB(ifp)
|
||||
* If there's a BPF listener, bounce a copy of this frame
|
||||
* to him.
|
||||
*/
|
||||
if (ifp->if_bpf)
|
||||
bpf_mtap(ifp, cur_tx->xl_mbuf);
|
||||
BPF_MTAP(ifp, cur_tx->xl_mbuf);
|
||||
|
||||
XL_INC(idx, XL_TX_LIST_CNT);
|
||||
sc->xl_cdata.xl_tx_cnt++;
|
||||
@ -2895,11 +2889,6 @@ xl_ioctl(ifp, command, data)
|
||||
XL_LOCK(sc);
|
||||
|
||||
switch(command) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
case SIOCSIFFLAGS:
|
||||
XL_SEL_WIN(5);
|
||||
rxfilt = CSR_READ_1(sc, XL_W5_RX_FILTER);
|
||||
@ -2947,7 +2936,7 @@ xl_ioctl(ifp, command, data)
|
||||
&mii->mii_media, command);
|
||||
break;
|
||||
default:
|
||||
error = EINVAL;
|
||||
error = ether_ioctl(ifp, command, data);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user