aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex/benet/be_cmds.c
diff options
context:
space:
mode:
authorPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>2012-07-11 23:57:35 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-12 11:16:46 -0400
commitb4e32a71692aa2b183d9df8d6558c169b47a263c (patch)
tree3387bfd95fd65e149b39ef3226f50708e60075cc /drivers/net/ethernet/emulex/benet/be_cmds.c
parent19d59aa762f803d8663a2cdfb3f0c620f8e9512f (diff)
be2net: Fix port name in message during driver load
Signed-off-by: Padmanabh Ratnakar <padmanabh.ratnakar@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.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c
index 34dfc0c5c774..8730f0e6af30 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.c
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.c
@@ -2716,6 +2716,44 @@ err:
2716 return status; 2716 return status;
2717} 2717}
2718 2718
2719int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name)
2720{
2721 struct be_mcc_wrb *wrb;
2722 struct be_cmd_req_get_port_name *req;
2723 int status;
2724
2725 if (!lancer_chip(adapter)) {
2726 *port_name = adapter->hba_port_num + '0';
2727 return 0;
2728 }
2729
2730 spin_lock_bh(&adapter->mcc_lock);
2731
2732 wrb = wrb_from_mccq(adapter);
2733 if (!wrb) {
2734 status = -EBUSY;
2735 goto err;
2736 }
2737
2738 req = embedded_payload(wrb);
2739
2740 be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
2741 OPCODE_COMMON_GET_PORT_NAME, sizeof(*req), wrb,
2742 NULL);
2743 req->hdr.version = 1;
2744
2745 status = be_mcc_notify_wait(adapter);
2746 if (!status) {
2747 struct be_cmd_resp_get_port_name *resp = embedded_payload(wrb);
2748 *port_name = resp->port_name[adapter->hba_port_num];
2749 } else {
2750 *port_name = adapter->hba_port_num + '0';
2751 }
2752err:
2753 spin_unlock_bh(&adapter->mcc_lock);
2754 return status;
2755}
2756
2719int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload, 2757int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
2720 int wrb_payload_size, u16 *cmd_status, u16 *ext_status) 2758 int wrb_payload_size, u16 *cmd_status, u16 *ext_status)
2721{ 2759{