提交 6a2fe983 编写于 作者: P Phil Sutter 提交者: David S. Miller

korina: fix loop back of receive descriptors

After the last loop iteration, i has the value RC32434_NUM_RDS and
therefore leads to an index overflow when used afterwards to address the
last element. This is yet another another bug introduced when rewriting
parts of the driver for upstream preparation, as the original driver
used 'RC32434_NUM_RDS - 1' instead.
Signed-off-by: NPhil Sutter <n0-1@freewrt.org>
Acked-by: NFlorian Fainelli <florian@openwrt.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 eed087e3
......@@ -769,11 +769,12 @@ static void korina_alloc_ring(struct net_device *dev)
lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
}
/* loop back */
lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[0]);
lp->rx_next_done = 0;
/* loop back receive descriptors, so the last
* descriptor points to the first one */
lp->rd_ring[i - 1].link = CPHYSADDR(&lp->rd_ring[0]);
lp->rd_ring[i - 1].control |= DMA_DESC_COD;
lp->rd_ring[i].control |= DMA_DESC_COD;
lp->rx_next_done = 0;
lp->rx_chain_head = 0;
lp->rx_chain_tail = 0;
lp->rx_chain_status = desc_empty;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册