Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 246981
b: refs/heads/master
c: 00c266b
h: refs/heads/master
i:
  246979: 46e3b50
v: v3
  • Loading branch information
Matt Carlson authored and David S. Miller committed Apr 26, 2011
1 parent 15f4d92 commit 59ac33f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 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: 0aebff4871d26410ae485b521870bb0ffe1736f0
refs/heads/master: 00c266b794d589dcf7d280926dfc27c5896a410a
20 changes: 12 additions & 8 deletions trunk/drivers/net/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -11276,10 +11276,12 @@ static int tg3_run_loopback(struct tg3 *tp, u32 pktsz, int loopback_mode)
return err;
}

#define TG3_MAC_LOOPBACK_FAILED 1
#define TG3_PHY_LOOPBACK_FAILED 2
#define TG3_LOOPBACK_FAILED (TG3_MAC_LOOPBACK_FAILED | \
TG3_PHY_LOOPBACK_FAILED)
#define TG3_STD_LOOPBACK_FAILED 1
#define TG3_JMB_LOOPBACK_FAILED 2

#define TG3_MAC_LOOPBACK_SHIFT 0
#define TG3_PHY_LOOPBACK_SHIFT 4
#define TG3_LOOPBACK_FAILED 0x00000033

static int tg3_test_loopback(struct tg3 *tp)
{
Expand Down Expand Up @@ -11338,11 +11340,11 @@ static int tg3_test_loopback(struct tg3 *tp)
}

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

if ((tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) &&
tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_MAC_LOOPBACK))
err |= (TG3_MAC_LOOPBACK_FAILED << 2);
err |= TG3_JMB_LOOPBACK_FAILED << TG3_MAC_LOOPBACK_SHIFT;

if (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) {
tw32(TG3_CPMU_CTRL, cpmuctrl);
Expand All @@ -11354,10 +11356,12 @@ static int tg3_test_loopback(struct tg3 *tp)
if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
!(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB)) {
if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_PHY_LOOPBACK))
err |= TG3_PHY_LOOPBACK_FAILED;
err |= TG3_STD_LOOPBACK_FAILED <<
TG3_PHY_LOOPBACK_SHIFT;
if ((tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) &&
tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_PHY_LOOPBACK))
err |= (TG3_PHY_LOOPBACK_FAILED << 2);
err |= TG3_JMB_LOOPBACK_FAILED <<
TG3_PHY_LOOPBACK_SHIFT;
}

/* Re-enable gphy autopowerdown. */
Expand Down

0 comments on commit 59ac33f

Please sign in to comment.