diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-06-24 22:58:02 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-06-24 22:58:02 +0000 |
commit | 9290de454dac74c53c4fa84260607b8053c8d870 (patch) | |
tree | c02f7f7b219a8b44d4dd85989706a7672c328b53 /sys | |
parent | a65ab643786f0d374a6dc37a8ed701315960beef (diff) |
- vlan_input_tag() takes 2 args now.
- use ether_input_mbuf().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_nge.c | 15 | ||||
-rw-r--r-- | sys/dev/pci/if_ti.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_txp.c | 8 |
3 files changed, 9 insertions, 26 deletions
diff --git a/sys/dev/pci/if_nge.c b/sys/dev/pci/if_nge.c index b775e99a2d9..a91c73f2173 100644 --- a/sys/dev/pci/if_nge.c +++ b/sys/dev/pci/if_nge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_nge.c,v 1.1 2001/06/08 02:26:13 nate Exp $ */ +/* $OpenBSD: if_nge.c,v 1.2 2001/06/24 22:58:01 fgsch Exp $ */ /* * Copyright (c) 2001 Wind River Systems * Copyright (c) 1997, 1998, 1999, 2000, 2001 @@ -1240,7 +1240,6 @@ void nge_jfree(buf, size, arg) void nge_rxeof(sc) struct nge_softc *sc; { - struct ether_header *eh; struct mbuf *m; struct ifnet *ifp; struct nge_desc *cur_rx; @@ -1294,7 +1293,6 @@ void nge_rxeof(sc) m = m0; ifp->if_ipackets++; - eh = mtod(m, struct ether_header *); #if NBPFILTER > 0 /* @@ -1304,12 +1302,8 @@ void nge_rxeof(sc) bpf_mtap(ifp->if_bpf, m); #endif - - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - - /* Do IP checksum checking. */ #ifdef NGE_CSUM_OFFLOAD + /* Do IP checksum checking. */ if (extsts & NGE_RXEXTSTS_IPPKT) m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED; if (!(extsts & NGE_RXEXTSTS_IPCSUMERR)) @@ -1322,14 +1316,13 @@ void nge_rxeof(sc) * to vlan_input() instead of ether_input(). */ if (extsts & NGE_RXEXTSTS_VLANPKT) { - if (vlan_input_tag(eh, m, - extsts & NGE_RXEXTSTS_VTCI) < 0) + if (vlan_input_tag(m, extsts & NGE_RXEXTSTS_VTCI) < 0) ifp->if_data.ifi_noproto++; continue; } #endif - ether_input(ifp, eh, m); + ether_input_mbuf(ifp, m); } sc->nge_cdata.nge_rx_prod = i; diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 71ba377ba76..ad1570c8adf 100644 --- a/sys/dev/pci/if_ti.c +++ b/sys/dev/pci/if_ti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ti.c,v 1.22 2001/06/24 20:27:00 fgsch Exp $ */ +/* $OpenBSD: if_ti.c,v 1.23 2001/06/24 22:58:01 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1788,11 +1788,8 @@ void ti_rxeof(sc) bpf_mtap(ifp->if_bpf, m); #endif - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - #ifdef TI_CSUM_OFFLOAD - ip = mtod(m, struct ip *); + ip = (struct ip *)(mtod(m, caddr_t) + ETHER_HDR_LEN); if (!(cur_rx->ti_tcp_udp_cksum ^ 0xFFFF) && !(ip->ip_off & htons(IP_MF | IP_OFFMASK | IP_RF))) m->m_flags |= M_HWCKSUM; @@ -1804,10 +1801,7 @@ void ti_rxeof(sc) * to vlan_input() instead of ether_input(). */ if (have_tag) { - struct ether_header *eh; - - eh = mtod(m, struct ether_header *); - if (vlan_input_tag(eh, m, vlan_tag) < 0) + if (vlan_input_tag(m, vlan_tag) < 0) ifp->if_data.ifi_noproto++; have_tag = vlan_tag = 0; continue; diff --git a/sys/dev/pci/if_txp.c b/sys/dev/pci/if_txp.c index 7503ef1a30d..9a777506fd4 100644 --- a/sys/dev/pci/if_txp.c +++ b/sys/dev/pci/if_txp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_txp.c,v 1.46 2001/06/23 22:56:51 jason Exp $ */ +/* $OpenBSD: if_txp.c,v 1.47 2001/06/24 22:58:01 fgsch Exp $ */ /* * Copyright (c) 2001 @@ -670,11 +670,7 @@ txp_rx_reclaim(sc, r) #if NVLAN > 0 if (rxd->rx_stat & RX_STAT_VLAN) { - struct ether_header *eh; - - eh = mtod(m, struct ether_header *); - m_adj(m, sizeof(struct ether_header)); - if (vlan_input_tag(eh, m, htons(rxd->rx_vlan >> 16)) < 0) + if (vlan_input_tag(m, htons(rxd->rx_vlan >> 16)) < 0) ifp->if_noproto++; goto next; } |