diff options
author | Divy Le Ray <divy@chelsio.com> | 2007-01-30 22:43:45 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-05 16:58:49 -0500 |
commit | 4aac38990843b4f165ccf467b772e18827bff84c (patch) | |
tree | 0143837e7200c6e8243fb2da7adaeebd448aafc3 /drivers/net/cxgb3/t3_hw.c | |
parent | b9662d0e9ca3092e1473f27628fd60fa33b1a97a (diff) |
cxgb3 - FW versioning
Clean up FW version checking.
The supported FW version is now 3.1.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/cxgb3/t3_hw.c')
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index a4e2e57e1465..4545acb3a2d5 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -826,6 +826,11 @@ static int t3_write_flash(struct adapter *adapter, unsigned int addr, | |||
826 | return 0; | 826 | return 0; |
827 | } | 827 | } |
828 | 828 | ||
829 | enum fw_version_type { | ||
830 | FW_VERSION_N3, | ||
831 | FW_VERSION_T3 | ||
832 | }; | ||
833 | |||
829 | /** | 834 | /** |
830 | * t3_get_fw_version - read the firmware version | 835 | * t3_get_fw_version - read the firmware version |
831 | * @adapter: the adapter | 836 | * @adapter: the adapter |
@@ -849,19 +854,21 @@ int t3_check_fw_version(struct adapter *adapter) | |||
849 | { | 854 | { |
850 | int ret; | 855 | int ret; |
851 | u32 vers; | 856 | u32 vers; |
857 | unsigned int type, major, minor; | ||
852 | 858 | ||
853 | ret = t3_get_fw_version(adapter, &vers); | 859 | ret = t3_get_fw_version(adapter, &vers); |
854 | if (ret) | 860 | if (ret) |
855 | return ret; | 861 | return ret; |
856 | 862 | ||
857 | /* Minor 0xfff means the FW is an internal development-only version. */ | 863 | type = G_FW_VERSION_TYPE(vers); |
858 | if ((vers & 0xfff) == 0xfff) | 864 | major = G_FW_VERSION_MAJOR(vers); |
859 | return 0; | 865 | minor = G_FW_VERSION_MINOR(vers); |
860 | 866 | ||
861 | if (vers == 0x1002009) | 867 | if (type == FW_VERSION_T3 && major == 3 && minor == 1) |
862 | return 0; | 868 | return 0; |
863 | 869 | ||
864 | CH_ERR(adapter, "found wrong FW version, driver needs version 2.9\n"); | 870 | CH_ERR(adapter, "found wrong FW version(%u.%u), " |
871 | "driver needs version 3.1\n", major, minor); | ||
865 | return -EINVAL; | 872 | return -EINVAL; |
866 | } | 873 | } |
867 | 874 | ||