Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13894
b: refs/heads/master
c: 7a33e45
h: refs/heads/master
v: v3
  • Loading branch information
Ayaz Abdulla authored and Jeff Garzik committed Nov 11, 2005
1 parent b6aca4e commit 08b31db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a971c32488569b5443c48168756e8ccfb0862c50
refs/heads/master: 7a33e45a2498460d6daa20a1740d3185798d6026
30 changes: 14 additions & 16 deletions trunk/drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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>
Expand Down Expand Up @@ -2557,40 +2558,37 @@ 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;

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;
Expand Down

0 comments on commit 08b31db

Please sign in to comment.