make ixp4xx require gpiolib
[openwrt.git] / target / linux / rb532 / patches-2.6.27 / 017-korina_fix_loop_back_rx_desc.patch
1 After the last loop iteration, i has the value RC32434_NUM_RDS and
2 therefore leads to an index overflow when used afterwards to address the
3 last element. This is yet another another bug introduced when rewriting
4 parts of the driver for upstream preparation, as the original driver
5 used 'RC32434_NUM_RDS - 1' instead.
6
7 Signed-off-by: Phil Sutter <n0-1@freewrt.org>
8 ---
9 drivers/net/korina.c | 9 +++++----
10 1 files changed, 5 insertions(+), 4 deletions(-)
11
12 diff --git a/drivers/net/korina.c b/drivers/net/korina.c
13 index 1d6e48e..67fbdf4 100644
14 --- a/drivers/net/korina.c
15 +++ b/drivers/net/korina.c
16 @@ -769,11 +769,12 @@ static void korina_alloc_ring(struct net_device *dev)
17 lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[i+1]);
18 }
19
20 - /* loop back */
21 - lp->rd_ring[i].link = CPHYSADDR(&lp->rd_ring[0]);
22 - lp->rx_next_done = 0;
23 + /* loop back receive descriptors, so the last
24 + * descriptor points to the first one */
25 + lp->rd_ring[i - 1].link = CPHYSADDR(&lp->rd_ring[0]);
26 + lp->rd_ring[i - 1].control |= DMA_DESC_COD;
27
28 - lp->rd_ring[i].control |= DMA_DESC_COD;
29 + lp->rx_next_done = 0;
30 lp->rx_chain_head = 0;
31 lp->rx_chain_tail = 0;
32 lp->rx_chain_status = desc_empty;
33 --
34 1.5.6.4
35
36
This page took 0.040766 seconds and 5 git commands to generate.