[brcm63xx] refresh 2.6.32 patches
[openwrt.git] / target / linux / brcm47xx / patches-2.6.34 / 210-b44_phy_fix.patch
1 --- a/drivers/net/b44.c
2 +++ b/drivers/net/b44.c
3 @@ -384,7 +384,7 @@ static void b44_set_flow_ctrl(struct b44
4 __b44_set_flow_ctrl(bp, pause_enab);
5 }
6
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)
11 {
12 @@ -421,12 +421,40 @@ static inline void b44_wap54g10_workarou
13 }
14 #endif
15
16 +#ifdef CONFIG_SSB_DRIVER_MIPS
17 +static inline int startswith (const char *source, const char *cmp)
18 +{
19 + return !strncmp(source,cmp,strlen(cmp));
20 +}
21 +
22 +#define getvar(str) (nvram_get(str) ? : "")
23 +
24 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
25 +{
26 + /* WL-HDD */
27 + struct ssb_device *sdev = bp->sdev;
28 + if (startswith(getvar("hardware_version"), "WL300-"))
29 + {
30 + if (sdev->bus->sprom.et0phyaddr == 0 &&
31 + sdev->bus->sprom.et1phyaddr == 1)
32 + bp->phy_addr = B44_PHY_ADDR_NO_PHY;
33 + }
34 + return;
35 +}
36 +
37 +#else
38 +static inline void b44_bcm47xx_workarounds(struct b44 *bp)
39 +{
40 +}
41 +#endif
42 +
43 static int b44_setup_phy(struct b44 *bp)
44 {
45 u32 val;
46 int err;
47
48 b44_wap54g10_workaround(bp);
49 + b44_bcm47xx_workarounds(bp);
50
51 if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
52 return 0;
53 @@ -2089,6 +2117,8 @@ static int __devinit b44_get_invariants(
54 * valid PHY address. */
55 bp->phy_addr &= 0x1F;
56
57 + b44_bcm47xx_workarounds(bp);
58 +
59 memcpy(bp->dev->dev_addr, addr, 6);
60
61 if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
This page took 0.044912 seconds and 5 git commands to generate.