]> git.hungrycats.org Git - linux/commitdiff
[PATCH] via-velocity: wrong buffer offset in velocity_init_td_ring()
authorFrançois Romieu <romieu@fr.zoreil.com>
Mon, 4 Oct 2004 13:11:20 +0000 (09:11 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Mon, 4 Oct 2004 13:11:20 +0000 (09:11 -0400)
Buffer offset calculation was incorrect in velocity_init_td_ring().
This didn't cause any trouble because we only use the first td ring.

Signed-off-by: Tejun Heo <tj@home-tj.org>
drivers/net/via-velocity.c

index 1af70491c5998439585bd2562f9b8274d0366f36..335e6087d9b66623b46a3a576d6872cc1ea4f5ca 100644 (file)
@@ -1156,8 +1156,10 @@ static int velocity_init_td_ring(struct velocity_info *vptr)
                for (i = 0; i < vptr->options.numtx; i++, curr += sizeof(struct tx_desc)) {
                        td = &(vptr->td_rings[j][i]);
                        td_info = &(vptr->td_infos[j][i]);
-                       td_info->buf = vptr->tx_bufs + (i + j) * PKT_BUF_SZ;
-                       td_info->buf_dma = vptr->tx_bufs_dma + (i + j) * PKT_BUF_SZ;
+                       td_info->buf = vptr->tx_bufs +
+                               (j * vptr->options.numtx + i) * PKT_BUF_SZ;
+                       td_info->buf_dma = vptr->tx_bufs_dma +
+                               (j * vptr->options.numtx + i) * PKT_BUF_SZ;
                }
                vptr->td_tail[j] = vptr->td_curr[j] = vptr->td_used[j] = 0;
        }