aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
diff options
context:
space:
mode:
authorAnirban Chakraborty <anirban.chakraborty@qlogic.com>2011-06-21 22:52:22 -0400
committerDavid S. Miller <davem@davemloft.net>2011-06-24 04:17:07 -0400
commit9d6a6440fe30132e4d1f1aadd099345ced9178fb (patch)
tree7df4acf3f7442b43daff292dbbab2ad72f6e0b59 /drivers/net/qlcnic
parentc55ad8e56b983f03589b38b4504b5d1f41161ff8 (diff)
qlcnic: Add support to enable/disable FW dump capability
In certain situations, it may be required to not enable FW dump capability. Add support to turn off/on FW dump capability. Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r--drivers/net/qlcnic/qlcnic.h3
-rw-r--r--drivers/net/qlcnic/qlcnic_ctx.c1
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c19
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c8
4 files changed, 28 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index 58d7616eaee2..0be84bdb55b8 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -429,6 +429,7 @@ struct qlcnic_dump_template_hdr {
429 429
430struct qlcnic_fw_dump { 430struct qlcnic_fw_dump {
431 u8 clr; /* flag to indicate if dump is cleared */ 431 u8 clr; /* flag to indicate if dump is cleared */
432 u8 enable; /* enable/disable dump */
432 u32 size; /* total size of the dump */ 433 u32 size; /* total size of the dump */
433 void *data; /* dump data area */ 434 void *data; /* dump data area */
434 struct qlcnic_dump_template_hdr *tmpl_hdr; 435 struct qlcnic_dump_template_hdr *tmpl_hdr;
@@ -1320,6 +1321,8 @@ enum op_codes {
1320#define QLCNIC_DUMP_MASK_DEF 0x7f 1321#define QLCNIC_DUMP_MASK_DEF 0x7f
1321#define QLCNIC_DUMP_MASK_MAX 0xff 1322#define QLCNIC_DUMP_MASK_MAX 0xff
1322#define QLCNIC_FORCE_FW_DUMP_KEY 0xdeadfeed 1323#define QLCNIC_FORCE_FW_DUMP_KEY 0xdeadfeed
1324#define QLCNIC_ENABLE_FW_DUMP 0xaddfeed
1325#define QLCNIC_DISABLE_FW_DUMP 0xbadfeed
1323 1326
1324struct qlcnic_dump_operations { 1327struct qlcnic_dump_operations {
1325 enum op_codes opcode; 1328 enum op_codes opcode;
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c
index be2dee155bd8..33f5c8a8b551 100644
--- a/drivers/net/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/qlcnic/qlcnic_ctx.c
@@ -150,6 +150,7 @@ int qlcnic_fw_cmd_get_minidump_temp(struct qlcnic_adapter *adapter)
150 tmpl_hdr->drv_cap_mask = tmpl_hdr->cap_mask; 150 tmpl_hdr->drv_cap_mask = tmpl_hdr->cap_mask;
151 else 151 else
152 tmpl_hdr->drv_cap_mask = QLCNIC_DUMP_MASK_DEF; 152 tmpl_hdr->drv_cap_mask = QLCNIC_DUMP_MASK_DEF;
153 ahw->fw_dump.enable = 1;
153error: 154error:
154 dma_free_coherent(&adapter->pdev->dev, temp_size, tmp_addr, tmp_addr_t); 155 dma_free_coherent(&adapter->pdev->dev, temp_size, tmp_addr, tmp_addr_t);
155 return err; 156 return err;
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index e183ed2271b2..31f5cba62223 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -1019,8 +1019,27 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val)
1019 struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; 1019 struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump;
1020 1020
1021 if (val->flag == QLCNIC_FORCE_FW_DUMP_KEY) { 1021 if (val->flag == QLCNIC_FORCE_FW_DUMP_KEY) {
1022 if (!fw_dump->enable) {
1023 netdev_info(netdev, "FW dump not enabled\n");
1024 return ret;
1025 }
1026 if (fw_dump->clr) {
1027 dev_info(&adapter->pdev->dev,
1028 "Previous dump not cleared, not forcing dump\n");
1029 return ret;
1030 }
1022 netdev_info(netdev, "Forcing a FW dump\n"); 1031 netdev_info(netdev, "Forcing a FW dump\n");
1023 qlcnic_dev_request_reset(adapter); 1032 qlcnic_dev_request_reset(adapter);
1033 } else if (val->flag == QLCNIC_DISABLE_FW_DUMP) {
1034 if (fw_dump->enable) {
1035 netdev_info(netdev, "Disabling FW dump\n");
1036 fw_dump->enable = 0;
1037 }
1038 } else if (val->flag == QLCNIC_ENABLE_FW_DUMP) {
1039 if (!fw_dump->enable && fw_dump->tmpl_hdr) {
1040 netdev_info(netdev, "Enabling FW dump\n");
1041 fw_dump->enable = 1;
1042 }
1024 } else { 1043 } else {
1025 if (val->flag > QLCNIC_DUMP_MASK_MAX || 1044 if (val->flag > QLCNIC_DUMP_MASK_MAX ||
1026 val->flag < QLCNIC_DUMP_MASK_MIN) { 1045 val->flag < QLCNIC_DUMP_MASK_MIN) {
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 5dcb853224c9..ac7f8a2f7d9c 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2849,9 +2849,11 @@ skip_ack_check:
2849 qlcnic_api_unlock(adapter); 2849 qlcnic_api_unlock(adapter);
2850 2850
2851 rtnl_lock(); 2851 rtnl_lock();
2852 QLCDB(adapter, DRV, "Take FW dump\n"); 2852 if (adapter->ahw->fw_dump.enable) {
2853 qlcnic_dump_fw(adapter); 2853 QLCDB(adapter, DRV, "Take FW dump\n");
2854 adapter->flags &= ~QLCNIC_FW_RESET_OWNER; 2854 qlcnic_dump_fw(adapter);
2855 adapter->flags &= ~QLCNIC_FW_RESET_OWNER;
2856 }
2855 rtnl_unlock(); 2857 rtnl_unlock();
2856 if (!adapter->nic_ops->start_firmware(adapter)) { 2858 if (!adapter->nic_ops->start_firmware(adapter)) {
2857 qlcnic_schedule_work(adapter, qlcnic_attach_work, 0); 2859 qlcnic_schedule_work(adapter, qlcnic_attach_work, 0);