bgmac: simplify tx ring index handling

Keep incrementing ring->start and ring->end instead of pointing it to
the actual ring slot entry. This simplifies the calculation of the
number of free slots.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Felix Fietkau
2015-04-14 12:07:54 +02:00
committed by David S. Miller
parent e07678341b
commit b38c83dd08
2 changed files with 23 additions and 29 deletions

View File

@@ -414,10 +414,10 @@ enum bgmac_dma_ring_type {
* empty.
*/
struct bgmac_dma_ring {
u16 num_slots;
u16 start;
u16 end;
u32 start;
u32 end;
u16 num_slots;
u16 mmio_base;
struct bgmac_dma_desc *cpu_base;
dma_addr_t dma_base;