aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/t3_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/cxgb3/t3_hw.c')
-rw-r--r--drivers/net/cxgb3/t3_hw.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index e958bbe30623..2b49b96a6fdb 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -960,16 +960,18 @@ int t3_get_fw_version(struct adapter *adapter, u32 *vers)
960/** 960/**
961 * t3_check_fw_version - check if the FW is compatible with this driver 961 * t3_check_fw_version - check if the FW is compatible with this driver
962 * @adapter: the adapter 962 * @adapter: the adapter
963 * 963 * @must_load: set to 1 if loading a new FW image is required
964
964 * Checks if an adapter's FW is compatible with the driver. Returns 0 965 * Checks if an adapter's FW is compatible with the driver. Returns 0
965 * if the versions are compatible, a negative error otherwise. 966 * if the versions are compatible, a negative error otherwise.
966 */ 967 */
967int t3_check_fw_version(struct adapter *adapter) 968int t3_check_fw_version(struct adapter *adapter, int *must_load)
968{ 969{
969 int ret; 970 int ret;
970 u32 vers; 971 u32 vers;
971 unsigned int type, major, minor; 972 unsigned int type, major, minor;
972 973
974 *must_load = 1;
973 ret = t3_get_fw_version(adapter, &vers); 975 ret = t3_get_fw_version(adapter, &vers);
974 if (ret) 976 if (ret)
975 return ret; 977 return ret;
@@ -982,9 +984,17 @@ int t3_check_fw_version(struct adapter *adapter)
982 minor == FW_VERSION_MINOR) 984 minor == FW_VERSION_MINOR)
983 return 0; 985 return 0;
984 986
985 CH_ERR(adapter, "found wrong FW version(%u.%u), " 987 if (major != FW_VERSION_MAJOR)
986 "driver needs version %u.%u\n", major, minor, 988 CH_ERR(adapter, "found wrong FW version(%u.%u), "
987 FW_VERSION_MAJOR, FW_VERSION_MINOR); 989 "driver needs version %u.%u\n", major, minor,
990 FW_VERSION_MAJOR, FW_VERSION_MINOR);
991 else {
992 *must_load = 0;
993 CH_WARN(adapter, "found wrong FW minor version(%u.%u), "
994 "driver compiled for version %u.%u\n", major, minor,
995 FW_VERSION_MAJOR, FW_VERSION_MINOR);
996 }
997
988 return -EINVAL; 998 return -EINVAL;
989} 999}
990 1000