svn commit: r234831 - head/sys/dev/cxgbe
Navdeep Parhar
np at FreeBSD.org
Mon Apr 30 08:44:11 UTC 2012
Author: np
Date: Mon Apr 30 08:44:10 2012
New Revision: 234831
URL: http://svn.freebsd.org/changeset/base/234831
Log:
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
Modified:
head/sys/dev/cxgbe/t4_main.c
Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c Mon Apr 30 08:00:52 2012 (r234830)
+++ head/sys/dev/cxgbe/t4_main.c Mon Apr 30 08:44:10 2012 (r234831)
@@ -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:
More information about the svn-src-head
mailing list