cxgb3 - Firmware update
authorDivy Le Ray <divy@chelsio.com>
Wed, 5 Sep 2007 22:58:09 +0000 (15:58 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:51:03 +0000 (16:51 -0700)
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>
drivers/net/cxgb3/common.h
drivers/net/cxgb3/cxgb3_main.c
drivers/net/cxgb3/t3_hw.c
drivers/net/cxgb3/version.h

index 510e93f90b912ae8b2b62622712087e79778eb5a..ada5e4b89cd84550ebec4554977d2fa0c4a97cd7 100644 (file)
@@ -690,7 +690,7 @@ int t3_read_flash(struct adapter *adapter, unsigned int addr,
                  unsigned int nwords, u32 *data, int byte_oriented);
 int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size);
 int t3_get_fw_version(struct adapter *adapter, u32 *vers);
-int t3_check_fw_version(struct adapter *adapter);
+int t3_check_fw_version(struct adapter *adapter, int *must_load);
 int t3_init_hw(struct adapter *adapter, u32 fw_params);
 void mac_prep(struct cmac *mac, struct adapter *adapter, int index);
 void early_hw_init(struct adapter *adapter, const struct adapter_info *ai);
index 3ee465dd0b0821de28cc49f79f819a32229445dd..8f1d602a883a329598d21a362a61ecebfd6db0c9 100644 (file)
@@ -797,11 +797,12 @@ static int cxgb_up(struct adapter *adap)
        int must_load;
 
        if (!(adap->flags & FULL_INIT_DONE)) {
-               err = t3_check_fw_version(adap);
-               if (err == -EINVAL)
+               err = t3_check_fw_version(adap, &must_load);
+               if (err == -EINVAL) {
                        err = upgrade_fw(adap);
-               if (err)
-                       goto out;
+                       if (err && must_load)
+                               goto out;
+               }
 
                err = t3_check_tpsram_version(adap, &must_load);
                if (err == -EINVAL) {
index e958bbe30623f6f86b5964a7a19e370e968475dd..2b49b96a6fdb79c25c0167ae7187b47045e03d99 100644 (file)
@@ -960,16 +960,18 @@ int t3_get_fw_version(struct adapter *adapter, u32 *vers)
 /**
  *     t3_check_fw_version - check if the FW is compatible with this driver
  *     @adapter: the adapter
- *
+ *     @must_load: set to 1 if loading a new FW image is required
+
  *     Checks if an adapter's FW is compatible with the driver.  Returns 0
  *     if the versions are compatible, a negative error otherwise.
  */
-int t3_check_fw_version(struct adapter *adapter)
+int t3_check_fw_version(struct adapter *adapter, int *must_load)
 {
        int ret;
        u32 vers;
        unsigned int type, major, minor;
 
+       *must_load = 1;
        ret = t3_get_fw_version(adapter, &vers);
        if (ret)
                return ret;
@@ -982,9 +984,17 @@ int t3_check_fw_version(struct adapter *adapter)
            minor == FW_VERSION_MINOR)
                return 0;
 
-       CH_ERR(adapter, "found wrong FW version(%u.%u), "
-              "driver needs version %u.%u\n", major, minor,
-              FW_VERSION_MAJOR, FW_VERSION_MINOR);
+       if (major != FW_VERSION_MAJOR)
+               CH_ERR(adapter, "found wrong FW version(%u.%u), "
+                      "driver needs version %u.%u\n", major, minor,
+                      FW_VERSION_MAJOR, FW_VERSION_MINOR);
+       else {
+               *must_load = 0;
+               CH_WARN(adapter, "found wrong FW minor version(%u.%u), "
+                       "driver compiled for version %u.%u\n", major, minor,
+                       FW_VERSION_MAJOR, FW_VERSION_MINOR);
+       }
+
        return -EINVAL;
 }
 
index eb508bf8022a0595bd228b2ede3e94040e39f782..ef1c6339c80607437dee90ce103257c5114df7c8 100644 (file)
@@ -39,6 +39,6 @@
 
 /* Firmware version */
 #define FW_VERSION_MAJOR 4
-#define FW_VERSION_MINOR 3
+#define FW_VERSION_MINOR 6
 #define FW_VERSION_MICRO 0
 #endif                         /* __CHELSIO_VERSION_H */