Skip to content

Commit 7dfefd0

Browse files
pgreenwaanguy11
authored andcommitted
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. Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com> Tested-by: Pucha Himasekhar Reddy <himasekharx.reddy.pucha@intel.com> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent d47bf9a commit 7dfefd0

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

drivers/net/ethernet/intel/ice/ice_controlq.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,16 +510,19 @@ static int ice_shutdown_sq(struct ice_hw *hw, struct ice_ctl_q_info *cq)
510510
*/
511511
static bool ice_aq_ver_check(struct ice_hw *hw)
512512
{
513-
if (hw->api_maj_ver > EXP_FW_API_VER_MAJOR) {
513+
u8 exp_fw_api_ver_major = EXP_FW_API_VER_MAJOR_BY_MAC(hw);
514+
u8 exp_fw_api_ver_minor = EXP_FW_API_VER_MINOR_BY_MAC(hw);
515+
516+
if (hw->api_maj_ver > exp_fw_api_ver_major) {
514517
/* Major API version is newer than expected, don't load */
515518
dev_warn(ice_hw_to_dev(hw),
516519
"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");
517520
return false;
518-
} else if (hw->api_maj_ver == EXP_FW_API_VER_MAJOR) {
519-
if (hw->api_min_ver > (EXP_FW_API_VER_MINOR + 2))
521+
} else if (hw->api_maj_ver == exp_fw_api_ver_major) {
522+
if (hw->api_min_ver > (exp_fw_api_ver_minor + 2))
520523
dev_info(ice_hw_to_dev(hw),
521524
"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");
522-
else if ((hw->api_min_ver + 2) < EXP_FW_API_VER_MINOR)
525+
else if ((hw->api_min_ver + 2) < exp_fw_api_ver_minor)
523526
dev_info(ice_hw_to_dev(hw),
524527
"The driver for the device detected an older version of the NVM image than expected. Please update the NVM image.\n");
525528
} else {

drivers/net/ethernet/intel/ice/ice_controlq.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@
2121
/* Defines that help manage the driver vs FW API checks.
2222
* Take a look at ice_aq_ver_check in ice_controlq.c for actual usage.
2323
*/
24-
#define EXP_FW_API_VER_BRANCH 0x00
25-
#define EXP_FW_API_VER_MAJOR 0x01
26-
#define EXP_FW_API_VER_MINOR 0x05
24+
#define EXP_FW_API_VER_MAJOR_E810 0x01
25+
#define EXP_FW_API_VER_MINOR_E810 0x05
26+
27+
#define EXP_FW_API_VER_MAJOR_E830 0x01
28+
#define EXP_FW_API_VER_MINOR_E830 0x07
29+
30+
#define EXP_FW_API_VER_MAJOR_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \
31+
EXP_FW_API_VER_MAJOR_E830 : \
32+
EXP_FW_API_VER_MAJOR_E810)
33+
#define EXP_FW_API_VER_MINOR_BY_MAC(hw) ((hw)->mac_type == ICE_MAC_E830 ? \
34+
EXP_FW_API_VER_MINOR_E830 : \
35+
EXP_FW_API_VER_MINOR_E810)
2736

2837
/* Different control queue types: These are mainly for SW consumption. */
2938
enum ice_ctl_q {

0 commit comments

Comments
 (0)