Eliminate use of M_HASFCS.

This commit is contained in:
thorpej 2005-01-30 17:23:45 +00:00
parent 6390d0aeca
commit 586d85d4f2
2 changed files with 10 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: smc83c170.c,v 1.56 2004/10/30 18:08:40 thorpej Exp $ */ /* $NetBSD: smc83c170.c,v 1.57 2005/01/30 17:23:45 thorpej Exp $ */
/*- /*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc. * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.56 2004/10/30 18:08:40 thorpej Exp $"); __KERNEL_RCSID(0, "$NetBSD: smc83c170.c,v 1.57 2005/01/30 17:23:45 thorpej Exp $");
#include "bpfilter.h" #include "bpfilter.h"
@ -678,9 +678,10 @@ epic_intr(arg)
ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD); ds->ds_dmamap->dm_mapsize, BUS_DMASYNC_POSTREAD);
/* /*
* The EPIC includes the CRC with every packet. * The EPIC includes the CRC with every packet;
* trim it.
*/ */
len = RXSTAT_RXLENGTH(rxstatus); len = RXSTAT_RXLENGTH(rxstatus) - ETHER_CRC_LEN;
if (len < sizeof(struct ether_header)) { if (len < sizeof(struct ether_header)) {
/* /*
@ -729,7 +730,6 @@ epic_intr(arg)
} }
} }
m->m_flags |= M_HASFCS;
m->m_pkthdr.rcvif = ifp; m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.len = m->m_len = len;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tulip.c,v 1.130 2004/12/11 09:31:42 sketch Exp $ */ /* $NetBSD: tulip.c,v 1.131 2005/01/30 17:27:38 thorpej Exp $ */
/*- /*-
* Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc. * Copyright (c) 1998, 1999, 2000, 2002 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.130 2004/12/11 09:31:42 sketch Exp $"); __KERNEL_RCSID(0, "$NetBSD: tulip.c,v 1.131 2005/01/30 17:27:38 thorpej Exp $");
#include "bpfilter.h" #include "bpfilter.h"
@ -1303,7 +1303,7 @@ tlp_rxintr(sc)
* No errors; receive the packet. Note the Tulip * No errors; receive the packet. Note the Tulip
* includes the CRC with every packet. * includes the CRC with every packet.
*/ */
len = TDSTAT_Rx_LENGTH(rxstat); len = TDSTAT_Rx_LENGTH(rxstat) - ETHER_CRC_LEN;
#ifdef __NO_STRICT_ALIGNMENT #ifdef __NO_STRICT_ALIGNMENT
/* /*
@ -1359,7 +1359,6 @@ tlp_rxintr(sc)
ifp->if_ipackets++; ifp->if_ipackets++;
eh = mtod(m, struct ether_header *); eh = mtod(m, struct ether_header *);
m->m_flags |= M_HASFCS;
m->m_pkthdr.rcvif = ifp; m->m_pkthdr.rcvif = ifp;
m->m_pkthdr.len = m->m_len = len; m->m_pkthdr.len = m->m_len = len;
@ -1378,10 +1377,9 @@ tlp_rxintr(sc)
if (__predict_false((sc->sc_flags & TULIPF_VPC) != 0)) { if (__predict_false((sc->sc_flags & TULIPF_VPC) != 0)) {
uint16_t etype = ntohs(eh->ether_type); uint16_t etype = ntohs(eh->ether_type);
if (len > ETHER_MAX_FRAME(ifp, etype, if (len > ETHER_MAX_FRAME(ifp, etype, 0))
M_HASFCS))
m->m_pkthdr.len = m->m_len = len = m->m_pkthdr.len = m->m_len = len =
ETHER_MAX_FRAME(ifp, etype, M_HASFCS); ETHER_MAX_FRAME(ifp, etype, 0);
} }
#if NBPFILTER > 0 #if NBPFILTER > 0