Commit e97e3cda authored by Kalesh AP's avatar Kalesh AP Committed by David S. Miller

be2net: reduce arguments passed to FW-cmd routines

A pointer to adapter struct is passed anyway to all of the FW-cmd routines
in be_cmds.c. For routines which query data from FW, the adapter pointer
is enough to return the queried fields.
There is no need to separately pass pointers to individual members of
the adapter structure. This patch fixes this for be_cmd_get_fw_ver()
and be_cmd_get_fw_cfg() routines.
Signed-off-by: default avatarKalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6bdf8f55
...@@ -1749,8 +1749,7 @@ void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf) ...@@ -1749,8 +1749,7 @@ void be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
} }
/* Uses synchronous mcc */ /* Uses synchronous mcc */
int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver, int be_cmd_get_fw_ver(struct be_adapter *adapter)
char *fw_on_flash)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_get_fw_version *req; struct be_cmd_req_get_fw_version *req;
...@@ -1772,9 +1771,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver, ...@@ -1772,9 +1771,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver,
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb); struct be_cmd_resp_get_fw_version *resp = embedded_payload(wrb);
strcpy(fw_ver, resp->firmware_version_string); strcpy(adapter->fw_ver, resp->firmware_version_string);
if (fw_on_flash) strcpy(adapter->fw_on_flash, resp->fw_on_flash_version_string);
strcpy(fw_on_flash, resp->fw_on_flash_version_string);
} }
err: err:
spin_unlock_bh(&adapter->mcc_lock); spin_unlock_bh(&adapter->mcc_lock);
...@@ -1997,8 +1995,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc) ...@@ -1997,8 +1995,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
} }
/* Uses mbox */ /* Uses mbox */
int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, int be_cmd_query_fw_cfg(struct be_adapter *adapter)
u32 *mode, u32 *caps, u16 *asic_rev)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_query_fw_cfg *req; struct be_cmd_req_query_fw_cfg *req;
...@@ -2017,10 +2014,10 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, ...@@ -2017,10 +2014,10 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb); struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
*port_num = le32_to_cpu(resp->phys_port); adapter->port_num = le32_to_cpu(resp->phys_port);
*mode = le32_to_cpu(resp->function_mode); adapter->function_mode = le32_to_cpu(resp->function_mode);
*caps = le32_to_cpu(resp->function_caps); adapter->function_caps = le32_to_cpu(resp->function_caps);
*asic_rev = le32_to_cpu(resp->asic_revision) & 0xFF; adapter->asic_rev = le32_to_cpu(resp->asic_revision) & 0xFF;
} }
mutex_unlock(&adapter->mbox_lock); mutex_unlock(&adapter->mbox_lock);
......
...@@ -2071,16 +2071,14 @@ int be_cmd_reset(struct be_adapter *adapter); ...@@ -2071,16 +2071,14 @@ int be_cmd_reset(struct be_adapter *adapter);
int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd); int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd);
int lancer_cmd_get_pport_stats(struct be_adapter *adapter, int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
struct be_dma_mem *nonemb_cmd); struct be_dma_mem *nonemb_cmd);
int be_cmd_get_fw_ver(struct be_adapter *adapter, char *fw_ver, int be_cmd_get_fw_ver(struct be_adapter *adapter);
char *fw_on_flash);
int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *, int num); int be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *, int num);
int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array, int be_cmd_vlan_config(struct be_adapter *adapter, u32 if_id, u16 *vtag_array,
u32 num); u32 num);
int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status); int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 status);
int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc); int be_cmd_set_flow_control(struct be_adapter *adapter, u32 tx_fc, u32 rx_fc);
int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc); int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc);
int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, int be_cmd_query_fw_cfg(struct be_adapter *adapter);
u32 *function_mode, u32 *function_caps, u16 *asic_rev);
int be_cmd_reset_function(struct be_adapter *adapter); int be_cmd_reset_function(struct be_adapter *adapter);
int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
u32 rss_hash_opts, u16 table_size, const u8 *rss_hkey); u32 rss_hash_opts, u16 table_size, const u8 *rss_hkey);
......
...@@ -3425,10 +3425,7 @@ static int be_get_config(struct be_adapter *adapter) ...@@ -3425,10 +3425,7 @@ static int be_get_config(struct be_adapter *adapter)
u16 profile_id; u16 profile_id;
int status; int status;
status = be_cmd_query_fw_cfg(adapter, &adapter->port_num, status = be_cmd_query_fw_cfg(adapter);
&adapter->function_mode,
&adapter->function_caps,
&adapter->asic_rev);
if (status) if (status)
return status; return status;
...@@ -3617,7 +3614,7 @@ static int be_setup(struct be_adapter *adapter) ...@@ -3617,7 +3614,7 @@ static int be_setup(struct be_adapter *adapter)
if (status) if (status)
goto err; goto err;
be_cmd_get_fw_ver(adapter, adapter->fw_ver, adapter->fw_on_flash); be_cmd_get_fw_ver(adapter);
if (BE2_chip(adapter) && fw_major_num(adapter->fw_ver) < 4) { if (BE2_chip(adapter) && fw_major_num(adapter->fw_ver) < 4) {
dev_err(dev, "Firmware on card is old(%s), IRQs may not work.", dev_err(dev, "Firmware on card is old(%s), IRQs may not work.",
...@@ -4247,8 +4244,7 @@ int be_load_fw(struct be_adapter *adapter, u8 *fw_file) ...@@ -4247,8 +4244,7 @@ int be_load_fw(struct be_adapter *adapter, u8 *fw_file)
status = be_fw_download(adapter, fw); status = be_fw_download(adapter, fw);
if (!status) if (!status)
be_cmd_get_fw_ver(adapter, adapter->fw_ver, be_cmd_get_fw_ver(adapter);
adapter->fw_on_flash);
fw_exit: fw_exit:
release_firmware(fw); release_firmware(fw);
......
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