diff options
author | Sucheta Chakraborty <sucheta@dut6195.unminc.com> | 2010-02-01 00:24:58 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-02 18:55:45 -0500 |
commit | 897d3596e0dfc4c25963cff00f1159c79eaf38d3 (patch) | |
tree | 4e2e780345db8e1ef6b9a3de5d01a707ecb209fb /drivers/net/qlcnic/qlcnic_ethtool.c | |
parent | ce6684433fb277406dd861fd8a17133253e7c367 (diff) |
qlcnic: support LED blink for device identification
Added support of device identification by blinking LED for specified time.
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_ethtool.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ethtool.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c index 37df5f6cea08..7212319760ba 100644 --- a/drivers/net/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/qlcnic/qlcnic_ethtool.c | |||
@@ -618,6 +618,7 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test, | |||
618 | u64 *data) | 618 | u64 *data) |
619 | { | 619 | { |
620 | memset(data, 0, sizeof(u64) * QLCNIC_TEST_LEN); | 620 | memset(data, 0, sizeof(u64) * QLCNIC_TEST_LEN); |
621 | |||
621 | data[0] = qlcnic_reg_test(dev); | 622 | data[0] = qlcnic_reg_test(dev); |
622 | if (data[0]) | 623 | if (data[0]) |
623 | eth_test->flags |= ETH_TEST_FL_FAILED; | 624 | eth_test->flags |= ETH_TEST_FL_FAILED; |
@@ -693,6 +694,30 @@ static int qlcnic_set_tso(struct net_device *dev, u32 data) | |||
693 | return 0; | 694 | return 0; |
694 | } | 695 | } |
695 | 696 | ||
697 | static int qlcnic_blink_led(struct net_device *dev, u32 val) | ||
698 | { | ||
699 | struct qlcnic_adapter *adapter = netdev_priv(dev); | ||
700 | int ret; | ||
701 | |||
702 | ret = qlcnic_config_led(adapter, 1, 0xf); | ||
703 | if (ret) { | ||
704 | dev_err(&adapter->pdev->dev, | ||
705 | "Failed to set LED blink state.\n"); | ||
706 | return ret; | ||
707 | } | ||
708 | |||
709 | msleep_interruptible(val * 1000); | ||
710 | |||
711 | ret = qlcnic_config_led(adapter, 0, 0xf); | ||
712 | if (ret) { | ||
713 | dev_err(&adapter->pdev->dev, | ||
714 | "Failed to reset LED blink state.\n"); | ||
715 | return ret; | ||
716 | } | ||
717 | |||
718 | return 0; | ||
719 | } | ||
720 | |||
696 | static void | 721 | static void |
697 | qlcnic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 722 | qlcnic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
698 | { | 723 | { |
@@ -867,4 +892,5 @@ const struct ethtool_ops qlcnic_ethtool_ops = { | |||
867 | .set_coalesce = qlcnic_set_intr_coalesce, | 892 | .set_coalesce = qlcnic_set_intr_coalesce, |
868 | .get_flags = ethtool_op_get_flags, | 893 | .get_flags = ethtool_op_get_flags, |
869 | .set_flags = qlcnic_set_flags, | 894 | .set_flags = qlcnic_set_flags, |
895 | .phys_id = qlcnic_blink_led, | ||
870 | }; | 896 | }; |