summaryrefslogtreecommitdiff
path: root/sys/dev/isa
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2015-05-19 11:24:02 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2015-05-19 11:24:02 +0000
commitbd0f3cfcc75910403d88df86e01027e6917c6a94 (patch)
tree79e2fd52a57ce4518bfd8e41edd9ad0cd2eb343b /sys/dev/isa
parent4ef107970040e67d26e952cff08e64a7552f8c12 (diff)
Convert to if_input().
ok dlg@
Diffstat (limited to 'sys/dev/isa')
-rw-r--r--sys/dev/isa/if_ef_isapnp.c13
-rw-r--r--sys/dev/isa/if_eg.c19
-rw-r--r--sys/dev/isa/if_el.c17
-rw-r--r--sys/dev/isa/if_ex.c13
4 files changed, 18 insertions, 44 deletions
diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c
index b4f8851d055..18508c38fa2 100644
--- a/sys/dev/isa/if_ef_isapnp.c
+++ b/sys/dev/isa/if_ef_isapnp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ef_isapnp.c,v 1.27 2014/12/22 02:28:51 tedu Exp $ */
+/* $OpenBSD: if_ef_isapnp.c,v 1.28 2015/05/19 11:24:01 mpi Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -671,6 +671,7 @@ efread(sc)
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
int len;
@@ -719,13 +720,9 @@ efread(sc)
}
ifp->if_ipackets++;
+ ml_enqueue(&ml, m);
-#if NBPFILTER > 0
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
struct mbuf *
@@ -735,14 +732,12 @@ efget(sc, totlen)
{
bus_space_tag_t iot = sc->sc_iot;
bus_space_handle_t ioh = sc->sc_ioh;
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct mbuf *top, **mp, *m;
int len, pad, s;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return (NULL);
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
pad = ALIGN(sizeof(struct ether_header)) - sizeof(struct ether_header);
m->m_data += pad;
diff --git a/sys/dev/isa/if_eg.c b/sys/dev/isa/if_eg.c
index 71e4fbea36d..45ee45cea6a 100644
--- a/sys/dev/isa/if_eg.c
+++ b/sys/dev/isa/if_eg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_eg.c,v 1.37 2015/05/13 10:42:46 jsg Exp $ */
+/* $OpenBSD: if_eg.c,v 1.38 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: if_eg.c,v 1.26 1996/05/12 23:52:27 mycroft Exp $ */
/*
@@ -670,8 +670,9 @@ void
egread(struct eg_softc *sc, caddr_t buf, int len)
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
-
+
if (len <= sizeof(struct ether_header) ||
len > ETHER_MAX_LEN) {
printf("%s: invalid packet size %d; dropping\n",
@@ -688,17 +689,9 @@ egread(struct eg_softc *sc, caddr_t buf, int len)
}
ifp->if_ipackets++;
+ ml_enqueue(&ml, m);
-#if NBPFILTER > 0
- /*
- * Check if there's a BPF listener on this interface.
- * If so, hand off the raw packet to BPF.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
/*
@@ -707,14 +700,12 @@ egread(struct eg_softc *sc, caddr_t buf, int len)
struct mbuf *
egget(struct eg_softc *sc, caddr_t buf, int totlen)
{
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
struct mbuf *top, **mp, *m;
int len;
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return (0);
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
len = MHLEN;
top = 0;
diff --git a/sys/dev/isa/if_el.c b/sys/dev/isa/if_el.c
index ac2d81dad2c..744ece69ad9 100644
--- a/sys/dev/isa/if_el.c
+++ b/sys/dev/isa/if_el.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_el.c,v 1.25 2015/05/13 10:42:46 jsg Exp $ */
+/* $OpenBSD: if_el.c,v 1.26 2015/05/19 11:24:01 mpi Exp $ */
/* $NetBSD: if_el.c,v 1.39 1996/05/12 23:52:32 mycroft Exp $ */
/*
@@ -490,6 +490,7 @@ elread(sc, len)
int len;
{
struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
struct mbuf *m;
if (len <= sizeof(struct ether_header) ||
@@ -508,17 +509,9 @@ elread(sc, len)
}
ifp->if_ipackets++;
+ ml_enqueue(&ml, m);
-#if NBPFILTER > 0
- /*
- * Check if there's a BPF listener on this interface.
- * If so, hand off the raw packet to BPF.
- */
- if (ifp->if_bpf)
- bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);
-#endif
-
- ether_input_mbuf(ifp, m);
+ if_input(ifp, &ml);
}
/*
@@ -531,7 +524,6 @@ elget(sc, totlen)
struct el_softc *sc;
int totlen;
{
- struct ifnet *ifp = &sc->sc_arpcom.ac_if;
int iobase = sc->sc_iobase;
struct mbuf *top, **mp, *m;
int len;
@@ -539,7 +531,6 @@ elget(sc, totlen)
MGETHDR(m, M_DONTWAIT, MT_DATA);
if (m == NULL)
return 0;
- m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = totlen;
len = MHLEN;
top = 0;
diff --git a/sys/dev/isa/if_ex.c b/sys/dev/isa/if_ex.c
index 0c8f883616e..3366ffe80d9 100644
--- a/sys/dev/isa/if_ex.c
+++ b/sys/dev/isa/if_ex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ex.c,v 1.37 2014/12/22 02:28:51 tedu Exp $ */
+/* $OpenBSD: if_ex.c,v 1.38 2015/05/19 11:24:01 mpi Exp $ */
/*
* Copyright (c) 1997, Donald A. Schmidt
* Copyright (c) 1996, Javier Martín Rueda (jmrueda@diatel.upm.es)
@@ -639,6 +639,7 @@ void
ex_rx_intr(struct ex_softc *sc)
{
struct ifnet *ifp = &sc->arpcom.ac_if;
+ struct mbuf_list ml = MBUF_LIST_INITIALIZER();
int rx_status, pkt_len, QQQ;
struct mbuf *m, *ipkt;
@@ -661,7 +662,6 @@ ex_rx_intr(struct ex_softc *sc)
if (ipkt == NULL)
ifp->if_iqdrops++;
else {
- ipkt->m_pkthdr.rcvif = ifp;
ipkt->m_pkthdr.len = pkt_len;
ipkt->m_len = MHLEN;
while (pkt_len > 0) {
@@ -710,13 +710,8 @@ ex_rx_intr(struct ex_softc *sc)
} /* QQQ */
}
#endif
-#if NBPFILTER > 0
- if (ifp->if_bpf != NULL)
- bpf_mtap(ifp->if_bpf, ipkt,
- BPF_DIRECTION_IN);
-#endif
- ether_input_mbuf(ifp, ipkt);
ifp->if_ipackets++;
+ ml_enqueue(&ml, ipkt);
}
} else
ifp->if_ierrors++;
@@ -728,6 +723,8 @@ ex_rx_intr(struct ex_softc *sc)
else
CSR_WRITE_2(sc, RCV_STOP_REG, sc->rx_head - 2);
+ if_input(ifp, &ml);
+
DODEBUG(Start_End, printf("ex_rx_intr: finish\n"););
}