diff options
author | Ayaz Abdulla <aabdulla@nvidia.com> | 2005-11-11 14:31:11 +0100 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-11 14:31:11 +0100 |
commit | 7a33e45a2498460d6daa20a1740d3185798d6026 (patch) | |
tree | b86ff3a2f435b98e125610a1b66b6d69026d35f1 /drivers/net/forcedeth.c | |
parent | [netdrvr forcedeth] support for irq mitigation (diff) | |
download | linux-7a33e45a2498460d6daa20a1740d3185798d6026.tar.xz linux-7a33e45a2498460d6daa20a1740d3185798d6026.zip |
[netdrvr forcedeth] phy address scan range
Added phy address 0 to the phy scan.
Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
Diffstat (limited to 'drivers/net/forcedeth.c')
-rw-r--r-- | drivers/net/forcedeth.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 731d0d7b2f37..525624fc03b4 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c @@ -99,6 +99,7 @@ * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation. * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check * 0.46: 20 Oct 2005: Add irq optimization modes. + * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan. * * Known bugs: * We suspect that on some hardware no TX done interrupts are generated. @@ -110,7 +111,7 @@ * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few * superfluous timer interrupts from the nic. */ -#define FORCEDETH_VERSION "0.46" +#define FORCEDETH_VERSION "0.47" #define DRV_NAME "forcedeth" #include <linux/module.h> @@ -2557,16 +2558,17 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i } /* find a suitable phy */ - for (i = 1; i < 32; i++) { + for (i = 1; i <= 32; i++) { int id1, id2; + int phyaddr = i & 0x1F; spin_lock_irq(&np->lock); - id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ); + id1 = mii_rw(dev, phyaddr, MII_PHYSID1, MII_READ); spin_unlock_irq(&np->lock); if (id1 < 0 || id1 == 0xffff) continue; spin_lock_irq(&np->lock); - id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ); + id2 = mii_rw(dev, phyaddr, MII_PHYSID2, MII_READ); spin_unlock_irq(&np->lock); if (id2 < 0 || id2 == 0xffff) continue; @@ -2574,23 +2576,19 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT; id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT; dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", - pci_name(pci_dev), id1, id2, i); - np->phyaddr = i; + pci_name(pci_dev), id1, id2, phyaddr); + np->phyaddr = phyaddr; np->phy_oui = id1 | id2; break; } - if (i == 32) { - /* PHY in isolate mode? No phy attached and user wants to - * test loopback? Very odd, but can be correct. - */ + if (i == 33) { printk(KERN_INFO "%s: open: Could not find a valid PHY.\n", - pci_name(pci_dev)); - } - - if (i != 32) { - /* reset it */ - phy_init(dev); + pci_name(pci_dev)); + goto out_freering; } + + /* reset it */ + phy_init(dev); /* set default link speed settings */ np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; |