diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-10-20 23:31:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-10-20 23:31:07 +0000 |
commit | 9d2446138e1775917e00191055e258277dab9083 (patch) | |
tree | 3c8e7b27cbc75face0bfdcdcadaf21ed4bcb186a /sys | |
parent | 7d69d9e8dcb71df541eacc102a39aa1266129906 (diff) |
when transmitting we cannot totally fill the circular buffer (i.e.
we can't use up all of the remaining sc->txslot[chan].bfree free
bytes) because that would cause the circular buffer read pointer
to become equal to the write pointer, thus signaling 'empty buffer'
to the hardware and stopping the transmitter. spotted and fixed
by Kenjiro Cho <kjc@csl.sony.co.jp>
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/midway.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/ic/midway.c b/sys/dev/ic/midway.c index 0eb366c7804..a8040898b3b 100644 --- a/sys/dev/ic/midway.c +++ b/sys/dev/ic/midway.c @@ -1,4 +1,4 @@ -/* $OpenBSD: midway.c,v 1.21 1997/09/29 17:45:58 chuck Exp $ */ +/* $OpenBSD: midway.c,v 1.22 1998/10/20 23:31:06 deraadt Exp $ */ /* (sync'd to midway.c 1.68) */ /* @@ -1861,7 +1861,14 @@ again: goto dequeue_drop; } - if (launch.need > sc->txslot[chan].bfree) { + /* + * note: note that we cannot totally fill the circular buffer (i.e. + * we can't use up all of the remaining sc->txslot[chan].bfree free + * bytes) because that would cause the circular buffer read pointer + * to become equal to the write pointer, thus signaling 'empty buffer' + * to the hardware and stopping the transmitter. + */ + if (launch.need >= sc->txslot[chan].bfree) { EN_COUNT(sc->txoutspace); #ifdef EN_DEBUG printf("%s: tx%d: out of transmit space\n", sc->sc_dev.dv_xname, chan); |