Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 328130
b: refs/heads/master
c: 8762cec
h: refs/heads/master
v: v3
  • Loading branch information
Steve Glendinning authored and David S. Miller committed Sep 28, 2012
1 parent 419a177 commit 1f70fc1
Show file tree
Hide file tree
Showing 2 changed files with 24 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: e0e474a83c18f134e42c4845e19d0ef0751f43f0
refs/heads/master: 8762cec8d9d06eddc9a80293a230d6e073568815
23 changes: 23 additions & 0 deletions trunk/drivers/net/usb/smsc75xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,26 @@ static int smsc75xx_set_features(struct net_device *netdev,
return 0;
}

static int smsc75xx_wait_ready(struct usbnet *dev)
{
int timeout = 0;

do {
u32 buf;
int ret = smsc75xx_read_reg(dev, PMT_CTL, &buf);
check_warn_return(ret, "Failed to read PMT_CTL: %d", ret);

if (buf & PMT_CTL_DEV_RDY)
return 0;

msleep(10);
timeout++;
} while (timeout < 100);

netdev_warn(dev->net, "timeout waiting for device ready");
return -EIO;
}

static int smsc75xx_reset(struct usbnet *dev)
{
struct smsc75xx_priv *pdata = (struct smsc75xx_priv *)(dev->data[0]);
Expand All @@ -764,6 +784,9 @@ static int smsc75xx_reset(struct usbnet *dev)

netif_dbg(dev, ifup, dev->net, "entering smsc75xx_reset");

ret = smsc75xx_wait_ready(dev);
check_warn_return(ret, "device not ready in smsc75xx_reset");

ret = smsc75xx_read_reg(dev, HW_CFG, &buf);
check_warn_return(ret, "Failed to read HW_CFG: %d", ret);

Expand Down

0 comments on commit 1f70fc1

Please sign in to comment.