pasemi_mac: Fix TX ring wrap checking

The old logic didn't detect full (tx) ring cases properly, causing
overruns and general badness. Clean it up a bit and abstract out the
ring size checks, always making sure to leave 1 slot open.

Signed-off-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Olof Johansson
2007-08-22 09:13:11 -05:00
committed by David S. Miller
parent 02df6cfa09
commit 021fa22e01
2 changed files with 15 additions and 12 deletions

View File

@@ -31,7 +31,7 @@ struct pasemi_mac_txring {
struct pas_dma_xct_descr *desc;
dma_addr_t dma;
unsigned int size;
unsigned int next_to_use;
unsigned int next_to_fill;
unsigned int next_to_clean;
struct pasemi_mac_buffer *desc_info;
char irq_name[10]; /* "eth%d tx" */