aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2006-01-26 22:01:38 -0500
committerJeff Garzik <jgarzik@pobox.com>2006-01-26 22:01:38 -0500
commit0d615ec2bb1cb8c38087bb24f6d2876dec3a9751 (patch)
tree6fd87eb05df5fd4f8a898680487f0955fd2bd39f /drivers/net
parent3ee68c4af3fd7228c1be63254b9f884614f9ebb2 (diff)
sundance: Really read addr 0
Make phy 0 actually be read, as it is not being right now as we have: int mii_status = mdio_read(dev, phy, MII_BMSR); int phyx = phy & 0x1f; When we should have instead: int phyx = phy & 0x1f; int mii_status = mdio_read(dev, phyx, MII_BMSR); so that when phy, in the end of the (phy = 1; phy <= 32...) loop gets to 32 phyx gets to 0, i.e. we were reading at 32, when the intended read was for 0. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/sundance.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 0ab9c38b4a34..8cdeb5cbab5b 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -633,9 +633,13 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
633 633
634 np->phys[0] = 1; /* Default setting */ 634 np->phys[0] = 1; /* Default setting */
635 np->mii_preamble_required++; 635 np->mii_preamble_required++;
636 /*
637 * It seems some phys doesn't deal well with address 0 being accessed
638 * first, so leave address zero to the end of the loop (32 & 31).
639 */
636 for (phy = 1; phy <= 32 && phy_idx < MII_CNT; phy++) { 640 for (phy = 1; phy <= 32 && phy_idx < MII_CNT; phy++) {
637 int mii_status = mdio_read(dev, phy, MII_BMSR);
638 int phyx = phy & 0x1f; 641 int phyx = phy & 0x1f;
642 int mii_status = mdio_read(dev, phyx, MII_BMSR);
639 if (mii_status != 0xffff && mii_status != 0x0000) { 643 if (mii_status != 0xffff && mii_status != 0x0000) {
640 np->phys[phy_idx++] = phyx; 644 np->phys[phy_idx++] = phyx;
641 np->mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE); 645 np->mii_if.advertising = mdio_read(dev, phyx, MII_ADVERTISE);