Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188152
b: refs/heads/master
c: db443c4
h: refs/heads/master
v: v3
  • Loading branch information
Steve Glendinning authored and David S. Miller committed Mar 16, 2010
1 parent f8e7081 commit 213fb5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3feec9095d12e311b7d4eb7fe7e5dfa75d4a72a5
refs/heads/master: db443c441e204cecc1bcec490d40997db988ce3a
15 changes: 15 additions & 0 deletions trunk/drivers/net/usb/smsc95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,8 @@ static void smsc95xx_start_rx_path(struct usbnet *dev)

static int smsc95xx_phy_initialize(struct usbnet *dev)
{
int bmcr, timeout = 0;

/* Initialize MII structure */
dev->mii.dev = dev->net;
dev->mii.mdio_read = smsc95xx_mdio_read;
Expand All @@ -717,7 +719,20 @@ static int smsc95xx_phy_initialize(struct usbnet *dev)
dev->mii.reg_num_mask = 0x1f;
dev->mii.phy_id = SMSC95XX_INTERNAL_PHY_ID;

/* reset phy and wait for reset to complete */
smsc95xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);

do {
msleep(10);
bmcr = smsc95xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
timeout++;
} while ((bmcr & MII_BMCR) && (timeout < 100));

if (timeout >= 100) {
netdev_warn(dev->net, "timeout on PHY Reset");
return -EIO;
}

smsc95xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
ADVERTISE_PAUSE_ASYM);
Expand Down

0 comments on commit 213fb5b

Please sign in to comment.