diff options
author | Rick Farrington <ricardo.farrington@cavium.com> | 2018-07-06 21:27:07 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-07 05:10:35 +0300 |
commit | 4fed38cf26278e6597b506e62a9156e45cbcec49 (patch) | |
tree | 91b7875feb8ddd5807db2a60c50bceeb4e7c4135 /drivers/net/ethernet/cavium/liquidio/octeon_device.h | |
parent | 9ebcb397aaaf6a18d35db0168375e183e9170f53 (diff) | |
download | linux-4fed38cf26278e6597b506e62a9156e45cbcec49.tar.xz |
liquidio: fix kernel panic when NIC firmware is older than 1.7.2
Pre-1.7.2 NIC firmware does not support (and does not respond to) the "get
speed" command which is sent by the 1.7.2 driver (for CN23XX-225 cards
only) during modprobe. Due to a bug in older firmware (with respect to
unknown commands), this unsupported command causes a cascade of errors that
ends in a kernel panic.
Fix it by making the sending of the "get speed" command conditional on the
firmware version.
Signed-off-by: Rick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cavium/liquidio/octeon_device.h')
-rw-r--r-- | drivers/net/ethernet/cavium/liquidio/octeon_device.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/ethernet/cavium/liquidio/octeon_device.h b/drivers/net/ethernet/cavium/liquidio/octeon_device.h index 94a4ed88d618..d99ca6ba23a4 100644 --- a/drivers/net/ethernet/cavium/liquidio/octeon_device.h +++ b/drivers/net/ethernet/cavium/liquidio/octeon_device.h @@ -288,8 +288,17 @@ struct oct_fw_info { */ u32 app_mode; char liquidio_firmware_version[32]; + /* Fields extracted from legacy string 'liquidio_firmware_version' */ + struct { + u8 maj; + u8 min; + u8 rev; + } ver; }; +#define OCT_FW_VER(maj, min, rev) \ + (((u32)(maj) << 16) | ((u32)(min) << 8) | ((u32)(rev))) + /* wrappers around work structs */ struct cavium_wk { struct delayed_work work; |