Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 1691
b: refs/heads/master
c: ca43007
h: refs/heads/master
i:
  1689: ad871b2
  1687: 26d93e9
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed May 29, 2005
1 parent e9183c8 commit 0941f2c
Show file tree
Hide file tree
Showing 2 changed files with 31 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: 566f86adb336637d03900f53b886d879aa5f5d56
refs/heads/master: ca43007a92662621e5819912fc31c346e3a2eed8
30 changes: 30 additions & 0 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -7281,6 +7281,32 @@ static int tg3_test_nvram(struct tg3 *tp)
return err;
}

#define TG3_SERDES_TIMEOUT_SEC 2
#define TG3_COPPER_TIMEOUT_SEC 6

static int tg3_test_link(struct tg3 *tp)
{
int i, max;

if (!netif_running(tp->dev))
return -ENODEV;

if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
max = TG3_SERDES_TIMEOUT_SEC;
else
max = TG3_COPPER_TIMEOUT_SEC;

for (i = 0; i < max; i++) {
if (netif_carrier_ok(tp->dev))
return 0;

if (msleep_interruptible(1000))
break;
}

return -EIO;
}

static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
u64 *data)
{
Expand All @@ -7292,6 +7318,10 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest,
etest->flags |= ETH_TEST_FL_FAILED;
data[0] = 1;
}
if (tg3_test_link(tp) != 0) {
etest->flags |= ETH_TEST_FL_FAILED;
data[1] = 1;
}
}

static int tg3_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
Expand Down

0 comments on commit 0941f2c

Please sign in to comment.