aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_init.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_init.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/drivers/net/qlcnic/qlcnic_init.c b/drivers/net/qlcnic/qlcnic_init.c
index 317750d67931..2bd00d54dd3f 100644
--- a/drivers/net/qlcnic/qlcnic_init.c
+++ b/drivers/net/qlcnic/qlcnic_init.c
@@ -543,16 +543,34 @@ qlcnic_setup_idc_param(struct qlcnic_adapter *adapter) {
543 return 0; 543 return 0;
544} 544}
545 545
546int
547qlcnic_check_flash_fw_ver(struct qlcnic_adapter *adapter)
548{
549 u32 ver = -1, min_ver;
550
551 qlcnic_rom_fast_read(adapter, QLCNIC_FW_VERSION_OFFSET, (int *)&ver);
552
553 ver = QLCNIC_DECODE_VERSION(ver);
554 min_ver = QLCNIC_MIN_FW_VERSION;
555
556 if (ver < min_ver) {
557 dev_err(&adapter->pdev->dev,
558 "firmware version %d.%d.%d unsupported."
559 "Min supported version %d.%d.%d\n",
560 _major(ver), _minor(ver), _build(ver),
561 _major(min_ver), _minor(min_ver), _build(min_ver));
562 return -EINVAL;
563 }
564
565 return 0;
566}
567
546static int 568static int
547qlcnic_has_mn(struct qlcnic_adapter *adapter) 569qlcnic_has_mn(struct qlcnic_adapter *adapter)
548{ 570{
549 u32 capability, flashed_ver; 571 u32 capability;
550 capability = 0; 572 capability = 0;
551 573
552 qlcnic_rom_fast_read(adapter,
553 QLCNIC_FW_VERSION_OFFSET, (int *)&flashed_ver);
554 flashed_ver = QLCNIC_DECODE_VERSION(flashed_ver);
555
556 capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY); 574 capability = QLCRD32(adapter, QLCNIC_PEG_TUNE_CAPABILITY);
557 if (capability & QLCNIC_PEG_TUNE_MN_PRESENT) 575 if (capability & QLCNIC_PEG_TUNE_MN_PRESENT)
558 return 1; 576 return 1;
@@ -1006,7 +1024,7 @@ static int
1006qlcnic_validate_firmware(struct qlcnic_adapter *adapter) 1024qlcnic_validate_firmware(struct qlcnic_adapter *adapter)
1007{ 1025{
1008 __le32 val; 1026 __le32 val;
1009 u32 ver, min_ver, bios, min_size; 1027 u32 ver, bios, min_size;
1010 struct pci_dev *pdev = adapter->pdev; 1028 struct pci_dev *pdev = adapter->pdev;
1011 const struct firmware *fw = adapter->fw; 1029 const struct firmware *fw = adapter->fw;
1012 u8 fw_type = adapter->fw_type; 1030 u8 fw_type = adapter->fw_type;
@@ -1028,12 +1046,9 @@ qlcnic_validate_firmware(struct qlcnic_adapter *adapter)
1028 return -EINVAL; 1046 return -EINVAL;
1029 1047
1030 val = qlcnic_get_fw_version(adapter); 1048 val = qlcnic_get_fw_version(adapter);
1031
1032 min_ver = QLCNIC_VERSION_CODE(4, 0, 216);
1033
1034 ver = QLCNIC_DECODE_VERSION(val); 1049 ver = QLCNIC_DECODE_VERSION(val);
1035 1050
1036 if ((_major(ver) > _QLCNIC_LINUX_MAJOR) || (ver < min_ver)) { 1051 if (ver < QLCNIC_MIN_FW_VERSION) {
1037 dev_err(&pdev->dev, 1052 dev_err(&pdev->dev,
1038 "%s: firmware version %d.%d.%d unsupported\n", 1053 "%s: firmware version %d.%d.%d unsupported\n",
1039 fw_name[fw_type], _major(ver), _minor(ver), _build(ver)); 1054 fw_name[fw_type], _major(ver), _minor(ver), _build(ver));