summaryrefslogtreecommitdiff
path: root/drivers/net/benet/be_cmds.c
diff options
context:
space:
mode:
authorSathya Perla <sathya.perla@emulex.com>2011-03-11 05:49:26 +0300
committerDavid S. Miller <davem@davemloft.net>2011-03-15 01:17:09 +0300
commit2e588f84f254cca0fc3b9f01297d06799b8c85d3 (patch)
treed21f7eb9b0bb97b1860bf0cd6fd7c5bbddad8893 /drivers/net/benet/be_cmds.c
parentd478af0d6bb38c971d1172e99c5046025a9167c9 (diff)
downloadlinux-2e588f84f254cca0fc3b9f01297d06799b8c85d3.tar.xz
be2net: changes for BE3 native mode support
So far be2net has been using BE3 in legacy mode. It now checks for native mode capability and if available it sets it. In native mode, the RX_COMPL structure is different from that in legacy mode. Signed-off-by: Sathya Perla <sathya.perla@emulex.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.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index cc3a235475bc..e1124c89181c 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -2014,3 +2014,42 @@ err:
attribs_cmd.dma);
return status;
}
+
+/* Uses mbox */
+int be_cmd_check_native_mode(struct be_adapter *adapter)
+{
+ struct be_mcc_wrb *wrb;
+ struct be_cmd_req_set_func_cap *req;
+ int status;
+
+ if (mutex_lock_interruptible(&adapter->mbox_lock))
+ return -1;
+
+ wrb = wrb_from_mbox(adapter);
+ if (!wrb) {
+ status = -EBUSY;
+ goto err;
+ }
+
+ req = embedded_payload(wrb);
+
+ be_wrb_hdr_prepare(wrb, sizeof(*req), true, 0,
+ OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP);
+
+ be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
+ OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP, sizeof(*req));
+
+ req->valid_cap_flags = cpu_to_le32(CAPABILITY_SW_TIMESTAMPS |
+ CAPABILITY_BE3_NATIVE_ERX_API);
+ req->cap_flags = cpu_to_le32(CAPABILITY_BE3_NATIVE_ERX_API);
+
+ status = be_mbox_notify_wait(adapter);
+ if (!status) {
+ struct be_cmd_resp_set_func_cap *resp = embedded_payload(wrb);
+ adapter->be3_native = le32_to_cpu(resp->cap_flags) &
+ CAPABILITY_BE3_NATIVE_ERX_API;
+ }
+err:
+ mutex_unlock(&adapter->mbox_lock);
+ return status;
+}