提交 b06c093e 编写于 作者: J John W. Linville 提交者: Jeff Garzik

[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: NJohn W. Linville <linville@tuxdriver.com>
Signed-off-by: NJeff Garzik <jgarzik@pobox.com>
上级 74b0247f
...@@ -609,16 +609,17 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, ...@@ -609,16 +609,17 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
np->phys[0] = 1; /* Default setting */ np->phys[0] = 1; /* Default setting */
np->mii_preamble_required++; 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 mii_status = mdio_read(dev, phy, MII_BMSR);
int phyx = phy & 0x1f;
if (mii_status != 0xffff && mii_status != 0x0000) { if (mii_status != 0xffff && mii_status != 0x0000) {
np->phys[phy_idx++] = phy; np->phys[phy_idx++] = phyx;
np->mii_if.advertising = mdio_read(dev, phy, MII_ADVERTISE); np->mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE);
if ((mii_status & 0x0040) == 0) if ((mii_status & 0x0040) == 0)
np->mii_preamble_required++; np->mii_preamble_required++;
printk(KERN_INFO "%s: MII PHY found at address %d, status " printk(KERN_INFO "%s: MII PHY found at address %d, status "
"0x%4.4x advertising %4.4x.\n", "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--; np->mii_preamble_required--;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册