add modified b44 fixes based on #205 to brcm-2.6
[openwrt/svn-archive/archive.git] / openwrt / target / linux / brcm-2.6 / patches / 004-b44_bcm47xx_support.patch
index e1856f9d70f8421a5f5cf5c2798753e7c9c17fc2..01f75755d4c3b9e5d09773dc5c2c90b7cbbb1465 100644 (file)
@@ -1,6 +1,6 @@
 diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
 --- linux.old/drivers/net/b44.c        2006-01-12 01:44:42.548326000 +0100
-+++ linux.dev/drivers/net/b44.c        2006-01-12 03:07:38.209775500 +0100
++++ linux.dev/drivers/net/b44.c        2006-01-13 17:30:08.283122500 +0100
 @@ -1,7 +1,9 @@
 -/* b44.c: Broadcom 4400 device driver.
 +/* b44.c: Broadcom 4400/47xx device driver.
@@ -156,16 +156,26 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
        err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
        if (err)
                return err;
-@@ -439,6 +478,8 @@
+@@ -439,6 +478,18 @@
        u32 val;
        int err;
  
++#ifdef CONFIG_BCM947XX
++      char *s;
++      if ((s = nvram_get("boardnum")) && (s != NULL) && \
++                      !strncmp(s, "2", 1) && \
++                      (__b44_readphy(bp, 0, MII_BMCR, &val) != 0) && \
++                      (val & BMCR_ISOLATE) && \
++                      (__b44_writephy(bp, 0, MII_BMCR, val & ~BMCR_ISOLATE) != 0)) {
++              printk(KERN_WARNING PFX "PHY: cannot reset MII transceiver isolate bit.\n");
++      }
++#endif
 +      if (bp->phy_addr == B44_PHY_ADDR_NO_PHY)
 +              return 0;
        if ((err = b44_readphy(bp, B44_MII_ALEDCTRL, &val)) != 0)
                goto out;
        if ((err = b44_writephy(bp, B44_MII_ALEDCTRL,
-@@ -534,6 +575,19 @@
+@@ -534,6 +585,19 @@
  {
        u32 bmsr, aux;
  
@@ -185,7 +195,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
        if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
            !b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
            (bmsr != 0xffff)) {
-@@ -1281,9 +1335,10 @@
+@@ -1281,9 +1345,10 @@
                bw32(bp, B44_DMARX_CTRL, 0);
                bp->rx_prod = bp->rx_cons = 0;
        } else {
@@ -199,7 +209,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
        }
  
        ssb_core_reset(bp);
-@@ -1291,8 +1346,14 @@
+@@ -1291,8 +1356,14 @@
        b44_clear_stats(bp);
  
        /* Make PHY accessible. */
@@ -215,7 +225,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
        br32(bp, B44_MDIO_CTRL);
  
        if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
-@@ -1834,18 +1895,297 @@
+@@ -1834,18 +1905,297 @@
        .get_perm_addr          = ethtool_op_get_perm_addr,
  };
  
@@ -517,7 +527,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
  out:
        return err;
  }
-@@ -1865,22 +2205,43 @@
+@@ -1865,22 +2215,43 @@
  static int __devinit b44_get_invariants(struct b44 *bp)
  {
        u8 eeprom[128];
@@ -575,7 +585,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
        /* With this, plus the rx_header prepended to the data by the
         * hardware, we'll land the ethernet header on a 2-byte boundary.
         */
-@@ -1889,11 +2250,7 @@
+@@ -1889,11 +2260,7 @@
        bp->imask = IMASK_DEF;
  
        bp->core_unit = ssb_core_unit(bp);
@@ -587,7 +597,7 @@ diff -urN linux.old/drivers/net/b44.c linux.dev/drivers/net/b44.c
  out:
        return err;
  }
-@@ -2032,11 +2389,17 @@
+@@ -2032,11 +2399,17 @@
  
        pci_save_state(bp->pdev);