1 --- a/drivers/net/b44.c
2 +++ b/drivers/net/b44.c
3 @@ -381,11 +381,12 @@ static void b44_set_flow_ctrl(struct b44
4 __b44_set_flow_ctrl(bp, pause_enab);
7 -#ifdef SSB_DRIVER_MIPS
8 -extern char *nvram_get(char *name);
11 +#include <asm/mach-bcm47xx/nvram.h>
12 static void b44_wap54g10_workaround(struct b44 *bp)
19 @@ -394,10 +395,9 @@ static void b44_wap54g10_workaround(stru
20 * see https://dev.openwrt.org/ticket/146
21 * check and reset bit "isolate"
23 - str = nvram_get("boardnum");
25 + if (nvram_getenv("boardnum", buf, sizeof(buf)) > 0)
27 - if (simple_strtoul(str, NULL, 0) == 2) {
28 + if (simple_strtoul(buf, NULL, 0) == 2) {
29 err = __b44_readphy(bp, 0, MII_BMCR, &val);
32 @@ -412,10 +412,43 @@ static void b44_wap54g10_workaround(stru
34 pr_warning("PHY: cannot reset MII transceiver isolate bit\n");
37 +static inline int startswith (const char *source, const char *cmp)
39 + return !strncmp(source,cmp,strlen(cmp));
42 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
45 + /* Toshiba WRC-1000, Siemens SE505 v1, Askey RT-210W, RT-220W */
46 + if (nvram_getenv("boardnum", buf, sizeof(buf)) > 0)
48 + if (simple_strtoul(buf, NULL, 0) == 100) {
49 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
52 + struct ssb_device *sdev = bp->sdev;
53 + if (nvram_getenv("hardware_version", buf, sizeof(buf)) > 0)
55 + if (startswith(buf, "WL300-")) {
56 + if (sdev->bus->sprom.et0phyaddr == 0 &&
57 + sdev->bus->sprom.et1phyaddr == 1)
58 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
66 static inline void b44_wap54g10_workaround(struct b44 *bp)
70 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
75 static int b44_setup_phy(struct b44 *bp)
76 @@ -424,6 +457,7 @@ static int b44_setup_phy(struct b44 *bp)
79 b44_wap54g10_workaround(bp);
80 + b44_bcm47xx_workarounds(bp);
82 if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
84 @@ -2080,6 +2114,8 @@ static int __devinit b44_get_invariants(
85 * valid PHY address. */
88 + b44_bcm47xx_workarounds(bp);
90 memcpy(bp->dev->dev_addr, addr, 6);
92 if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){