diff --git a/sys/pci/if_rl.c b/sys/pci/if_rl.c index abd73a8dabc..aeabbd0e9f9 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 /* @@ -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; } /*