diff options
author | Somnath Kotur <somnath.kotur@emulex.com> | 2013-03-14 02:42:07 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-15 08:56:58 -0400 |
commit | 68c45a2da34cb44962c6a48f8e474ec6b7853641 (patch) | |
tree | e98dcd8cc1df30d79a3fd9af0159513f600e6985 /drivers/net/ethernet/emulex/benet/be_cmds.c | |
parent | 8cef7a7892e7820a825aab28a1bff42ca216e9f0 (diff) | |
download | lwn-68c45a2da34cb44962c6a48f8e474ec6b7853641.tar.gz lwn-68c45a2da34cb44962c6a48f8e474ec6b7853641.zip |
be2net: Use new F/W mailbox cmd to manipulate interrupts.
This is needed as the earlier method of manipulating this register via PCI
Config space is disallowed by certain Hypervisors.
Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_cmds.c')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 6ed46396bb36..99163646113f 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c @@ -3202,6 +3202,31 @@ err: return status; } +int be_cmd_intr_set(struct be_adapter *adapter, bool intr_enable) +{ + struct be_mcc_wrb *wrb; + struct be_cmd_req_intr_set *req; + int status; + + if (mutex_lock_interruptible(&adapter->mbox_lock)) + return -1; + + wrb = wrb_from_mbox(adapter); + + req = embedded_payload(wrb); + + be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, + OPCODE_COMMON_SET_INTERRUPT_ENABLE, sizeof(*req), + wrb, NULL); + + req->intr_enabled = intr_enable; + + status = be_mbox_notify_wait(adapter); + + mutex_unlock(&adapter->mbox_lock); + return status; +} + int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload, int wrb_payload_size, u16 *cmd_status, u16 *ext_status) { |