2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-18 18:23:53 +08:00

[netdrvr forcedeth] phy address scan range

Added phy address 0 to the phy scan.

Signed-off-by: Ayaz Abdulla <aabdulla@nvidia.com>
This commit is contained in:
Ayaz Abdulla 2005-11-11 08:31:11 -05:00 committed by Jeff Garzik
parent a971c32488
commit 7a33e45a24

View File

@ -99,6 +99,7 @@
* 0.44: 20 Aug 2005: Add support for scatter gather and segmentation. * 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.45: 18 Sep 2005: Remove nv_stop/start_rx from every link check
* 0.46: 20 Oct 2005: Add irq optimization modes. * 0.46: 20 Oct 2005: Add irq optimization modes.
* 0.47: 26 Oct 2005: Add phyaddr 0 in phy scan.
* *
* Known bugs: * Known bugs:
* We suspect that on some hardware no TX done interrupts are generated. * 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 * DEV_NEED_TIMERIRQ will not harm you on sane hardware, only generating a few
* superfluous timer interrupts from the nic. * superfluous timer interrupts from the nic.
*/ */
#define FORCEDETH_VERSION "0.46" #define FORCEDETH_VERSION "0.47"
#define DRV_NAME "forcedeth" #define DRV_NAME "forcedeth"
#include <linux/module.h> #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 */ /* find a suitable phy */
for (i = 1; i < 32; i++) { for (i = 1; i <= 32; i++) {
int id1, id2; int id1, id2;
int phyaddr = i & 0x1F;
spin_lock_irq(&np->lock); 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); spin_unlock_irq(&np->lock);
if (id1 < 0 || id1 == 0xffff) if (id1 < 0 || id1 == 0xffff)
continue; continue;
spin_lock_irq(&np->lock); 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); spin_unlock_irq(&np->lock);
if (id2 < 0 || id2 == 0xffff) if (id2 < 0 || id2 == 0xffff)
continue; 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; id1 = (id1 & PHYID1_OUI_MASK) << PHYID1_OUI_SHFT;
id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT; id2 = (id2 & PHYID2_OUI_MASK) >> PHYID2_OUI_SHFT;
dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n", dprintk(KERN_DEBUG "%s: open: Found PHY %04x:%04x at address %d.\n",
pci_name(pci_dev), id1, id2, i); pci_name(pci_dev), id1, id2, phyaddr);
np->phyaddr = i; np->phyaddr = phyaddr;
np->phy_oui = id1 | id2; np->phy_oui = id1 | id2;
break; break;
} }
if (i == 32) { if (i == 33) {
/* PHY in isolate mode? No phy attached and user wants to
* test loopback? Very odd, but can be correct.
*/
printk(KERN_INFO "%s: open: Could not find a valid PHY.\n", printk(KERN_INFO "%s: open: Could not find a valid PHY.\n",
pci_name(pci_dev)); pci_name(pci_dev));
} goto out_freering;
if (i != 32) {
/* reset it */
phy_init(dev);
} }
/* reset it */
phy_init(dev);
/* set default link speed settings */ /* set default link speed settings */
np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10; np->linkspeed = NVREG_LINKSPEED_FORCE|NVREG_LINKSPEED_10;