diff options
author | Ajit Khaparde <ajitk@serverengines.com> | 2009-12-03 01:16:59 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-03 15:39:21 -0500 |
commit | 71d8d1b58aa4025ea73a66a130a98d0ed077f9b1 (patch) | |
tree | 36034463fa1b1438ad018fbaafbe9dac60159751 /drivers/net/benet/be_cmds.c | |
parent | d744b44e21a2c908aae23a60da1b4ce35cd925ef (diff) |
be2net: Support for WoL using magic packet after suspend.
Add support for WOL using Magic Packet after suspend is done.
Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 5ec61de3b97f..bee7b822d120 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -1442,3 +1442,39 @@ err: | |||
1442 | spin_unlock_bh(&adapter->mcc_lock); | 1442 | spin_unlock_bh(&adapter->mcc_lock); |
1443 | return status; | 1443 | return status; |
1444 | } | 1444 | } |
1445 | |||
1446 | extern int be_cmd_enable_magic_wol(struct be_adapter *adapter, u8 *mac, | ||
1447 | struct be_dma_mem *nonemb_cmd) | ||
1448 | { | ||
1449 | struct be_mcc_wrb *wrb; | ||
1450 | struct be_cmd_req_acpi_wol_magic_config *req; | ||
1451 | struct be_sge *sge; | ||
1452 | int status; | ||
1453 | |||
1454 | spin_lock_bh(&adapter->mcc_lock); | ||
1455 | |||
1456 | wrb = wrb_from_mccq(adapter); | ||
1457 | if (!wrb) { | ||
1458 | status = -EBUSY; | ||
1459 | goto err; | ||
1460 | } | ||
1461 | req = nonemb_cmd->va; | ||
1462 | sge = nonembedded_sgl(wrb); | ||
1463 | |||
1464 | be_wrb_hdr_prepare(wrb, sizeof(*req), false, 1, | ||
1465 | OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG); | ||
1466 | |||
1467 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, | ||
1468 | OPCODE_ETH_ACPI_WOL_MAGIC_CONFIG, sizeof(*req)); | ||
1469 | memcpy(req->magic_mac, mac, ETH_ALEN); | ||
1470 | |||
1471 | sge->pa_hi = cpu_to_le32(upper_32_bits(nonemb_cmd->dma)); | ||
1472 | sge->pa_lo = cpu_to_le32(nonemb_cmd->dma & 0xFFFFFFFF); | ||
1473 | sge->len = cpu_to_le32(nonemb_cmd->size); | ||
1474 | |||
1475 | status = be_mcc_notify_wait(adapter); | ||
1476 | |||
1477 | err: | ||
1478 | spin_unlock_bh(&adapter->mcc_lock); | ||
1479 | return status; | ||
1480 | } | ||