diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_controlq.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_controlq.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_controlq.c b/drivers/net/ethernet/intel/ice/ice_controlq.c index 6cd86cff6a23..b25ce4f587f5 100644 --- a/drivers/net/ethernet/intel/ice/ice_controlq.c +++ b/drivers/net/ethernet/intel/ice/ice_controlq.c | |||
@@ -518,22 +518,31 @@ shutdown_sq_out: | |||
518 | 518 | ||
519 | /** | 519 | /** |
520 | * ice_aq_ver_check - Check the reported AQ API version. | 520 | * ice_aq_ver_check - Check the reported AQ API version. |
521 | * @fw_branch: The "branch" of FW, typically describes the device type | 521 | * @hw: pointer to the hardware structure |
522 | * @fw_major: The major version of the FW API | ||
523 | * @fw_minor: The minor version increment of the FW API | ||
524 | * | 522 | * |
525 | * Checks if the driver should load on a given AQ API version. | 523 | * Checks if the driver should load on a given AQ API version. |
526 | * | 524 | * |
527 | * Return: 'true' iff the driver should attempt to load. 'false' otherwise. | 525 | * Return: 'true' iff the driver should attempt to load. 'false' otherwise. |
528 | */ | 526 | */ |
529 | static bool ice_aq_ver_check(u8 fw_branch, u8 fw_major, u8 fw_minor) | 527 | static bool ice_aq_ver_check(struct ice_hw *hw) |
530 | { | 528 | { |
531 | if (fw_branch != EXP_FW_API_VER_BRANCH) | 529 | if (hw->api_maj_ver > EXP_FW_API_VER_MAJOR) { |
532 | return false; | 530 | /* Major API version is newer than expected, don't load */ |
533 | if (fw_major != EXP_FW_API_VER_MAJOR) | 531 | dev_warn(ice_hw_to_dev(hw), |
534 | return false; | 532 | "The driver for the device stopped because the NVM image is newer than expected. You must install the most recent version of the network driver.\n"); |
535 | if (fw_minor != EXP_FW_API_VER_MINOR) | ||
536 | return false; | 533 | return false; |
534 | } else if (hw->api_maj_ver == EXP_FW_API_VER_MAJOR) { | ||
535 | if (hw->api_min_ver > (EXP_FW_API_VER_MINOR + 2)) | ||
536 | dev_info(ice_hw_to_dev(hw), | ||
537 | "The driver for the device detected a newer version of the NVM image than expected. Please install the most recent version of the network driver.\n"); | ||
538 | else if ((hw->api_min_ver + 2) < EXP_FW_API_VER_MINOR) | ||
539 | dev_info(ice_hw_to_dev(hw), | ||
540 | "The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n"); | ||
541 | } else { | ||
542 | /* Major API version is older than expected, log a warning */ | ||
543 | dev_info(ice_hw_to_dev(hw), | ||
544 | "The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n"); | ||
545 | } | ||
537 | return true; | 546 | return true; |
538 | } | 547 | } |
539 | 548 | ||
@@ -588,8 +597,7 @@ static enum ice_status ice_init_check_adminq(struct ice_hw *hw) | |||
588 | if (status) | 597 | if (status) |
589 | goto init_ctrlq_free_rq; | 598 | goto init_ctrlq_free_rq; |
590 | 599 | ||
591 | if (!ice_aq_ver_check(hw->api_branch, hw->api_maj_ver, | 600 | if (!ice_aq_ver_check(hw)) { |
592 | hw->api_min_ver)) { | ||
593 | status = ICE_ERR_FW_API_VER; | 601 | status = ICE_ERR_FW_API_VER; |
594 | goto init_ctrlq_free_rq; | 602 | goto init_ctrlq_free_rq; |
595 | } | 603 | } |