aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2011-04-25 08:42:46 -0400
committerDavid S. Miller <davem@davemloft.net>2011-04-26 03:07:02 -0400
commit00c266b794d589dcf7d280926dfc27c5896a410a (patch)
treee5c920724888e935c6a1344ad90680c604d850c3 /drivers/net/tg3.c
parent0aebff4871d26410ae485b521870bb0ffe1736f0 (diff)
tg3: Organize loopback test failure flags
As more test modes are added to each loopback mode, the need to organise the results increases. This patch groups the results by loopback mode, and then by test mode. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Michael Chan <mchan@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a72d0314ca78..88cd23171510 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -11276,10 +11276,12 @@ out:
11276 return err; 11276 return err;
11277} 11277}
11278 11278
11279#define TG3_MAC_LOOPBACK_FAILED 1 11279#define TG3_STD_LOOPBACK_FAILED 1
11280#define TG3_PHY_LOOPBACK_FAILED 2 11280#define TG3_JMB_LOOPBACK_FAILED 2
11281#define TG3_LOOPBACK_FAILED (TG3_MAC_LOOPBACK_FAILED | \ 11281
11282 TG3_PHY_LOOPBACK_FAILED) 11282#define TG3_MAC_LOOPBACK_SHIFT 0
11283#define TG3_PHY_LOOPBACK_SHIFT 4
11284#define TG3_LOOPBACK_FAILED 0x00000033
11283 11285
11284static int tg3_test_loopback(struct tg3 *tp) 11286static int tg3_test_loopback(struct tg3 *tp)
11285{ 11287{
@@ -11338,11 +11340,11 @@ static int tg3_test_loopback(struct tg3 *tp)
11338 } 11340 }
11339 11341
11340 if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_MAC_LOOPBACK)) 11342 if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_MAC_LOOPBACK))
11341 err |= TG3_MAC_LOOPBACK_FAILED; 11343 err |= TG3_STD_LOOPBACK_FAILED << TG3_MAC_LOOPBACK_SHIFT;
11342 11344
11343 if ((tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) && 11345 if ((tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) &&
11344 tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_MAC_LOOPBACK)) 11346 tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_MAC_LOOPBACK))
11345 err |= (TG3_MAC_LOOPBACK_FAILED << 2); 11347 err |= TG3_JMB_LOOPBACK_FAILED << TG3_MAC_LOOPBACK_SHIFT;
11346 11348
11347 if (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) { 11349 if (tp->tg3_flags & TG3_FLAG_CPMU_PRESENT) {
11348 tw32(TG3_CPMU_CTRL, cpmuctrl); 11350 tw32(TG3_CPMU_CTRL, cpmuctrl);
@@ -11354,10 +11356,12 @@ static int tg3_test_loopback(struct tg3 *tp)
11354 if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) && 11356 if (!(tp->phy_flags & TG3_PHYFLG_PHY_SERDES) &&
11355 !(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB)) { 11357 !(tp->tg3_flags3 & TG3_FLG3_USE_PHYLIB)) {
11356 if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_PHY_LOOPBACK)) 11358 if (tg3_run_loopback(tp, ETH_FRAME_LEN, TG3_PHY_LOOPBACK))
11357 err |= TG3_PHY_LOOPBACK_FAILED; 11359 err |= TG3_STD_LOOPBACK_FAILED <<
11360 TG3_PHY_LOOPBACK_SHIFT;
11358 if ((tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) && 11361 if ((tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) &&
11359 tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_PHY_LOOPBACK)) 11362 tg3_run_loopback(tp, 9000 + ETH_HLEN, TG3_PHY_LOOPBACK))
11360 err |= (TG3_PHY_LOOPBACK_FAILED << 2); 11363 err |= TG3_JMB_LOOPBACK_FAILED <<
11364 TG3_PHY_LOOPBACK_SHIFT;
11361 } 11365 }
11362 11366
11363 /* Re-enable gphy autopowerdown. */ 11367 /* Re-enable gphy autopowerdown. */