aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMichael Chan <mchan@broadcom.com>2005-09-05 20:52:54 -0400
committerDavid S. Miller <davem@davemloft.net>2005-09-05 20:52:54 -0400
commit4009a93d8e85f685b02794aee28e3272be862e2b (patch)
tree1571d9399aa0ae6ba0472b59179d447ac8185a80 /drivers/net/tg3.c
parent4c98748763ce25c5394a7edd686d92c70b4fac38 (diff)
[TG3]: Add ethtool -p support
Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 3ee1a7be8649..3bddfd705838 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7559,6 +7559,38 @@ static void tg3_get_strings (struct net_device *dev, u32 stringset, u8 *buf)
7559 } 7559 }
7560} 7560}
7561 7561
7562static int tg3_phys_id(struct net_device *dev, u32 data)
7563{
7564 struct tg3 *tp = netdev_priv(dev);
7565 int i;
7566
7567 if (!netif_running(tp->dev))
7568 return -EAGAIN;
7569
7570 if (data == 0)
7571 data = 2;
7572
7573 for (i = 0; i < (data * 2); i++) {
7574 if ((i % 2) == 0)
7575 tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
7576 LED_CTRL_1000MBPS_ON |
7577 LED_CTRL_100MBPS_ON |
7578 LED_CTRL_10MBPS_ON |
7579 LED_CTRL_TRAFFIC_OVERRIDE |
7580 LED_CTRL_TRAFFIC_BLINK |
7581 LED_CTRL_TRAFFIC_LED);
7582
7583 else
7584 tw32(MAC_LED_CTRL, LED_CTRL_LNKLED_OVERRIDE |
7585 LED_CTRL_TRAFFIC_OVERRIDE);
7586
7587 if (msleep_interruptible(500))
7588 break;
7589 }
7590 tw32(MAC_LED_CTRL, tp->led_ctrl);
7591 return 0;
7592}
7593
7562static void tg3_get_ethtool_stats (struct net_device *dev, 7594static void tg3_get_ethtool_stats (struct net_device *dev,
7563 struct ethtool_stats *estats, u64 *tmp_stats) 7595 struct ethtool_stats *estats, u64 *tmp_stats)
7564{ 7596{
@@ -8241,6 +8273,7 @@ static struct ethtool_ops tg3_ethtool_ops = {
8241 .self_test_count = tg3_get_test_count, 8273 .self_test_count = tg3_get_test_count,
8242 .self_test = tg3_self_test, 8274 .self_test = tg3_self_test,
8243 .get_strings = tg3_get_strings, 8275 .get_strings = tg3_get_strings,
8276 .phys_id = tg3_phys_id,
8244 .get_stats_count = tg3_get_stats_count, 8277 .get_stats_count = tg3_get_stats_count,
8245 .get_ethtool_stats = tg3_get_ethtool_stats, 8278 .get_ethtool_stats = tg3_get_ethtool_stats,
8246 .get_coalesce = tg3_get_coalesce, 8279 .get_coalesce = tg3_get_coalesce,