Commit b36e4820 authored by Rick Farrington's avatar Rick Farrington Committed by David S. Miller

liquidio: verify firmware version when auto-loaded from flash.

Signed-off-by: default avatarRick Farrington <ricardo.farrington@cavium.com>
Signed-off-by: default avatarFelix Manlunas <felix.manlunas@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 088b8749
...@@ -3303,7 +3303,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev) ...@@ -3303,7 +3303,7 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
{ {
struct lio *lio = NULL; struct lio *lio = NULL;
struct net_device *netdev; struct net_device *netdev;
u8 mac[6], i, j; u8 mac[6], i, j, *fw_ver;
struct octeon_soft_command *sc; struct octeon_soft_command *sc;
struct liquidio_if_cfg_context *ctx; struct liquidio_if_cfg_context *ctx;
struct liquidio_if_cfg_resp *resp; struct liquidio_if_cfg_resp *resp;
...@@ -3414,6 +3414,22 @@ static int setup_nic_devices(struct octeon_device *octeon_dev) ...@@ -3414,6 +3414,22 @@ static int setup_nic_devices(struct octeon_device *octeon_dev)
goto setup_nic_dev_fail; goto setup_nic_dev_fail;
} }
/* Verify f/w version (in case of 'auto' loading from flash) */
fw_ver = octeon_dev->fw_info.liquidio_firmware_version;
if (memcmp(LIQUIDIO_BASE_VERSION,
fw_ver,
strlen(LIQUIDIO_BASE_VERSION))) {
dev_err(&octeon_dev->pci_dev->dev,
"Unmatched firmware version. Expected %s.x, got %s.\n",
LIQUIDIO_BASE_VERSION, fw_ver);
goto setup_nic_dev_fail;
} else if (atomic_read(octeon_dev->adapter_fw_state) ==
FW_IS_PRELOADED) {
dev_info(&octeon_dev->pci_dev->dev,
"Using auto-loaded firmware version %s.\n",
fw_ver);
}
octeon_swap_8B_data((u64 *)(&resp->cfg_info), octeon_swap_8B_data((u64 *)(&resp->cfg_info),
(sizeof(struct liquidio_if_cfg_info)) >> 3); (sizeof(struct liquidio_if_cfg_info)) >> 3);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment