diff options
author | Sucheta Chakraborty <sucheta@dut6195.unminc.com> | 2010-02-01 08:24:58 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-03 02:55:45 +0300 |
commit | 897d3596e0dfc4c25963cff00f1159c79eaf38d3 (patch) | |
tree | 4e2e780345db8e1ef6b9a3de5d01a707ecb209fb /drivers/net/qlcnic/qlcnic_hw.c | |
parent | ce6684433fb277406dd861fd8a17133253e7c367 (diff) | |
download | linux-897d3596e0dfc4c25963cff00f1159c79eaf38d3.tar.xz |
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_hw.c')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hw.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index 91234e7b39e4..8724e561ed72 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c @@ -1199,3 +1199,25 @@ qlcnic_wol_supported(struct qlcnic_adapter *adapter) return 0; } + +int qlcnic_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate) +{ + struct qlcnic_nic_req req; + int rv; + u64 word; + + memset(&req, 0, sizeof(struct qlcnic_nic_req)); + req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23); + + word = QLCNIC_H2C_OPCODE_CONFIG_LED | ((u64)adapter->portnum << 16); + req.req_hdr = cpu_to_le64(word); + + req.words[0] = cpu_to_le64((u64)rate << 32); + req.words[1] = cpu_to_le64(state); + + rv = qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); + if (rv) + dev_err(&adapter->pdev->dev, "LED configuration failed.\n"); + + return rv; +} |