Commit b4e32a71 authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

be2net: Fix port name in message during driver load

Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 19d59aa7
......@@ -2716,6 +2716,44 @@ int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
return status;
}
int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name)
{
struct be_mcc_wrb *wrb;
struct be_cmd_req_get_port_name *req;
int status;
if (!lancer_chip(adapter)) {
*port_name = adapter->hba_port_num + '0';
return 0;
}
spin_lock_bh(&adapter->mcc_lock);
wrb = wrb_from_mccq(adapter);
if (!wrb) {
status = -EBUSY;
goto err;
}
req = embedded_payload(wrb);
be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_GET_PORT_NAME, sizeof(*req), wrb,
NULL);
req->hdr.version = 1;
status = be_mcc_notify_wait(adapter);
if (!status) {
struct be_cmd_resp_get_port_name *resp = embedded_payload(wrb);
*port_name = resp->port_name[adapter->hba_port_num];
} else {
*port_name = adapter->hba_port_num + '0';
}
err:
spin_unlock_bh(&adapter->mcc_lock);
return status;
}
int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
int wrb_payload_size, u16 *cmd_status, u16 *ext_status)
{
......
......@@ -186,6 +186,7 @@ struct be_mcc_mailbox {
#define OPCODE_COMMON_ENABLE_DISABLE_BEACON 69
#define OPCODE_COMMON_GET_BEACON_STATE 70
#define OPCODE_COMMON_READ_TRANSRECV_DATA 73
#define OPCODE_COMMON_GET_PORT_NAME 77
#define OPCODE_COMMON_GET_PHY_DETAILS 102
#define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
#define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
......@@ -1506,6 +1507,17 @@ struct be_cmd_resp_get_hsw_config {
u32 rsvd;
};
/******************* get port names ***************/
struct be_cmd_req_get_port_name {
struct be_cmd_req_hdr hdr;
u32 rsvd0;
};
struct be_cmd_resp_get_port_name {
struct be_cmd_req_hdr hdr;
u8 port_name[4];
};
/*************** HW Stats Get v1 **********************************/
#define BE_TXP_SW_SZ 48
struct be_port_rxf_stats_v1 {
......@@ -1772,4 +1784,5 @@ extern int be_cmd_set_ext_fat_capabilites(struct be_adapter *adapter,
struct be_fat_conf_params *cfgs);
extern int lancer_wait_ready(struct be_adapter *adapter);
extern int lancer_test_and_set_rdy_state(struct be_adapter *adapter);
extern int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name);
......@@ -3797,6 +3797,7 @@ static int __devinit be_probe(struct pci_dev *pdev,
int status = 0;
struct be_adapter *adapter;
struct net_device *netdev;
char port_name;
status = pci_enable_device(pdev);
if (status)
......@@ -3887,8 +3888,11 @@ static int __devinit be_probe(struct pci_dev *pdev,
schedule_delayed_work(&adapter->func_recovery_work,
msecs_to_jiffies(1000));
dev_info(&pdev->dev, "%s: %s port %d\n", netdev->name, nic_name(pdev),
adapter->port_num);
be_cmd_query_port_name(adapter, &port_name);
dev_info(&pdev->dev, "%s: %s port %c\n", netdev->name, nic_name(pdev),
port_name);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment