diff options
author | Anirban Chakraborty <anirban.chakraborty@qlogic.com> | 2011-07-29 09:30:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-01 03:12:00 -0400 |
commit | 3d46512c642248fcb33f3b3ee2b2a80e2b09cd9c (patch) | |
tree | 327dca93129889ebd0329ced5f548fae5adfd483 | |
parent | 51f675fd236a41e3fdb18f6e24fbaeaac4802a9b (diff) |
qlcnic: FW dump related changes
o Added code to support FW reset without invoking the dump
o Fixed the return value of the dump data size if dump is not available.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ethtool.c | 22 |
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index baf646d98fa0..4200ef81ca8e 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -1344,6 +1344,7 @@ enum op_codes { | |||
1344 | #define QLCNIC_FORCE_FW_DUMP_KEY 0xdeadfeed | 1344 | #define QLCNIC_FORCE_FW_DUMP_KEY 0xdeadfeed |
1345 | #define QLCNIC_ENABLE_FW_DUMP 0xaddfeed | 1345 | #define QLCNIC_ENABLE_FW_DUMP 0xaddfeed |
1346 | #define QLCNIC_DISABLE_FW_DUMP 0xbadfeed | 1346 | #define QLCNIC_DISABLE_FW_DUMP 0xbadfeed |
1347 | #define QLCNIC_FORCE_FW_RESET 0xdeaddead | ||
1347 | 1348 | ||
1348 | struct qlcnic_dump_operations { | 1349 | struct qlcnic_dump_operations { |
1349 | enum op_codes opcode; | 1350 | enum op_codes opcode; |
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c index 72a723d5c988..7c64f2ffc219 100644 --- a/drivers/net/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/qlcnic/qlcnic_ethtool.c | |||
@@ -1105,7 +1105,10 @@ qlcnic_get_dump_flag(struct net_device *netdev, struct ethtool_dump *dump) | |||
1105 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1105 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1106 | struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; | 1106 | struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; |
1107 | 1107 | ||
1108 | dump->len = fw_dump->tmpl_hdr->size + fw_dump->size; | 1108 | if (fw_dump->clr) |
1109 | dump->len = fw_dump->tmpl_hdr->size + fw_dump->size; | ||
1110 | else | ||
1111 | dump->len = 0; | ||
1109 | dump->flag = fw_dump->tmpl_hdr->drv_cap_mask; | 1112 | dump->flag = fw_dump->tmpl_hdr->drv_cap_mask; |
1110 | dump->version = adapter->fw_version; | 1113 | dump->version = adapter->fw_version; |
1111 | return 0; | 1114 | return 0; |
@@ -1152,7 +1155,8 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1152 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1155 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1153 | struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; | 1156 | struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; |
1154 | 1157 | ||
1155 | if (val->flag == QLCNIC_FORCE_FW_DUMP_KEY) { | 1158 | switch (val->flag) { |
1159 | case QLCNIC_FORCE_FW_DUMP_KEY: | ||
1156 | if (!fw_dump->enable) { | 1160 | if (!fw_dump->enable) { |
1157 | netdev_info(netdev, "FW dump not enabled\n"); | 1161 | netdev_info(netdev, "FW dump not enabled\n"); |
1158 | return ret; | 1162 | return ret; |
@@ -1164,17 +1168,25 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1164 | } | 1168 | } |
1165 | netdev_info(netdev, "Forcing a FW dump\n"); | 1169 | netdev_info(netdev, "Forcing a FW dump\n"); |
1166 | qlcnic_dev_request_reset(adapter); | 1170 | qlcnic_dev_request_reset(adapter); |
1167 | } else if (val->flag == QLCNIC_DISABLE_FW_DUMP) { | 1171 | break; |
1172 | case QLCNIC_DISABLE_FW_DUMP: | ||
1168 | if (fw_dump->enable) { | 1173 | if (fw_dump->enable) { |
1169 | netdev_info(netdev, "Disabling FW dump\n"); | 1174 | netdev_info(netdev, "Disabling FW dump\n"); |
1170 | fw_dump->enable = 0; | 1175 | fw_dump->enable = 0; |
1171 | } | 1176 | } |
1172 | } else if (val->flag == QLCNIC_ENABLE_FW_DUMP) { | 1177 | break; |
1178 | case QLCNIC_ENABLE_FW_DUMP: | ||
1173 | if (!fw_dump->enable && fw_dump->tmpl_hdr) { | 1179 | if (!fw_dump->enable && fw_dump->tmpl_hdr) { |
1174 | netdev_info(netdev, "Enabling FW dump\n"); | 1180 | netdev_info(netdev, "Enabling FW dump\n"); |
1175 | fw_dump->enable = 1; | 1181 | fw_dump->enable = 1; |
1176 | } | 1182 | } |
1177 | } else { | 1183 | break; |
1184 | case QLCNIC_FORCE_FW_RESET: | ||
1185 | netdev_info(netdev, "Forcing a FW reset\n"); | ||
1186 | qlcnic_dev_request_reset(adapter); | ||
1187 | adapter->flags &= ~QLCNIC_FW_RESET_OWNER; | ||
1188 | break; | ||
1189 | default: | ||
1178 | if (val->flag > QLCNIC_DUMP_MASK_MAX || | 1190 | if (val->flag > QLCNIC_DUMP_MASK_MAX || |
1179 | val->flag < QLCNIC_DUMP_MASK_MIN) { | 1191 | val->flag < QLCNIC_DUMP_MASK_MIN) { |
1180 | netdev_info(netdev, | 1192 | netdev_info(netdev, |