summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2005-10-19 16:07:34 +0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-20 18:05:36 +0400
commitb06c093ed2dc968b3c140dafa55fa6c7b72169e5 (patch)
tree1452c7664692586d65d0a8bfc17cd3b75936d0eb /drivers
parent74b0247fbd4b6ed1693a420d85cf50267d840ef4 (diff)
downloadlinux-b06c093ed2dc968b3c140dafa55fa6c7b72169e5.tar.xz
[PATCH] sundance: include MII address 0 in PHY probe
Include MII address 0 at the end of the PHY scan. This covers the entire range of possible MII addresses. Signed-off-by: John W. Linville <linville@tuxdriver.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sundance.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index d8a7e08cab2b..5de0554fd7c6 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -609,16 +609,17 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
np->phys[0] = 1; /* Default setting */
np->mii_preamble_required++;
- for (phy = 1; phy < 32 && phy_idx < MII_CNT; phy++) {
+ for (phy = 1; phy <= 32 && phy_idx < MII_CNT; phy++) {
int mii_status = mdio_read(dev, phy, MII_BMSR);
+ int phyx = phy & 0x1f;
if (mii_status != 0xffff && mii_status != 0x0000) {
- np->phys[phy_idx++] = phy;
- np->mii_if.advertising = mdio_read(dev, phy, MII_ADVERTISE);
+ np->phys[phy_idx++] = phyx;
+ np->mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE);
if ((mii_status & 0x0040) == 0)
np->mii_preamble_required++;
printk(KERN_INFO "%s: MII PHY found at address %d, status "
"0x%4.4x advertising %4.4x.\n",
- dev->name, phy, mii_status, np->mii_if.advertising);
+ dev->name, phyx, mii_status, np->mii_if.advertising);
}
}
np->mii_preamble_required--;