aboutsummaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Greenman <dg@FreeBSD.org>1994-11-24 14:29:38 +0000
committerDavid Greenman <dg@FreeBSD.org>1994-11-24 14:29:38 +0000
commit307d80be7ac4f1a65b849edcc42b2705545fa2b5 (patch)
treef24c94cbed7412ca371d1f76bc07b9dfdcdbc432 /sys/dev
parent63281ad7528de71c6be2775ba1dffe60fb9f2289 (diff)
Notes
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/de/if_de.c3
-rw-r--r--sys/dev/ed/if_ed.c10
-rw-r--r--sys/dev/ep/if_ep.c94
-rw-r--r--sys/dev/ie/if_ie.c4
-rw-r--r--sys/dev/lnc/if_lnc.c1
5 files changed, 5 insertions, 107 deletions
diff --git a/sys/dev/de/if_de.c b/sys/dev/de/if_de.c
index 9e6a26b56ea7..c2be0754e4a4 100644
--- a/sys/dev/de/if_de.c
+++ b/sys/dev/de/if_de.c
@@ -21,7 +21,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: if_de.c,v 1.6 1994/11/13 12:39:38 davidg Exp $
+ * $Id: if_de.c,v 1.7 1994/11/22 09:47:31 davidg Exp $
*
*/
@@ -394,7 +394,6 @@ tulip_rx_intr(
}
#endif
eh = *(struct ether_header *) bufaddr;
- eh.ether_type = ntohs(eh.ether_type);
#if NBPFILTER > 0
if (sc->tulip_bpf != NULL) {
bpf_tap(sc->tulip_bpf, bufaddr, total_len);
diff --git a/sys/dev/ed/if_ed.c b/sys/dev/ed/if_ed.c
index f67d134bcd49..b9b850325afb 100644
--- a/sys/dev/ed/if_ed.c
+++ b/sys/dev/ed/if_ed.c
@@ -13,7 +13,7 @@
* the SMC Elite Ultra (8216), the 3Com 3c503, the NE1000 and NE2000,
* and a variety of similar clones.
*
- * $Id: if_ed.c,v 1.55 1994/11/13 07:17:46 davidg Exp $
+ * $Id: if_ed.c,v 1.56 1994/11/17 14:42:27 davidg Exp $
*/
#include "ed.h"
@@ -2110,8 +2110,7 @@ ed_get_packet(sc, buf, len, multicast)
len -= sizeof(struct ether_header);
/*
- * Pull packet off interface. Or if this was a trailer packet, the
- * data portion is appended.
+ * Pull packet off interface.
*/
if (ed_ring_to_mbuf(sc, buf, m, len) == NULL) {
m_freem(m);
@@ -2146,11 +2145,6 @@ ed_get_packet(sc, buf, len, multicast)
*/
m_adj(m, sizeof(struct ether_header));
- /*
- * silly ether_input routine needs 'type' in host byte order
- */
- eh->ether_type = ntohs(eh->ether_type);
-
ether_input(&sc->arpcom.ac_if, eh, m);
return;
}
diff --git a/sys/dev/ep/if_ep.c b/sys/dev/ep/if_ep.c
index 95341823f31c..f73c9a65f025 100644
--- a/sys/dev/ep/if_ep.c
+++ b/sys/dev/ep/if_ep.c
@@ -52,10 +52,6 @@
* used while working on this driver and the program that displays this
* information (epstat).
*
- * NB 2: About trailers, I didn't care if this implementation was OK, I just
- * adapted it to have the same behaviour as in the original driver (donne
- * just for epread()).
- *
*
* Some driver statistics can be viewed with the epstat utility. In order to
* use this, you have to compile if_ep.c with
@@ -812,62 +808,7 @@ startagain:
#if NBPFILTER > 0
if (sc->bpf) {
- u_short etype;
- int off, datasize, resid;
- struct ether_header *eh;
- struct trailer_header {
- u_short ether_type;
- u_short ether_residual;
- } trailer_header;
- char ether_packet[ETHER_MAX_LEN];
- char *ep;
-
- ep = ether_packet;
-
- /*
- * We handle trailers below: Copy ether header first, then residual
- * data, then data. Put all this in a temporary buffer 'ether_packet'
- * and send off to bpf. Since the system has generated this packet,
- * we assume that all of the offsets in the packet are correct; if
- * they're not, the system will almost certainly crash in m_copydata.
- * We make no assumptions about how the data is arranged in the mbuf
- * chain (i.e. how much data is in each mbuf, if mbuf clusters are
- * used, etc.), which is why we use m_copydata to get the ether
- * header rather than assume that this is located in the first mbuf.
- */
- /* copy ether header */
- m_copydata(top, 0, sizeof(struct ether_header), ep);
- eh = (struct ether_header *) ep;
- ep += sizeof(struct ether_header);
- eh->ether_type = etype = ntohs(eh->ether_type);
- if (etype >= ETHERTYPE_TRAIL &&
- etype < ETHERTYPE_TRAIL + ETHERTYPE_NTRAILER) {
- datasize = ((etype - ETHERTYPE_TRAIL) << 9);
- off = datasize + sizeof(struct ether_header);
-
- /* copy trailer_header into a data structure */
- m_copydata(top, off, sizeof(struct trailer_header),
- (caddr_t) & trailer_header.ether_type);
-
- /* copy residual data */
- resid = trailer_header.ether_residual -
- sizeof(struct trailer_header);
- resid = ntohs(resid);
- m_copydata(top, off + sizeof(struct trailer_header),
- resid, ep);
- ep += resid;
-
- /* copy data */
- m_copydata(top, sizeof(struct ether_header),
- datasize, ep);
- ep += datasize;
-
- /* restore original ether packet type */
- eh->ether_type = trailer_header.ether_type;
-
- bpf_tap(sc->bpf, ether_packet, ep - ether_packet);
- } else
- bpf_mtap(sc->bpf, top);
+ bpf_mtap(sc->bpf, top);
}
#endif
@@ -998,12 +939,7 @@ epread(sc)
short rx_fifo2, status;
register short delta;
register short rx_fifo;
- u_short etype;
- /*
- * XXX I have just adapted the code for the protocol trailing processing
- * as programed in the original driver. FreeBSD 1.1.5.1 release
- */
status = inw(BASE + EP_W1_RX_STATUS);
read_again:
@@ -1050,34 +986,6 @@ read_again:
top->m_len = sizeof(struct ether_header);
rx_fifo -= sizeof(struct ether_header);
sc->cur_len = rx_fifo2;
-
- /*
- * Test for trailers.
- * I didn't care if this implementation was OK, I just adapted it to
- * have the same behaviour as in the original driver
- */
- eh = mtod(top, struct ether_header *);
- etype = eh->ether_type = ntohs((u_short) eh->ether_type);
- if (etype >= ETHERTYPE_TRAIL &&
- etype < ETHERTYPE_TRAIL + ETHERTYPE_NTRAILER) {
- if ((etype - ETHERTYPE_TRAIL) * 512 >= ETHERMTU)
- goto out;
- m->m_data = m->m_dat; /* Convert back to regular mbuf. */
- m->m_flags = 0; /* This sucks but non-trailers are the norm */
- m->m_data += 2 * sizeof(u_short); /* Get rid of type & len */
-
- sc->cur_len = sizeof(struct ether_header);
- ep_fset(F_RX_TRAILER);
-
- /* in the case of trailers, we prefer to have the packet complete */
- if (status & ERR_RX_INCOMPLETE) {
- ep_frst(F_RX_FIRST);
- outw(BASE + EP_COMMAND, SET_RX_EARLY_THRESH | 2032); /* disable */
- return;
- } else
- /* We don't read the trailer, next we are reading the data */
- rx_fifo -= sizeof(struct ether_header);
- }
} else {
/* come here if we didn't have a complete packet last time */
top = sc->top;
diff --git a/sys/dev/ie/if_ie.c b/sys/dev/ie/if_ie.c
index 6e3fdedef128..ae4998425d32 100644
--- a/sys/dev/ie/if_ie.c
+++ b/sys/dev/ie/if_ie.c
@@ -43,7 +43,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: if_ie.c,v 1.17 1994/10/23 21:27:20 wollman Exp $
+ * $Id: if_ie.c,v 1.18 1994/10/26 00:16:17 phk Exp $
*/
/*
@@ -1231,8 +1231,6 @@ static void ie_readframe(unit, ie, num)
* as a multicast router or when using BPF.
*/
- eh.ether_type = ntohs(eh.ether_type);
-
/*
* Finally pass this packet up to higher layers.
*/
diff --git a/sys/dev/lnc/if_lnc.c b/sys/dev/lnc/if_lnc.c
index ae3dd1ca0a80..311f3bd36d2d 100644
--- a/sys/dev/lnc/if_lnc.c
+++ b/sys/dev/lnc/if_lnc.c
@@ -454,7 +454,6 @@ lnc_rint(int unit)
head->m_pkthdr.rcvif = &sc->arpcom.ac_if;
head->m_pkthdr.len = pkt_len - sizeof(*eh);
eh = (struct ether_header *) head->m_data;
- eh->ether_type = ntohs(eh->ether_type);
head->m_data += sizeof *eh;
head->m_len -= sizeof *eh;