1 --- a/drivers/net/b44.c
2 +++ b/drivers/net/b44.c
3 @@ -339,7 +339,7 @@ static int b44_phy_reset(struct b44 *bp)
11 static void __b44_set_flow_ctrl(struct b44 *bp, u32 pause_flags)
12 @@ -384,7 +384,7 @@ static void b44_set_flow_ctrl(struct b44
13 __b44_set_flow_ctrl(bp, pause_enab);
16 -#ifdef SSB_DRIVER_MIPS
17 +#ifdef CONFIG_SSB_DRIVER_MIPS
18 extern char *nvram_get(char *name);
19 static void b44_wap54g10_workaround(struct b44 *bp)
21 @@ -421,12 +421,45 @@ static inline void b44_wap54g10_workarou
25 +#ifdef CONFIG_SSB_DRIVER_MIPS
26 +static inline int startswith (const char *source, const char *cmp)
28 + return !strncmp(source,cmp,strlen(cmp));
31 +#define getvar(str) (nvram_get(str) ? : "")
33 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
35 + /* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */
36 + if (simple_strtoul(getvar("boardnum"), NULL, 0) == 100) {
37 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
40 + struct ssb_device *sdev = bp->sdev;
41 + if (startswith(getvar("hardware_version"), "WL300-"))
43 + if (sdev->bus->sprom.et0phyaddr == 0 &&
44 + sdev->bus->sprom.et1phyaddr == 1)
45 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
52 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
57 static int b44_setup_phy(struct b44 *bp)
62 b44_wap54g10_workaround(bp);
63 + b44_bcm47xx_workarounds(bp);
65 if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
67 @@ -2094,6 +2127,8 @@ static int __devinit b44_get_invariants(
68 * valid PHY address. */
71 + b44_bcm47xx_workarounds(bp);
73 memcpy(bp->dev->dev_addr, addr, 6);
75 if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
76 @@ -2223,6 +2258,10 @@ static int __devinit b44_init_one(struct
78 b44_chip_reset(bp, B44_CHIP_RESET_FULL);
80 + /* do a phy reset to test if there is an active phy */
81 + if (b44_phy_reset(bp) < 0)
82 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
84 printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %pM\n",
85 dev->name, dev->dev_addr);