diff options
author | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-06-24 20:27:04 +0000 |
---|---|---|
committer | Federico G. Schwindt <fgsch@cvs.openbsd.org> | 2001-06-24 20:27:04 +0000 |
commit | e54cb0e010ad22138c636da51d6b86a95f8b4794 (patch) | |
tree | 6edcd846a448208b47118126091aa62444060402 /sys/dev/pci | |
parent | ca369e064f838ab5f94b89dc067ac7f8768e0b4c (diff) |
more ether_input_mbuf() conversion.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_sf.c | 10 | ||||
-rw-r--r-- | sys/dev/pci/if_sis.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/if_ti.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/if_tl.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/if_vr.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/if_wb.c | 9 | ||||
-rw-r--r-- | sys/dev/pci/if_wx.c | 6 |
7 files changed, 25 insertions, 38 deletions
diff --git a/sys/dev/pci/if_sf.c b/sys/dev/pci/if_sf.c index 1d58c510e84..19f8b4bf333 100644 --- a/sys/dev/pci/if_sf.c +++ b/sys/dev/pci/if_sf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sf.c,v 1.10 2001/02/20 19:39:44 mickey Exp $ */ +/* $OpenBSD: if_sf.c,v 1.11 2001/06/24 20:26:59 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -876,7 +876,6 @@ int sf_newbuf(sc, c, m) void sf_rxeof(sc) struct sf_softc *sc; { - struct ether_header *eh; struct mbuf *m; struct ifnet *ifp; struct sf_rx_bufdesc_type0 *desc; @@ -917,7 +916,6 @@ void sf_rxeof(sc) m_adj(m0, ETHER_ALIGN); m = m0; - eh = mtod(m, struct ether_header *); ifp->if_ipackets++; #if NBPFILTER > 0 @@ -925,10 +923,8 @@ void sf_rxeof(sc) bpf_mtap(ifp->if_bpf, m); #endif - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, eh, m); - + /* pass it on. */ + ether_input_mbuf(ifp, m); } csr_write_4(sc, SF_CQ_CONSIDX, diff --git a/sys/dev/pci/if_sis.c b/sys/dev/pci/if_sis.c index 669a23b9743..eb88dac17ae 100644 --- a/sys/dev/pci/if_sis.c +++ b/sys/dev/pci/if_sis.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_sis.c,v 1.13 2001/05/10 23:34:01 aaron Exp $ */ +/* $OpenBSD: if_sis.c,v 1.14 2001/06/24 20:27:00 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. @@ -975,7 +975,6 @@ int sis_newbuf(sc, c, m) void sis_rxeof(sc) struct sis_softc *sc; { - struct ether_header *eh; struct mbuf *m; struct ifnet *ifp; struct sis_desc *cur_rx; @@ -1021,16 +1020,14 @@ void sis_rxeof(sc) m = m0; ifp->if_ipackets++; - eh = mtod(m, struct ether_header *); #if NBPFILTER > 0 if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); #endif - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, eh, m); + /* pass it on. */ + ether_input_mbuf(ifp, m); } sc->sis_cdata.sis_rx_prod = i; diff --git a/sys/dev/pci/if_ti.c b/sys/dev/pci/if_ti.c index 6133d5057bd..71ba377ba76 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.21 2001/06/18 19:19:41 deraadt Exp $ */ +/* $OpenBSD: if_ti.c,v 1.22 2001/06/24 20:27:00 fgsch Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -1711,7 +1711,6 @@ void ti_rxeof(sc) while(sc->ti_rx_saved_considx != sc->ti_return_prodidx.ti_idx) { struct ti_rx_desc *cur_rx; u_int32_t rxidx; - struct ether_header *eh; struct mbuf *m = NULL; #if NVLAN > 0 u_int16_t vlan_tag = 0; @@ -1779,7 +1778,6 @@ void ti_rxeof(sc) m->m_pkthdr.len = m->m_len = cur_rx->ti_len; ifp->if_ipackets++; - eh = mtod(m, struct ether_header *); m->m_pkthdr.rcvif = ifp; #if NBPFILTER > 0 @@ -1806,13 +1804,16 @@ 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) ifp->if_data.ifi_noproto++; have_tag = vlan_tag = 0; continue; } #endif - ether_input(ifp, eh, m); + ether_input_mbuf(ifp, m); } /* Only necessary on the Tigon 1. */ diff --git a/sys/dev/pci/if_tl.c b/sys/dev/pci/if_tl.c index eef6eae021a..b5ad89c0198 100644 --- a/sys/dev/pci/if_tl.c +++ b/sys/dev/pci/if_tl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tl.c,v 1.19 2001/04/05 02:03:12 jason Exp $ */ +/* $OpenBSD: if_tl.c,v 1.20 2001/06/24 20:27:01 fgsch Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1154,6 +1154,7 @@ int tl_intvec_rxeof(xsc, type) continue; } + m->m_pkthdr.len = m->m_len = total_len; #if NBPFILTER > 0 /* * Handle BPF listeners. Let the BPF user see the packet, but @@ -1164,15 +1165,11 @@ int tl_intvec_rxeof(xsc, type) * since it can be used again later. */ if (ifp->if_bpf) { - m->m_pkthdr.len = m->m_len = total_len; bpf_mtap(ifp->if_bpf, m); } #endif - /* 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); + /* pass it on. */ + ether_input_mbuf(ifp, m); } return(r); diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c index 2d93dbe5c91..f095cb9b426 100644 --- a/sys/dev/pci/if_vr.c +++ b/sys/dev/pci/if_vr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vr.c,v 1.15 2001/05/16 13:41:27 aaron Exp $ */ +/* $OpenBSD: if_vr.c,v 1.16 2001/06/24 20:27:02 fgsch Exp $ */ /* * Copyright (c) 1997, 1998 @@ -917,7 +917,6 @@ void vr_rxeof(sc) struct vr_softc *sc; { - struct ether_header *eh; struct mbuf *m; struct ifnet *ifp; struct vr_chain_onefrag *cur_rx; @@ -996,7 +995,6 @@ vr_rxeof(sc) m = m0; ifp->if_ipackets++; - eh = mtod(m, struct ether_header *); #if NBPFILTER > 0 /* @@ -1005,9 +1003,8 @@ vr_rxeof(sc) if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); #endif - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, eh, m); + /* pass it on. */ + ether_input_mbuf(ifp, m); } return; diff --git a/sys/dev/pci/if_wb.c b/sys/dev/pci/if_wb.c index a123689bcc7..8655e3d5d32 100644 --- a/sys/dev/pci/if_wb.c +++ b/sys/dev/pci/if_wb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wb.c,v 1.9 2001/05/17 18:41:46 provos Exp $ */ +/* $OpenBSD: if_wb.c,v 1.10 2001/06/24 20:27:02 fgsch Exp $ */ /* * Copyright (c) 1997, 1998 @@ -1059,7 +1059,6 @@ wb_newbuf(sc, c, m) 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; @@ -1121,7 +1120,6 @@ void wb_rxeof(sc) m = m0; ifp->if_ipackets++; - eh = mtod(m, struct ether_header *); #if NBPFILTER > 0 /* @@ -1130,9 +1128,8 @@ void wb_rxeof(sc) if (ifp->if_bpf) bpf_mtap(ifp->if_bpf, m); #endif - /* Remove header from mbuf and pass it on. */ - m_adj(m, sizeof(struct ether_header)); - ether_input(ifp, eh, m); + /* pass it on. */ + ether_input_mbuf(ifp, m); } return; diff --git a/sys/dev/pci/if_wx.c b/sys/dev/pci/if_wx.c index f3488d5002a..cc43092c01c 100644 --- a/sys/dev/pci/if_wx.c +++ b/sys/dev/pci/if_wx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wx.c,v 1.12 2001/06/12 15:40:31 niklas Exp $ */ +/* $OpenBSD: if_wx.c,v 1.13 2001/06/24 20:27:03 fgsch Exp $ */ /* * Principal Author: Matthew Jacob * Copyright (c) 1999, 2001 by Traakan Software @@ -1611,10 +1611,12 @@ wx_handle_rxint(wx_softc_t *sc) ifp->if_ipackets++; DPRINTF(sc, ("%s: RECV packet length %d\n", sc->wx_name, mb->m_pkthdr.len)); -#if defined(__FreeBSD__) || defined(__OpenBSD__) +#if defined(__FreeBSD__) eh = mtod(mb, struct ether_header *); m_adj(mb, sizeof (struct ether_header)); ether_input(ifp, eh, mb); +#elif defined(__OpenBSD__) + ether_input_mbuf(ifp, mb); #else (*ifp->if_input)(ifp, mb); #endif |