add modified b44 fixes based on #205 to brcm-2.6

SVN-Revision: 2953
This commit is contained in:
Felix Fietkau 2006-01-13 16:36:33 +00:00
parent deeb524213
commit 604fdbb932

View File

@ -1,6 +1,6 @@
diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
--- orig/linux-2.6.15/drivers/net/b44.c 2006-01-03 04:21:10.000000000 +0100
+++ linux-2.6.15/drivers/net/b44.c 2006-01-12 12:22:58.760883688 +0100
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-13 17:30:08.283122500 +0100
@@ -1,7 +1,9 @@
-/* b44.c: Broadcom 4400 device driver.
+/* b44.c: Broadcom 4400/47xx device driver.
@ -156,38 +156,26 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
err = b44_writephy(bp, MII_BMCR, BMCR_RESET);
if (err)
return err;
@@ -439,6 +478,30 @@
@@ -439,6 +478,18 @@
u32 val;
int err;
+#ifdef CONFIG_BCM947XX
+ if (bp->pdev->device == PCI_DEVICE_ID_BCM4713) {
+ /*
+ * workaround for bad hardware design in Linksys WAP54G v1.0
+ * see https://dev.openwrt.org/ticket/146
+ * check and reset bit "isolate"
+ */
+ if (!strcmp(nvram_get("boardnum"), "2\r")) {
+ u32 val;
+ if (__b44_readphy(bp, 0, MII_BMCR, &val) != 0) {
+ printk(KERN_WARNING PFX "%s: PHY WAP54G: cannot access PHY.\n",
+ bp->dev->name);
+ } else if (val & BMCR_ISOLATE) {
+ printk(KERN_INFO PFX "%s: PHY WAP54G: resetting isolate bit.\n",
+ bp->dev->name);
+ if (__b44_writephy(bp, 0, MII_BMCR, val & ~BMCR_ISOLATE) != 0)
+ printk(KERN_WARNING PFX "PHY WAP54G: cannot reset isolate bit.\n");
+ }
+ }
+ 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 +597,19 @@
@@ -534,6 +585,19 @@
{
u32 bmsr, aux;
@ -207,7 +195,7 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
if (!b44_readphy(bp, MII_BMSR, &bmsr) &&
!b44_readphy(bp, B44_MII_AUXCTRL, &aux) &&
(bmsr != 0xffff)) {
@@ -1281,9 +1357,10 @@
@@ -1281,9 +1345,10 @@
bw32(bp, B44_DMARX_CTRL, 0);
bp->rx_prod = bp->rx_cons = 0;
} else {
@ -221,7 +209,7 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
}
ssb_core_reset(bp);
@@ -1291,8 +1368,14 @@
@@ -1291,8 +1356,14 @@
b44_clear_stats(bp);
/* Make PHY accessible. */
@ -237,7 +225,7 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
br32(bp, B44_MDIO_CTRL);
if (!(br32(bp, B44_DEVCTRL) & DEVCTRL_IPP)) {
@@ -1834,18 +1917,297 @@
@@ -1834,18 +1905,297 @@
.get_perm_addr = ethtool_op_get_perm_addr,
};
@ -539,7 +527,7 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
out:
return err;
}
@@ -1865,22 +2227,43 @@
@@ -1865,22 +2215,43 @@
static int __devinit b44_get_invariants(struct b44 *bp)
{
u8 eeprom[128];
@ -597,7 +585,7 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/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 +2272,7 @@
@@ -1889,11 +2260,7 @@
bp->imask = IMASK_DEF;
bp->core_unit = ssb_core_unit(bp);
@ -609,7 +597,7 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
out:
return err;
}
@@ -2032,11 +2411,17 @@
@@ -2032,11 +2399,17 @@
pci_save_state(bp->pdev);
@ -628,9 +616,9 @@ diff -urN orig/linux-2.6.15/drivers/net/b44.c linux-2.6.15/drivers/net/b44.c
return 0;
err_out_iounmap:
diff -urN orig/linux-2.6.15/drivers/net/b44.h linux-2.6.15/drivers/net/b44.h
--- orig/linux-2.6.15/drivers/net/b44.h 2006-01-03 04:21:10.000000000 +0100
+++ linux-2.6.15/drivers/net/b44.h 2006-01-12 12:16:02.403179680 +0100
diff -urN linux.old/drivers/net/b44.h linux.dev/drivers/net/b44.h
--- linux.old/drivers/net/b44.h 2006-01-12 01:44:42.548326000 +0100
+++ linux.dev/drivers/net/b44.h 2006-01-12 02:55:06.290783500 +0100
@@ -292,6 +292,10 @@
#define SSB_PCI_MASK1 0xfc000000
#define SSB_PCI_MASK2 0xc0000000