|
@@ -518,22 +518,31 @@ shutdown_sq_out:
|
|
|
|
|
|
/**
|
|
|
* ice_aq_ver_check - Check the reported AQ API version.
|
|
|
- * @fw_branch: The "branch" of FW, typically describes the device type
|
|
|
- * @fw_major: The major version of the FW API
|
|
|
- * @fw_minor: The minor version increment of the FW API
|
|
|
+ * @hw: pointer to the hardware structure
|
|
|
*
|
|
|
* Checks if the driver should load on a given AQ API version.
|
|
|
*
|
|
|
* Return: 'true' iff the driver should attempt to load. 'false' otherwise.
|
|
|
*/
|
|
|
-static bool ice_aq_ver_check(u8 fw_branch, u8 fw_major, u8 fw_minor)
|
|
|
+static bool ice_aq_ver_check(struct ice_hw *hw)
|
|
|
{
|
|
|
- if (fw_branch != EXP_FW_API_VER_BRANCH)
|
|
|
- return false;
|
|
|
- if (fw_major != EXP_FW_API_VER_MAJOR)
|
|
|
- return false;
|
|
|
- if (fw_minor != EXP_FW_API_VER_MINOR)
|
|
|
+ if (hw->api_maj_ver > EXP_FW_API_VER_MAJOR) {
|
|
|
+ /* Major API version is newer than expected, don't load */
|
|
|
+ dev_warn(ice_hw_to_dev(hw),
|
|
|
+ "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");
|
|
|
return false;
|
|
|
+ } else if (hw->api_maj_ver == EXP_FW_API_VER_MAJOR) {
|
|
|
+ if (hw->api_min_ver > (EXP_FW_API_VER_MINOR + 2))
|
|
|
+ dev_info(ice_hw_to_dev(hw),
|
|
|
+ "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");
|
|
|
+ else if ((hw->api_min_ver + 2) < EXP_FW_API_VER_MINOR)
|
|
|
+ dev_info(ice_hw_to_dev(hw),
|
|
|
+ "The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n");
|
|
|
+ } else {
|
|
|
+ /* Major API version is older than expected, log a warning */
|
|
|
+ dev_info(ice_hw_to_dev(hw),
|
|
|
+ "The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n");
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -588,8 +597,7 @@ static enum ice_status ice_init_check_adminq(struct ice_hw *hw)
|
|
|
if (status)
|
|
|
goto init_ctrlq_free_rq;
|
|
|
|
|
|
- if (!ice_aq_ver_check(hw->api_branch, hw->api_maj_ver,
|
|
|
- hw->api_min_ver)) {
|
|
|
+ if (!ice_aq_ver_check(hw)) {
|
|
|
status = ICE_ERR_FW_API_VER;
|
|
|
goto init_ctrlq_free_rq;
|
|
|
}
|