Commit 4e60ac46 authored by Sony Chacko's avatar Sony Chacko Committed by David S. Miller

qlcnic: 83xx register dump routines

Add 83xx register dump routines
Update 82xx register dump routines
Signed-off-by: default avatarAnirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: default avatarRajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: default avatarSritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: default avatarSony Chacko <sony.chacko@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d71170fb
...@@ -7,4 +7,5 @@ obj-$(CONFIG_QLCNIC) := qlcnic.o ...@@ -7,4 +7,5 @@ obj-$(CONFIG_QLCNIC) := qlcnic.o
qlcnic-y := qlcnic_hw.o qlcnic_main.o qlcnic_init.o \ qlcnic-y := qlcnic_hw.o qlcnic_main.o qlcnic_init.o \
qlcnic_ethtool.o qlcnic_ctx.o qlcnic_io.o \ qlcnic_ethtool.o qlcnic_ctx.o qlcnic_io.o \
qlcnic_sysfs.o qlcnic_minidump.o qlcnic_83xx_hw.o \ qlcnic_sysfs.o qlcnic_minidump.o qlcnic_83xx_hw.o \
qlcnic_83xx_init.o qlcnic_83xx_vnic.o qlcnic_83xx_init.o qlcnic_83xx_vnic.o \
qlcnic_minidump.o
...@@ -375,6 +375,7 @@ struct qlcnic_dump_template_hdr { ...@@ -375,6 +375,7 @@ struct qlcnic_dump_template_hdr {
u32 sys_info[3]; u32 sys_info[3];
u32 saved_state[16]; u32 saved_state[16];
u32 cap_sizes[8]; u32 cap_sizes[8];
u32 ocm_wnd_reg[16];
u32 rsvd[0]; u32 rsvd[0];
}; };
......
...@@ -407,4 +407,6 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *); ...@@ -407,4 +407,6 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *);
int qlcnic_83xx_get_vnic_vport_info(struct qlcnic_adapter *, int qlcnic_83xx_get_vnic_vport_info(struct qlcnic_adapter *,
struct qlcnic_info *, u8); struct qlcnic_info *, u8);
int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *); int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *);
void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *);
#endif #endif
...@@ -1850,9 +1850,15 @@ static int qlcnic_83xx_load_fw_image_from_host(struct qlcnic_adapter *adapter) ...@@ -1850,9 +1850,15 @@ static int qlcnic_83xx_load_fw_image_from_host(struct qlcnic_adapter *adapter)
static int qlcnic_83xx_restart_hw(struct qlcnic_adapter *adapter) static int qlcnic_83xx_restart_hw(struct qlcnic_adapter *adapter)
{ {
u32 val;
int err = -EIO; int err = -EIO;
qlcnic_83xx_stop_hw(adapter); qlcnic_83xx_stop_hw(adapter);
/* Collect FW register dump if required */
val = QLCRDX(adapter->ahw, QLC_83XX_IDC_CTRL);
if (!(val & QLC_83XX_IDC_GRACEFULL_RESET))
qlcnic_dump_fw(adapter);
qlcnic_83xx_init_hw(adapter); qlcnic_83xx_init_hw(adapter);
if (qlcnic_83xx_copy_bootloader(adapter)) if (qlcnic_83xx_copy_bootloader(adapter))
...@@ -1970,6 +1976,7 @@ static int qlcnic_83xx_init_default_driver(struct qlcnic_adapter *adapter) ...@@ -1970,6 +1976,7 @@ static int qlcnic_83xx_init_default_driver(struct qlcnic_adapter *adapter)
{ {
int err = -EIO; int err = -EIO;
qlcnic_83xx_get_minidump_template(adapter);
if (qlcnic_83xx_get_port_info(adapter)) if (qlcnic_83xx_get_port_info(adapter))
return err; return err;
......
...@@ -160,40 +160,6 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter, ...@@ -160,40 +160,6 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
return cmd->rsp.arg[0]; return cmd->rsp.arg[0];
} }
int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
{
int err = 0;
void *tmp_addr;
struct qlcnic_cmd_args cmd;
dma_addr_t tmp_addr_t = 0;
tmp_addr = dma_alloc_coherent(&adapter->pdev->dev, 0x1000,
&tmp_addr_t, GFP_KERNEL);
if (!tmp_addr) {
dev_err(&adapter->pdev->dev,
"Can't get memory for FW dump template\n");
return -ENOMEM;
}
if (qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_GET_TEMP_HDR)) {
err = -ENOMEM;
goto free_mem;
}
cmd.req.arg[1] = LSD(tmp_addr_t);
cmd.req.arg[2] = MSD(tmp_addr_t);
cmd.req.arg[3] = 0x1000;
err = qlcnic_issue_cmd(adapter, &cmd);
qlcnic_free_mbx_args(&cmd);
free_mem:
dma_free_coherent(&adapter->pdev->dev, 0x1000, tmp_addr, tmp_addr_t);
return err;
}
int int
qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu) qlcnic_fw_cmd_set_mtu(struct qlcnic_adapter *adapter, int mtu)
{ {
......
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