diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2012-03-18 10:23:11 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-03-20 00:52:17 +0400 |
commit | 4762f6cec4455f3bbe4ca82c100fe5d85d3c02a2 (patch) | |
tree | 51cf21b4a949b8a3292019f81447d8a9a719d7e3 /drivers/net/ethernet/emulex/benet/be_main.c | |
parent | 277074777cd9c004b1ac32689772370c38fd00e2 (diff) | |
download | linux-4762f6cec4455f3bbe4ca82c100fe5d85d3c02a2.tar.xz |
be2net: enable WOL by default if h/w supports it
Signed-off-by: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_main.c')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index e3822788f532..050e3ebd4fb3 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -3244,6 +3244,12 @@ static void __devexit be_remove(struct pci_dev *pdev) free_netdev(adapter->netdev); } +bool be_is_wol_supported(struct be_adapter *adapter) +{ + return ((adapter->wol_cap & BE_WOL_CAP) && + !be_is_wol_excluded(adapter)) ? true : false; +} + static int be_get_config(struct be_adapter *adapter) { int status; @@ -3262,6 +3268,17 @@ static int be_get_config(struct be_adapter *adapter) if (status) return status; + status = be_cmd_get_acpi_wol_cap(adapter); + if (status) { + /* in case of a failure to get wol capabillities + * check the exclusion list to determine WOL capability */ + if (!be_is_wol_excluded(adapter)) + adapter->wol_cap |= BE_WOL_CAP; + } + + if (be_is_wol_supported(adapter)) + adapter->wol = true; + return 0; } |