diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2007-05-04 21:51:12 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2007-05-04 21:51:12 +0000 |
commit | a87e87e39151e8faed5ddc66b2b1fca488f1ae1f (patch) | |
tree | b502f74bcc9eeaa14a5a6a4542fdbc757d4d2079 /sys | |
parent | df22bccbe4dda082a723358f43579297259d8caa (diff) |
wrap the wptr round when we hit the end of the fifo.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/pci/if_tht.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/pci/if_tht.c b/sys/dev/pci/if_tht.c index d8bc8a9cc89..a9128d61104 100644 --- a/sys/dev/pci/if_tht.c +++ b/sys/dev/pci/if_tht.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_tht.c,v 1.87 2007/04/30 00:02:12 deraadt Exp $ */ +/* $OpenBSD: if_tht.c,v 1.88 2007/05/04 21:51:11 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -1454,6 +1454,7 @@ tht_fifo_write(struct tht_softc *sc, struct tht_fifo *tf, bcopy(desc, fifo + tf->tf_wptr, buflen); tf->tf_wptr += buflen; + tf->tf_wptr %= tf->tf_len; DPRINTF(THT_D_FIFO, "%s: fifo wr wptr: %d rptr: %d ready: %d\n", DEVNAME(sc), tf->tf_wptr, tf->tf_rptr, tf->tf_ready); |