summaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb3/t3_hw.c
diff options
context:
space:
mode:
authorDivy Le Ray <divy@chelsio.com>2007-01-30 19:43:45 -0800
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:49 -0500
commit4aac38990843b4f165ccf467b772e18827bff84c (patch)
tree0143837e7200c6e8243fb2da7adaeebd448aafc3 /drivers/net/cxgb3/t3_hw.c
parentb9662d0e9ca3092e1473f27628fd60fa33b1a97a (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.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index a4e2e57e146..4545acb3a2d 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,
return 0;
}
+enum fw_version_type {
+ FW_VERSION_N3,
+ FW_VERSION_T3
+};
+
/**
* t3_get_fw_version - read the firmware version
* @adapter: the adapter
@@ -849,19 +854,21 @@ int t3_check_fw_version(struct adapter *adapter)
{
int ret;
u32 vers;
+ unsigned int type, major, minor;
ret = t3_get_fw_version(adapter, &vers);
if (ret)
return ret;
- /* Minor 0xfff means the FW is an internal development-only version. */
- if ((vers & 0xfff) == 0xfff)
- return 0;
+ type = G_FW_VERSION_TYPE(vers);
+ major = G_FW_VERSION_MAJOR(vers);
+ minor = G_FW_VERSION_MINOR(vers);
- if (vers == 0x1002009)
+ if (type == FW_VERSION_T3 && major == 3 && minor == 1)
return 0;
- CH_ERR(adapter, "found wrong FW version, driver needs version 2.9\n");
+ CH_ERR(adapter, "found wrong FW version(%u.%u), "
+ "driver needs version 3.1\n", major, minor);
return -EINVAL;
}