From 9dfd4ffcb0c353ada8a47fb6577d8825e874ecae Mon Sep 17 00:00:00 2001 From: mjf Date: Sun, 6 Apr 2008 23:21:01 +0000 Subject: [PATCH] Prevent packet header from being placed outside the TXD buffer. This should stop the "mismatched status and packet" error messages that have been plaguing the EeePC. Fix provided by Joel Sing, thanks! --- sys/dev/pci/if_lii.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/pci/if_lii.c b/sys/dev/pci/if_lii.c index f8ac432172da..cc8b9fe21cdf 100644 --- a/sys/dev/pci/if_lii.c +++ b/sys/dev/pci/if_lii.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_lii.c,v 1.2 2008/03/31 14:30:58 mjf Exp $ */ +/* $NetBSD: if_lii.c,v 1.3 2008/04/06 23:21:01 mjf Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.2 2008/03/31 14:30:58 mjf Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_lii.c,v 1.3 2008/04/06 23:21:01 mjf Exp $"); #include "bpfilter.h" @@ -830,7 +830,7 @@ lii_tx_put(struct lii_softc *sc, struct mbuf *m) } /* Round to a 32-bit boundary */ - sc->sc_txd_cur = (sc->sc_txd_cur + 3) & ~3; + sc->sc_txd_cur = ((sc->sc_txd_cur + 3) & ~3) % AT_TXD_BUFFER_SIZE; if (sc->sc_txd_cur == sc->sc_txd_ack) sc->sc_free_tx_slots = false; }