turn the wrtsl54gs workaround into a more generic fix and reduce the chance of it...
[openwrt-10.03/.git] / target / linux / brcm47xx / patches-2.6.25 / 210-b44_phy_fix.patch
1 Index: linux-2.6.25.17/drivers/net/b44.c
2 ===================================================================
3 --- linux-2.6.25.17.orig/drivers/net/b44.c      2008-10-16 23:13:19.000000000 +0200
4 +++ linux-2.6.25.17/drivers/net/b44.c   2008-11-02 12:13:38.000000000 +0100
5 @@ -339,7 +339,7 @@ static int b44_phy_reset(struct b44 *bp)
6                 }
7         }
8  
9 -       return 0;
10 +       return err;
11  }
12  
13  static void __b44_set_flow_ctrl(struct b44 *bp, u32 pause_flags)
14 @@ -384,7 +384,7 @@ static void b44_set_flow_ctrl(struct b44
15         __b44_set_flow_ctrl(bp, pause_enab);
16  }
17  
18 -#ifdef SSB_DRIVER_MIPS
19 +#ifdef CONFIG_SSB_DRIVER_MIPS
20  extern char *nvram_get(char *name);
21  static void b44_wap54g10_workaround(struct b44 *bp)
22  {
23 @@ -2211,6 +2211,10 @@ static int __devinit b44_init_one(struct
24          */
25         b44_chip_reset(bp, B44_CHIP_RESET_FULL);
26  
27 +       /* do a phy reset to test if there is an active phy */
28 +       if (b44_phy_reset(bp) < 0)
29 +               bp->phy_addr = B44_PHY_ADDR_NO_PHY;
30 +
31         printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %s\n",
32                dev->name, print_mac(mac, dev->dev_addr));
33