Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265338
b: refs/heads/master
c: 2215e24
h: refs/heads/master
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Aug 20, 2011
1 parent 6715803 commit 4c7fdf2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 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: b2d2ccffa4593f56a90a4163d54770949a10c936
refs/heads/master: 2215e24ceb74b701c34b2ebe7cdc96e5509ac565
35 changes: 1 addition & 34 deletions trunk/drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11527,7 +11527,7 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, int loopback_mode)
static int tg3_test_loopback(struct tg3 *tp)
{
int err = 0;
u32 eee_cap, cpmuctrl = 0;
u32 eee_cap;

if (!netif_running(tp->dev))
return TG3_LOOPBACK_FAILED;
Expand All @@ -11554,46 +11554,13 @@ static int tg3_test_loopback(struct tg3 *tp)
if (tp->phy_flags & TG3_PHYFLG_ENABLE_APD)
tg3_phy_toggle_apd(tp, false);

if (tg3_flag(tp, CPMU_PRESENT)) {
int i;
u32 status;

tw32(TG3_CPMU_MUTEX_REQ, CPMU_MUTEX_REQ_DRIVER);

/* Wait for up to 40 microseconds to acquire lock. */
for (i = 0; i < 4; i++) {
status = tr32(TG3_CPMU_MUTEX_GNT);
if (status == CPMU_MUTEX_GNT_DRIVER)
break;
udelay(10);
}

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

/* Turn off link-based power management. */
cpmuctrl = tr32(TG3_CPMU_CTRL);
tw32(TG3_CPMU_CTRL,
cpmuctrl & ~(CPMU_CTRL_LINK_SPEED_MODE |
CPMU_CTRL_LINK_AWARE_MODE));
}

if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_MAC_LOOPBACK))
err |= TG3_STD_LOOPBACK_FAILED << TG3_MAC_LOOPBACK_SHIFT;

if (tg3_flag(tp, JUMBO_RING_ENABLE) &&
tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_MAC_LOOPBACK))
err |= TG3_JMB_LOOPBACK_FAILED << TG3_MAC_LOOPBACK_SHIFT;

if (tg3_flag(tp, CPMU_PRESENT)) {
tw32(TG3_CPMU_CTRL, cpmuctrl);

/* Release the mutex */
tw32(TG3_CPMU_MUTEX_GNT, CPMU_MUTEX_GNT_DRIVER);
}

if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
!tg3_flag(tp, USE_PHYLIB)) {
if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_PHY_LOOPBACK))
Expand Down

0 comments on commit 4c7fdf2

Please sign in to comment.