Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236701
b: refs/heads/master
c: ab78904
h: refs/heads/master
i:
  236699: 5f00b57
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Jan 26, 2011
1 parent b942838 commit 8821e0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 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: aba49f2421d5287692aee961ab4ce2981fdf4939
refs/heads/master: ab78904608bd6e421b81420e4d2f7d5bae9d4660
20 changes: 15 additions & 5 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11013,14 +11013,19 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
static int tg3_test_loopback(struct tg3 *tp)
{
int err = 0;
u32 cpmuctrl = 0;
u32 eee_cap, cpmuctrl = 0;

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

eee_cap = tp->phy_flags & TG3_PHYFLG_EEE_CAP;
tp->phy_flags &= ~TG3_PHYFLG_EEE_CAP;

err = tg3_reset_hw(tp, 1);
if (err)
return TG3_LOOPBACK_FAILED;
if (err) {
err = TG3_LOOPBACK_FAILED;
goto done;
}

/* Turn off gphy autopowerdown. */
if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
Expand All @@ -11040,8 +11045,10 @@ static int tg3_test_loopback(struct tg3 *tp)
udelay(10);
}

if (status != CPMU_MUTEX_GNT_DRIVER)
return TG3_LOOPBACK_FAILED;
if (status != CPMU_MUTEX_GNT_DRIVER) {
err = TG3_LOOPBACK_FAILED;
goto done;
}

/* Turn off link-based power management. */
cpmuctrl = tr32(TG3_CPMU_CTRL);
Expand Down Expand Up @@ -11070,6 +11077,9 @@ static int tg3_test_loopback(struct tg3 *tp)
if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
tg3_phy_toggle_apd(tp, true);

done:
tp->phy_flags |= eee_cap;

return err;
}

Expand Down

0 comments on commit 8821e0e

Please sign in to comment.