diff options
author | wpaul <wpaul@FreeBSD.org> | 1998-12-24 18:39:48 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 1998-12-24 18:39:48 +0000 |
commit | 4959cd39d9b008523e31c2d2003cb1f44757d378 (patch) | |
tree | f2ae6edc627296ce52a5694c05a0969ec1a1e4a0 /sys/pci/if_rl.c | |
parent | 1c3fec22d8c0ca330768a27aa4547289b2c8f33e (diff) | |
download | FreeBSD-src-4959cd39d9b008523e31c2d2003cb1f44757d378.zip FreeBSD-src-4959cd39d9b008523e31c2d2003cb1f44757d378.tar.gz |
Grrrr... The RealTek 8139 is yet another chip that includes the ethernet
CRC in received frames, which we need to trim manually.
Diffstat (limited to 'sys/pci/if_rl.c')
-rw-r--r-- | sys/pci/if_rl.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index abd73a8..aeabbd0 100644 --- a/sys/pci/if_rl.c +++ b/sys/pci/if_rl.c @@ -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 /* @@ -1329,6 +1329,15 @@ static void rl_rxeof(sc) 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; } /* |