diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-10-21 13:07:39 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-22 06:45:40 +0200 |
commit | d8eb59dc8b9e77bb4fa5420ff80142759ad5cd7b (patch) | |
tree | d0b331eca84dabceae8463ec119743907fabcd3b /drivers/net/qlge/qlge_ethtool.c | |
parent | qlge: Add ethtool get/set pause parameter. (diff) | |
download | linux-d8eb59dc8b9e77bb4fa5420ff80142759ad5cd7b.tar.xz linux-d8eb59dc8b9e77bb4fa5420ff80142759ad5cd7b.zip |
qlge: Add ethtool blink function.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_ethtool.c')
-rw-r--r-- | drivers/net/qlge/qlge_ethtool.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_ethtool.c b/drivers/net/qlge/qlge_ethtool.c index dfb5c800cea2..0c0549bc7bde 100644 --- a/drivers/net/qlge/qlge_ethtool.c +++ b/drivers/net/qlge/qlge_ethtool.c @@ -371,6 +371,33 @@ static void ql_get_drvinfo(struct net_device *ndev, drvinfo->eedump_len = 0; } + +static int ql_phys_id(struct net_device *ndev, u32 data) +{ + struct ql_adapter *qdev = netdev_priv(ndev); + u32 led_reg, i; + int status; + + /* Save the current LED settings */ + status = ql_mb_get_led_cfg(qdev); + if (status) + return status; + led_reg = qdev->led_config; + + /* Start blinking the led */ + if (!data || data > 300) + data = 300; + + for (i = 0; i < (data * 10); i++) + ql_mb_set_led_cfg(qdev, QL_LED_BLINK); + + /* Restore LED settings */ + status = ql_mb_set_led_cfg(qdev, led_reg); + if (status) + return status; + + return 0; +} static int ql_get_coalesce(struct net_device *dev, struct ethtool_coalesce *c) { struct ql_adapter *qdev = netdev_priv(dev); @@ -499,6 +526,7 @@ const struct ethtool_ops qlge_ethtool_ops = { .get_msglevel = ql_get_msglevel, .set_msglevel = ql_set_msglevel, .get_link = ethtool_op_get_link, + .phys_id = ql_phys_id, .get_pauseparam = ql_get_pauseparam, .set_pauseparam = ql_set_pauseparam, .get_rx_csum = ql_get_rx_csum, |