Make sure that the firmware version is available in

dev.t4nex.X.firmware_version even if the driver fails to attach
properly.  At least it'll be easy to tell what we're dealing with.

MFC after:	1 week
This commit is contained in:
Navdeep Parhar 2012-04-30 08:44:10 +00:00
parent ceebc4ca95
commit e07f03e8fc

View File

@ -1449,6 +1449,11 @@ prep_firmware(struct adapter *sc)
/* Check firmware version and install a different one if necessary */
rc = t4_check_fw_version(sc);
snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
if (rc != 0) {
uint32_t v = 0;
@ -1505,6 +1510,12 @@ prep_firmware(struct adapter *sc)
} else {
/* refresh */
(void) t4_check_fw_version(sc);
snprintf(sc->fw_version,
sizeof(sc->fw_version), "%u.%u.%u.%u",
G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
}
}
}
@ -1548,11 +1559,6 @@ prep_firmware(struct adapter *sc)
goto done; /* error message displayed already */
}
snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u",
G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers),
G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers),
G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers),
G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers));
sc->flags |= FW_OK;
done: