Grrrr... The RealTek 8139 is yet another chip that includes the ethernet

CRC in received frames, which we need to trim manually.
This commit is contained in:
Bill Paul 1998-12-24 18:39:48 +00:00
parent 0d5ad2d7ff
commit 1b2d762ecc
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=42051

View file

@ -29,7 +29,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: if_rl.c,v 1.6 1998/12/10 19:02:07 wpaul Exp $
* $Id: if_rl.c,v 1.7 1998/12/14 06:32:55 dillon Exp $
*/
/*
@ -127,7 +127,7 @@
#ifndef lint
static const char rcsid[] =
"$Id: if_rl.c,v 1.6 1998/12/10 19:02:07 wpaul Exp $";
"$Id: if_rl.c,v 1.7 1998/12/14 06:32:55 dillon Exp $";
#endif
/*
@ -1328,6 +1328,15 @@ static void rl_rxeof(sc)
total_len = rxstat >> 16;
rx_bytes += total_len + 4;
/*
* XXX The RealTek chip includes the CRC with every
* received frame, and there's no way to turn this
* behavior off (at least, I can't find anything in
* the manual that explains how to do it) so we have
* to trim off the CRC manually.
*/
total_len -= ETHER_CRC_LEN;
/*
* Avoid trying to read more bytes than we know
* the chip has prepared for us.
@ -1353,7 +1362,7 @@ static void rl_rxeof(sc)
else
m_copyback(m, wrap, total_len - wrap,
sc->rl_cdata.rl_rx_buf);
cur_rx = (total_len - wrap);
cur_rx = (total_len - wrap + ETHER_CRC_LEN);
} else {
m = m_devget(rxbufpos, total_len, 0, ifp, NULL);
if (m == NULL) {
@ -1361,7 +1370,7 @@ static void rl_rxeof(sc)
printf("rl%d: out of mbufs, tried to "
"copy %d bytes\n", sc->rl_unit, total_len);
}
cur_rx += total_len + 4;
cur_rx += total_len + 4 + ETHER_CRC_LEN;
}
/*