1 --- drivers/net/b44.c.orig 2010-04-18 08:40:30.000000000 +0300
2 +++ drivers/net/b44.c 2010-04-18 10:53:47.000000000 +0300
4 __b44_set_flow_ctrl(bp, pause_enab);
7 -#ifdef SSB_DRIVER_MIPS
8 +#ifdef CONFIG_SSB_DRIVER_MIPS
9 extern char *nvram_get(char *name);
10 static void b44_wap54g10_workaround(struct b44 *bp)
13 * see https://dev.openwrt.org/ticket/146
14 * check and reset bit "isolate"
17 str = nvram_get("boardnum");
24 +#ifdef CONFIG_SSB_DRIVER_MIPS
25 +static inline int startswith (const char *source, const char *cmp)
27 + return !strncmp(source,cmp,strlen(cmp));
30 +#define getvar(str) (nvram_get(str) ? : "")
32 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
35 + * workaround for physical wiring in Linksys WRSL54GS
36 + * see https://dev.openwrt.org/ticket/2662 and 3903
37 + * eth1 PHY is probably on BCM5325 switch accessed via eth0
40 + if (simple_strtoul(getvar("boardnum"), NULL, 0) == 42) {
41 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
44 + struct ssb_device *sdev = bp->sdev;
45 + if (startswith(getvar("hardware_version"), "WL300-")) {
46 + if (sdev->bus->sprom.et0phyaddr == 0 &&
47 + sdev->bus->sprom.et1phyaddr == 1)
48 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
55 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
60 static int b44_setup_phy(struct b44 *bp)
65 b44_wap54g10_workaround(bp);
66 + b44_bcm47xx_workarounds(bp);
68 if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
71 * valid PHY address. */
74 + b44_bcm47xx_workarounds(bp);
76 memcpy(bp->dev->dev_addr, addr, 6);
78 if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){