aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cxgbe
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2012-04-30 08:44:10 +0000
committerNavdeep Parhar <np@FreeBSD.org>2012-04-30 08:44:10 +0000
commite07f03e8fc4de634c69600dbcde12d17507a2617 (patch)
tree872d8626699033b93adb77a10764c83379c4c7df /sys/dev/cxgbe
parentceebc4ca9529ab293c03beeaef489ae738dfaf83 (diff)
downloadsrc-e07f03e8fc4de634c69600dbcde12d17507a2617.tar.gz
src-e07f03e8fc4de634c69600dbcde12d17507a2617.zip
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
Notes
Notes: svn path=/head/; revision=234831
Diffstat (limited to 'sys/dev/cxgbe')
-rw-r--r--sys/dev/cxgbe/t4_main.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index a344952fcae1..7509a02980a7 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -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: