Commit 204b3de7 authored by François Romieu's avatar François Romieu Committed by Jeff Garzik

[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: default avatarTejun Heo <tj@home-tj.org>
parent 1e62860a
...@@ -1156,8 +1156,10 @@ static int velocity_init_td_ring(struct velocity_info *vptr) ...@@ -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)) { for (i = 0; i < vptr->options.numtx; i++, curr += sizeof(struct tx_desc)) {
td = &(vptr->td_rings[j][i]); td = &(vptr->td_rings[j][i]);
td_info = &(vptr->td_infos[j][i]); td_info = &(vptr->td_infos[j][i]);
td_info->buf = vptr->tx_bufs + (i + j) * PKT_BUF_SZ; td_info->buf = vptr->tx_bufs +
td_info->buf_dma = vptr->tx_bufs_dma + (i + j) * PKT_BUF_SZ; (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; vptr->td_tail[j] = vptr->td_curr[j] = vptr->td_used[j] = 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment