aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2009-01-08 11:01:58 -0800
committerDavid S. Miller <davem@davemloft.net>2009-01-08 11:01:58 -0800
commit84314bf92265bccea601ed75ec93944e1a36dd81 (patch)
tree093a10ce34f302eaa0684d40688b049167e84a5c /drivers/net/r6040.c
parentr6040: make printks consistent with DRV_NAME (diff)
downloadlinux-dev-84314bf92265bccea601ed75ec93944e1a36dd81.tar.xz
linux-dev-84314bf92265bccea601ed75ec93944e1a36dd81.zip
r6040: check PHY status when bringing interface up
This patch makes the driver properly initialize the PHY status if not correctly set by the bootloader/BIOS. It prevents some boards to bring up the link on boot. Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 92b14c871351..7ac6fede6e6d 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -1121,6 +1121,10 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
err = -EIO;
goto err_out_free_res;
}
+ /* If PHY status change register is still set to zero it means the
+ * bootloader didn't initialize it */
+ if (ioread16(ioaddr + PHY_CC) == 0)
+ iowrite16(0x9f07, ioaddr + PHY_CC);
/* Init system & device */
lp->base = ioaddr;