aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r--drivers/net/benet/be_cmds.c36
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
1446extern 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
1477err:
1478 spin_unlock_bh(&adapter->mcc_lock);
1479 return status;
1480}