diff options
author | Manish Chopra <manish.chopra@qlogic.com> | 2012-04-26 06:31:31 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-27 00:03:35 -0400 |
commit | 4fbec4d86f7a1b4dbaddecda24da08b5473cd289 (patch) | |
tree | acaeaab06b96ec6ec23779f90f9185d39ae80b53 | |
parent | 54a8997c6a0266a91a287b5dcb05da394ac0e42a (diff) |
qlcnic: Allow a predefined set of capture masks for FW dump
o 0x3, 0x7, 0xF, 0x1F, 0x3F, 0x7F and 0xFF are the allowed capture masks.
o Updated driver version to 5.0.28
Signed-off-by: Manish chopra <manish.chopra@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 34 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h | 4 |
3 files changed, 24 insertions, 18 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h index a7e2f7453b90..8680a5dae4a2 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | |||
@@ -36,8 +36,8 @@ | |||
36 | 36 | ||
37 | #define _QLCNIC_LINUX_MAJOR 5 | 37 | #define _QLCNIC_LINUX_MAJOR 5 |
38 | #define _QLCNIC_LINUX_MINOR 0 | 38 | #define _QLCNIC_LINUX_MINOR 0 |
39 | #define _QLCNIC_LINUX_SUBVERSION 27 | 39 | #define _QLCNIC_LINUX_SUBVERSION 28 |
40 | #define QLCNIC_LINUX_VERSIONID "5.0.27" | 40 | #define QLCNIC_LINUX_VERSIONID "5.0.28" |
41 | #define QLCNIC_DRV_IDC_VER 0x01 | 41 | #define QLCNIC_DRV_IDC_VER 0x01 |
42 | #define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ | 42 | #define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ |
43 | (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) | 43 | (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION)) |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 5f2ad819a517..735423f7273f 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -1278,7 +1278,7 @@ qlcnic_get_dump_data(struct net_device *netdev, struct ethtool_dump *dump, | |||
1278 | static int | 1278 | static int |
1279 | qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | 1279 | qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) |
1280 | { | 1280 | { |
1281 | int ret = 0; | 1281 | int i; |
1282 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 1282 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
1283 | struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; | 1283 | struct qlcnic_fw_dump *fw_dump = &adapter->ahw->fw_dump; |
1284 | u32 state; | 1284 | u32 state; |
@@ -1291,12 +1291,12 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1291 | } | 1291 | } |
1292 | if (!fw_dump->enable) { | 1292 | if (!fw_dump->enable) { |
1293 | netdev_info(netdev, "FW dump not enabled\n"); | 1293 | netdev_info(netdev, "FW dump not enabled\n"); |
1294 | return ret; | 1294 | return 0; |
1295 | } | 1295 | } |
1296 | if (fw_dump->clr) { | 1296 | if (fw_dump->clr) { |
1297 | netdev_info(netdev, | 1297 | netdev_info(netdev, |
1298 | "Previous dump not cleared, not forcing dump\n"); | 1298 | "Previous dump not cleared, not forcing dump\n"); |
1299 | return ret; | 1299 | return 0; |
1300 | } | 1300 | } |
1301 | netdev_info(netdev, "Forcing a FW dump\n"); | 1301 | netdev_info(netdev, "Forcing a FW dump\n"); |
1302 | qlcnic_dev_request_reset(adapter); | 1302 | qlcnic_dev_request_reset(adapter); |
@@ -1306,7 +1306,7 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1306 | netdev_info(netdev, "Disabling FW dump\n"); | 1306 | netdev_info(netdev, "Disabling FW dump\n"); |
1307 | fw_dump->enable = 0; | 1307 | fw_dump->enable = 0; |
1308 | } | 1308 | } |
1309 | return ret; | 1309 | return 0; |
1310 | case QLCNIC_ENABLE_FW_DUMP: | 1310 | case QLCNIC_ENABLE_FW_DUMP: |
1311 | if (!fw_dump->tmpl_hdr) { | 1311 | if (!fw_dump->tmpl_hdr) { |
1312 | netdev_err(netdev, "FW dump not supported\n"); | 1312 | netdev_err(netdev, "FW dump not supported\n"); |
@@ -1316,34 +1316,36 @@ qlcnic_set_dump(struct net_device *netdev, struct ethtool_dump *val) | |||
1316 | netdev_info(netdev, "Enabling FW dump\n"); | 1316 | netdev_info(netdev, "Enabling FW dump\n"); |
1317 | fw_dump->enable = 1; | 1317 | fw_dump->enable = 1; |
1318 | } | 1318 | } |
1319 | return ret; | 1319 | return 0; |
1320 | case QLCNIC_FORCE_FW_RESET: | 1320 | case QLCNIC_FORCE_FW_RESET: |
1321 | netdev_info(netdev, "Forcing a FW reset\n"); | 1321 | netdev_info(netdev, "Forcing a FW reset\n"); |
1322 | qlcnic_dev_request_reset(adapter); | 1322 | qlcnic_dev_request_reset(adapter); |
1323 | adapter->flags &= ~QLCNIC_FW_RESET_OWNER; | 1323 | adapter->flags &= ~QLCNIC_FW_RESET_OWNER; |
1324 | return ret; | 1324 | return 0; |
1325 | case QLCNIC_SET_QUIESCENT: | 1325 | case QLCNIC_SET_QUIESCENT: |
1326 | case QLCNIC_RESET_QUIESCENT: | 1326 | case QLCNIC_RESET_QUIESCENT: |
1327 | state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE); | 1327 | state = QLCRD32(adapter, QLCNIC_CRB_DEV_STATE); |
1328 | if (state == QLCNIC_DEV_FAILED || (state == QLCNIC_DEV_BADBAD)) | 1328 | if (state == QLCNIC_DEV_FAILED || (state == QLCNIC_DEV_BADBAD)) |
1329 | netdev_info(netdev, "Device in FAILED state\n"); | 1329 | netdev_info(netdev, "Device in FAILED state\n"); |
1330 | return ret; | 1330 | return 0; |
1331 | default: | 1331 | default: |
1332 | if (!fw_dump->tmpl_hdr) { | 1332 | if (!fw_dump->tmpl_hdr) { |
1333 | netdev_err(netdev, "FW dump not supported\n"); | 1333 | netdev_err(netdev, "FW dump not supported\n"); |
1334 | return -ENOTSUPP; | 1334 | return -ENOTSUPP; |
1335 | } | 1335 | } |
1336 | if (val->flag > QLCNIC_DUMP_MASK_MAX || | 1336 | for (i = 0; i < ARRAY_SIZE(FW_DUMP_LEVELS); i++) { |
1337 | val->flag < QLCNIC_DUMP_MASK_MIN) { | 1337 | if (val->flag == FW_DUMP_LEVELS[i]) { |
1338 | netdev_info(netdev, | 1338 | fw_dump->tmpl_hdr->drv_cap_mask = |
1339 | "Invalid dump level: 0x%x\n", val->flag); | 1339 | val->flag; |
1340 | return -EINVAL; | 1340 | netdev_info(netdev, "Driver mask changed to: 0x%x\n", |
1341 | fw_dump->tmpl_hdr->drv_cap_mask); | ||
1342 | return 0; | ||
1343 | } | ||
1341 | } | 1344 | } |
1342 | fw_dump->tmpl_hdr->drv_cap_mask = val->flag & 0xff; | 1345 | netdev_info(netdev, "Invalid dump level: 0x%x\n", val->flag); |
1343 | netdev_info(netdev, "Driver mask changed to: 0x%x\n", | 1346 | return -EINVAL; |
1344 | fw_dump->tmpl_hdr->drv_cap_mask); | ||
1345 | } | 1347 | } |
1346 | return ret; | 1348 | return 0; |
1347 | } | 1349 | } |
1348 | 1350 | ||
1349 | const struct ethtool_ops qlcnic_ethtool_ops = { | 1351 | const struct ethtool_ops qlcnic_ethtool_ops = { |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h index e6a77feeb44a..6ced3195aad3 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h | |||
@@ -778,6 +778,10 @@ struct qlcnic_legacy_intr_set { | |||
778 | #define FLASH_ROM_WINDOW 0x42110030 | 778 | #define FLASH_ROM_WINDOW 0x42110030 |
779 | #define FLASH_ROM_DATA 0x42150000 | 779 | #define FLASH_ROM_DATA 0x42150000 |
780 | 780 | ||
781 | |||
782 | static const u32 FW_DUMP_LEVELS[] = { | ||
783 | 0x3, 0x7, 0xf, 0x1f, 0x3f, 0x7f, 0xff }; | ||
784 | |||
781 | static const u32 MIU_TEST_READ_DATA[] = { | 785 | static const u32 MIU_TEST_READ_DATA[] = { |
782 | 0x410000A8, 0x410000AC, 0x410000B8, 0x410000BC, }; | 786 | 0x410000A8, 0x410000AC, 0x410000B8, 0x410000BC, }; |
783 | 787 | ||