Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 225194
b: refs/heads/master
c: c75822a
h: refs/heads/master
v: v3
  • Loading branch information
Sucheta Chakraborty authored and David S. Miller committed Dec 17, 2010
1 parent 140d783 commit 661cdf3
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7edc3453e54432a9f1c636b6481f1107c9db19bd
refs/heads/master: c75822a3091a899d982d59cd2b4454fe7c3e0318
1 change: 1 addition & 0 deletions trunk/drivers/net/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ struct qlcnic_ipaddr {

#define QLCNIC_INTERRUPT_TEST 1
#define QLCNIC_LOOPBACK_TEST 2
#define QLCNIC_LED_TEST 3

#define QLCNIC_FILTER_AGE 80
#define QLCNIC_READD_AGE 20
Expand Down
27 changes: 22 additions & 5 deletions trunk/drivers/net/qlcnic/qlcnic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,16 +834,27 @@ static int qlcnic_set_tso(struct net_device *dev, u32 data)
static int qlcnic_blink_led(struct net_device *dev, u32 val)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);
int max_sds_rings = adapter->max_sds_rings;
int dev_down = 0;
int ret;

if (!test_bit(__QLCNIC_DEV_UP, &adapter->state))
return -EIO;
if (!test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
dev_down = 1;
if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
return -EIO;

ret = qlcnic_diag_alloc_res(dev, QLCNIC_LED_TEST);
if (ret) {
clear_bit(__QLCNIC_RESETTING, &adapter->state);
return ret;
}
}

ret = adapter->nic_ops->config_led(adapter, 1, 0xf);
if (ret) {
dev_err(&adapter->pdev->dev,
"Failed to set LED blink state.\n");
return ret;
goto done;
}

msleep_interruptible(val * 1000);
Expand All @@ -852,10 +863,16 @@ static int qlcnic_blink_led(struct net_device *dev, u32 val)
if (ret) {
dev_err(&adapter->pdev->dev,
"Failed to reset LED blink state.\n");
return ret;
goto done;
}

return 0;
done:
if (dev_down) {
qlcnic_diag_free_res(dev, max_sds_rings);
clear_bit(__QLCNIC_RESETTING, &adapter->state);
}
return ret;

}

static void
Expand Down

0 comments on commit 661cdf3

Please sign in to comment.