brcm47xx: remove support for kernel 2.6.39
[openwrt.git] / target / linux / leon / patches / 022-greth_avoid_bad_speed_duplex.patch
1 From c2e963057ca5635d6e5387623c3ad0c0b3123754 Mon Sep 17 00:00:00 2001
2 From: Daniel Hellstrom <daniel@gaisler.com>
3 Date: Wed, 1 Dec 2010 10:28:37 +0100
4 Subject: [PATCH] GRETH: avoid writing bad speed/duplex when setting transfer mode
5
6 Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
7 ---
8 drivers/net/greth.c | 19 ++++++++-----------
9 1 files changed, 8 insertions(+), 11 deletions(-)
10
11 --- a/drivers/net/greth.c
12 +++ b/drivers/net/greth.c
13 @@ -1236,29 +1236,26 @@ static void greth_link_change(struct net
14 struct greth_private *greth = netdev_priv(dev);
15 struct phy_device *phydev = greth->phy;
16 unsigned long flags;
17 -
18 int status_change = 0;
19 + u32 ctrl;
20
21 spin_lock_irqsave(&greth->devlock, flags);
22
23 if (phydev->link) {
24
25 if ((greth->speed != phydev->speed) || (greth->duplex != phydev->duplex)) {
26 -
27 - GRETH_REGANDIN(greth->regs->control,
28 - ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB));
29 + ctrl = GRETH_REGLOAD(greth->regs->control) &
30 + ~(GRETH_CTRL_FD | GRETH_CTRL_SP | GRETH_CTRL_GB);
31
32 if (phydev->duplex)
33 - GRETH_REGORIN(greth->regs->control, GRETH_CTRL_FD);
34 -
35 - if (phydev->speed == SPEED_100) {
36 -
37 - GRETH_REGORIN(greth->regs->control, GRETH_CTRL_SP);
38 - }
39 + ctrl |= GRETH_CTRL_FD;
40
41 + if (phydev->speed == SPEED_100)
42 + ctrl |= GRETH_CTRL_SP;
43 else if (phydev->speed == SPEED_1000)
44 - GRETH_REGORIN(greth->regs->control, GRETH_CTRL_GB);
45 + ctrl |= GRETH_CTRL_GB;
46
47 + GRETH_REGSAVE(greth->regs->control, ctrl);
48 greth->speed = phydev->speed;
49 greth->duplex = phydev->duplex;
50 status_change = 1;
This page took 0.042772 seconds and 5 git commands to generate.