diff options
author | Divy Le Ray <divy@chelsio.com> | 2007-09-05 18:58:09 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:03 -0400 |
commit | a5a3b4601bfa3c7671944067d4e4b04bf647e6d9 (patch) | |
tree | 6dc3b626a855bb85fa724041b2fd4369facdada3 | |
parent | 34c6417b7087a4818e7dca2e5d66c3361cee80a1 (diff) |
cxgb3 - Firmware update
Update firmware version.
Allow the driver to be up and running with older FW image
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/cxgb3/common.h | 2 | ||||
-rw-r--r-- | drivers/net/cxgb3/cxgb3_main.c | 9 | ||||
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 20 | ||||
-rw-r--r-- | drivers/net/cxgb3/version.h | 2 |
4 files changed, 22 insertions, 11 deletions
diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h index 510e93f90b91..ada5e4b89cd8 100644 --- a/drivers/net/cxgb3/common.h +++ b/drivers/net/cxgb3/common.h | |||
@@ -690,7 +690,7 @@ int t3_read_flash(struct adapter *adapter, unsigned int addr, | |||
690 | unsigned int nwords, u32 *data, int byte_oriented); | 690 | unsigned int nwords, u32 *data, int byte_oriented); |
691 | int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size); | 691 | int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size); |
692 | int t3_get_fw_version(struct adapter *adapter, u32 *vers); | 692 | int t3_get_fw_version(struct adapter *adapter, u32 *vers); |
693 | int t3_check_fw_version(struct adapter *adapter); | 693 | int t3_check_fw_version(struct adapter *adapter, int *must_load); |
694 | int t3_init_hw(struct adapter *adapter, u32 fw_params); | 694 | int t3_init_hw(struct adapter *adapter, u32 fw_params); |
695 | void mac_prep(struct cmac *mac, struct adapter *adapter, int index); | 695 | void mac_prep(struct cmac *mac, struct adapter *adapter, int index); |
696 | void early_hw_init(struct adapter *adapter, const struct adapter_info *ai); | 696 | void early_hw_init(struct adapter *adapter, const struct adapter_info *ai); |
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c index 3ee465dd0b08..8f1d602a883a 100644 --- a/drivers/net/cxgb3/cxgb3_main.c +++ b/drivers/net/cxgb3/cxgb3_main.c | |||
@@ -797,11 +797,12 @@ static int cxgb_up(struct adapter *adap) | |||
797 | int must_load; | 797 | int must_load; |
798 | 798 | ||
799 | if (!(adap->flags & FULL_INIT_DONE)) { | 799 | if (!(adap->flags & FULL_INIT_DONE)) { |
800 | err = t3_check_fw_version(adap); | 800 | err = t3_check_fw_version(adap, &must_load); |
801 | if (err == -EINVAL) | 801 | if (err == -EINVAL) { |
802 | err = upgrade_fw(adap); | 802 | err = upgrade_fw(adap); |
803 | if (err) | 803 | if (err && must_load) |
804 | goto out; | 804 | goto out; |
805 | } | ||
805 | 806 | ||
806 | err = t3_check_tpsram_version(adap, &must_load); | 807 | err = t3_check_tpsram_version(adap, &must_load); |
807 | if (err == -EINVAL) { | 808 | if (err == -EINVAL) { |
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 | */ |
967 | int t3_check_fw_version(struct adapter *adapter) | 968 | int 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 | ||
diff --git a/drivers/net/cxgb3/version.h b/drivers/net/cxgb3/version.h index eb508bf8022a..ef1c6339c806 100644 --- a/drivers/net/cxgb3/version.h +++ b/drivers/net/cxgb3/version.h | |||
@@ -39,6 +39,6 @@ | |||
39 | 39 | ||
40 | /* Firmware version */ | 40 | /* Firmware version */ |
41 | #define FW_VERSION_MAJOR 4 | 41 | #define FW_VERSION_MAJOR 4 |
42 | #define FW_VERSION_MINOR 3 | 42 | #define FW_VERSION_MINOR 6 |
43 | #define FW_VERSION_MICRO 0 | 43 | #define FW_VERSION_MICRO 0 |
44 | #endif /* __CHELSIO_VERSION_H */ | 44 | #endif /* __CHELSIO_VERSION_H */ |