aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/forcedeth.c
diff options
context:
space:
mode:
authorAyaz Abdulla <aabdulla@nvidia.com>2005-11-11 08:31:11 -0500
committerJeff Garzik <jgarzik@pobox.com>2005-11-11 08:31:11 -0500
commit7a33e45a2498460d6daa20a1740d3185798d6026 (patch)
treeb86ff3a2f435b98e125610a1b66b6d69026d35f1 /drivers/net/forcedeth.c
parenta971c32488569b5443c48168756e8ccfb0862c50 (diff)
[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.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 731d0d7b2f3..525624fc03b 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -99,6 +99,7 @@
99 * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation. 99 * 0.44: 20 Aug 2005: Add support for scatter gather and segmentation.
100 * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check 100 * 0.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check
101 * 0.46: 20 Oct 2005: Add irq optimization modes. 101 * 0.46: 20 Oct 2005: Add irq optimization modes.
102 * 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan.
102 * 103 *
103 * Known bugs: 104 * Known bugs:
104 * We suspect that on some hardware no TX done interrupts are generated. 105 * We suspect that on some hardware no TX done interrupts are generated.
@@ -110,7 +111,7 @@
110 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few 111 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
111 * superfluous timer interrupts from the nic. 112 * superfluous timer interrupts from the nic.
112 */ 113 */
113#define FORCEDETH_VERSION "0.46" 114#define FORCEDETH_VERSION "0.47"
114#define DRV_NAME "forcedeth" 115#define DRV_NAME "forcedeth"
115 116
116#include <linux/module.h> 117#include <linux/module.h>
@@ -2557,16 +2558,17 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2557 } 2558 }
2558 2559
2559 /* find a suitable phy */ 2560 /* find a suitable phy */
2560 for (i = 1; i < 32; i++) { 2561 for (i = 1; i <= 32; i++) {
2561 int id1, id2; 2562 int id1, id2;
2563 int phyaddr = i & 0x1F;
2562 2564
2563 spin_lock_irq(&np->lock); 2565 spin_lock_irq(&np->lock);
2564 id1 = mii_rw(dev, i, MII_PHYSID1, MII_READ); 2566 id1 = mii_rw(dev, phyaddr, MII_PHYSID1, MII_READ);
2565 spin_unlock_irq(&np->lock); 2567 spin_unlock_irq(&np->lock);
2566 if (id1 < 0 || id1 == 0xffff) 2568 if (id1 < 0 || id1 == 0xffff)
2567 continue; 2569 continue;
2568 spin_lock_irq(&np->lock); 2570 spin_lock_irq(&np->lock);
2569 id2 = mii_rw(dev, i, MII_PHYSID2, MII_READ); 2571 id2 = mii_rw(dev, phyaddr, MII_PHYSID2, MII_READ);
2570 spin_unlock_irq(&np->lock); 2572 spin_unlock_irq(&np->lock);
2571 if (id2 < 0 || id2 == 0xffff) 2573 if (id2 < 0 || id2 == 0xffff)
2572 continue; 2574 continue;
@@ -2574,23 +2576,19 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
2574 id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT; 2576 id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT;
2575 id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT; 2577 id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT;
2576 dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", 2578 dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n",
2577 pci_name(pci_dev), id1, id2, i); 2579 pci_name(pci_dev), id1, id2, phyaddr);
2578 np->phyaddr = i; 2580 np->phyaddr = phyaddr;
2579 np->phy_oui = id1 | id2; 2581 np->phy_oui = id1 | id2;
2580 break; 2582 break;
2581 } 2583 }
2582 if (i == 32) { 2584 if (i == 33) {
2583 /* PHY in isolate mode? No phy attached and user wants to
2584 * test loopback? Very odd, but can be correct.
2585 */
2586 printk(KERN_INFO "%s: open: Could not find a valid PHY.\n", 2585 printk(KERN_INFO "%s: open: Could not find a valid PHY.\n",
2587 pci_name(pci_dev)); 2586 pci_name(pci_dev));
2588 } 2587 goto out_freering;
2589
2590 if (i != 32) {
2591 /* reset it */
2592 phy_init(dev);
2593 } 2588 }
2589
2590 /* reset it */
2591 phy_init(dev);
2594 2592
2595 /* set default link speed settings */ 2593 /* set default link speed settings */
2596 np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; 2594 np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;