aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/qlcnic/qlcnic_ethtool.c
diff options
context:
space:
mode:
authorSucheta Chakraborty <sucheta@dut6195.unminc.com>2010-02-01 05:24:58 +0000
committerDavid S. Miller <davem@davemloft.net>2010-02-02 15:55:45 -0800
commit897d3596e0dfc4c25963cff00f1159c79eaf38d3 (patch)
tree4e2e780345db8e1ef6b9a3de5d01a707ecb209fb /drivers/net/qlcnic/qlcnic_ethtool.c
parentce6684433fb277406dd861fd8a17133253e7c367 (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.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 37df5f6cea0..7212319760b 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,
u64 *data)
{
memset(data, 0, sizeof(u64) * QLCNIC_TEST_LEN);
+
data[0] = qlcnic_reg_test(dev);
if (data[0])
eth_test->flags |= ETH_TEST_FL_FAILED;
@@ -693,6 +694,30 @@ static int qlcnic_set_tso(struct net_device *dev, u32 data)
return 0;
}
+static int qlcnic_blink_led(struct net_device *dev, u32 val)
+{
+ struct qlcnic_adapter *adapter = netdev_priv(dev);
+ int ret;
+
+ ret = qlcnic_config_led(adapter, 1, 0xf);
+ if (ret) {
+ dev_err(&adapter->pdev->dev,
+ "Failed to set LED blink state.\n");
+ return ret;
+ }
+
+ msleep_interruptible(val * 1000);
+
+ ret = qlcnic_config_led(adapter, 0, 0xf);
+ if (ret) {
+ dev_err(&adapter->pdev->dev,
+ "Failed to reset LED blink state.\n");
+ return ret;
+ }
+
+ return 0;
+}
+
static void
qlcnic_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
@@ -867,4 +892,5 @@ const struct ethtool_ops qlcnic_ethtool_ops = {
.set_coalesce = qlcnic_set_intr_coalesce,
.get_flags = ethtool_op_get_flags,
.set_flags = qlcnic_set_flags,
+ .phys_id = qlcnic_blink_led,
};