From 204b3de75b4d54a00a2f90cc602c28362c449045 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fran=C3=A7ois=20Romieu?= Date: Mon, 4 Oct 2004 09:11:20 -0400 Subject: [PATCH] [PATCH] via-velocity: wrong buffer offset in velocity_init_td_ring() 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 --- drivers/net/via-velocity.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index 1af70491c5998..335e6087d9b66 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -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; } -- 2.53.0