ice: Allow different FW API versions based on MAC type
Subsystems (2)
PATCH 1/1 ice: Allow different FW API versions based on MAC type
Allow the driver to be compatible with different FW API versions based on the device's MAC type. Currently, E810 is only compatible with one FW API version. Now the driver can be compatible with different FW API versions for both E810 and E830. For example, E810 FW API version is 1.5.0 and E830 is 1.7.0.
--- drivers/net/ethernet/intel/ice/ice_controlq.c | 11 ++++++---- drivers/net/ethernet/intel/ice/ice_controlq.h | 20 ++++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-)
drivers/net/ethernet/intel/ice/ice_controlq.c +7 -4
@@ -510,16 +510,19 @@ static int ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)*/ static bool ice_aq_ver_check (struct ice_hw *hw) { -if (hw->api_maj_ver >EXP_FW_API_VER_MAJOR ) { +u8 exp_fw_api_ver_major =EXP_FW_API_VER_MAJOR_BY_MAC (hw); +u8 exp_fw_api_ver_minor =EXP_FW_API_VER_MINOR_BY_MAC (hw); + +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 )) + }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 ) +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 {
drivers/net/ethernet/intel/ice/ice_controlq.h +17 -3
@@ -21,9 +21,23 @@/* Defines that help manage the driver vs FW API checks. * Take a look at ice_aq_ver_check in ice_controlq.c for actual usage. */ -#define EXP_FW_API_VER_BRANCH 0x00 -#define EXP_FW_API_VER_MAJOR 0x01 -#define EXP_FW_API_VER_MINOR 0x05 +#define EXP_FW_API_VER_BRANCH_E810 0x00 +#define EXP_FW_API_VER_MAJOR_E810 0x01 +#define EXP_FW_API_VER_MINOR_E810 0x05 + +#define EXP_FW_API_VER_BRANCH_E830 0x00 +#define EXP_FW_API_VER_MAJOR_E830 0x01 +#define EXP_FW_API_VER_MINOR_E830 0x07 + +#define EXP_FW_API_VER_BRANCH_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_BRANCH_E830 : \ + EXP_FW_API_VER_BRANCH_E810) +#define EXP_FW_API_VER_MAJOR_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_MAJOR_E830 : \ + EXP_FW_API_VER_MAJOR_E810) +#define EXP_FW_API_VER_MINOR_BY_MAC (hw) ((hw)->mac_type == ICE_MAC_E830 ? \ + EXP_FW_API_VER_MINOR_E830 : \ + EXP_FW_API_VER_MINOR_E810)/* Different control queue types: These are mainly for SW consumption. */ enum ice_ctl_q {
Signature · 1 line
2.41.0
Quoted 7 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Paul Greenwalt
Sent: Thursday, June 6, 2024 7:19 PM
To: [email protected]
Cc: Greenwalt, Paul <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-next v1] ice: Allow different FW API versions based on MAC type
Quoted 8 lines
Allow the driver to be compatible with different FW API versions based on the device's MAC type. Currently, E810 is only compatible with one FW API version. Now the driver can be compatible with different FW API versions for both E810 and E830. For example, E810 FW API version is 1.5.0 and E830 is 1.7.0.
Signed-off-by Paul Greenwalt <[email protected]>--- drivers/net/ethernet/intel/ice/ice_controlq.c | 11 ++++++---- drivers/net/ethernet/intel/ice/ice_controlq.h | 20 ++++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-)