diff options
author | Navdeep Parhar <np@FreeBSD.org> | 2016-03-11 03:15:17 +0000 |
---|---|---|
committer | Navdeep Parhar <np@FreeBSD.org> | 2016-03-11 03:15:17 +0000 |
commit | 9945ceb85747dfdbff3a5587fe6dbf1c98ab8d38 (patch) | |
tree | 96d011f97770952189e0ed9efd64325dcc2798ec | |
parent | 5849e3bbcd8aeec6e19c35610704968ea1b50667 (diff) | |
download | src-9945ceb85747dfdbff3a5587fe6dbf1c98ab8d38.tar.gz src-9945ceb85747dfdbff3a5587fe6dbf1c98ab8d38.zip |
cxgbe(4): Add sysctls to display the TP microcode version and the
expansion rom version (if there's one).
trantor:~# sysctl dev.t4nex dev.t5nex | grep _version
dev.t4nex.0.firmware_version: 1.15.28.0
dev.t4nex.0.tp_version: 0.1.9.4
dev.t5nex.0.firmware_version: 1.15.28.0
dev.t5nex.0.exprom_version: 1.0.0.68
dev.t5nex.0.tp_version: 0.1.4.9
Notes
Notes:
svn path=/head/; revision=296641
-rw-r--r-- | sys/dev/cxgbe/adapter.h | 4 | ||||
-rw-r--r-- | sys/dev/cxgbe/common/common.h | 1 | ||||
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 25 |
3 files changed, 29 insertions, 1 deletions
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h index 32c9c2b876b4..8cb99837811c 100644 --- a/sys/dev/cxgbe/adapter.h +++ b/sys/dev/cxgbe/adapter.h @@ -803,7 +803,9 @@ struct adapter { int tracer_valid; /* bitmap of valid tracers */ int tracer_enabled; /* bitmap of enabled tracers */ - char fw_version[32]; + char fw_version[16]; + char tp_version[16]; + char exprom_version[16]; char cfg_file[32]; u_int cfcsum; struct adapter_params params; diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h index 89a95068483b..cc6edf32a3c7 100644 --- a/sys/dev/cxgbe/common/common.h +++ b/sys/dev/cxgbe/common/common.h @@ -290,6 +290,7 @@ struct adapter_params { unsigned int fw_vers; unsigned int tp_vers; + unsigned int exprom_vers; unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index fa2f593f974d..d724002367e1 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2826,7 +2826,24 @@ prep_firmware(struct adapter *sc) 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)); + t4_get_tp_version(sc, &sc->params.tp_vers); + snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); + + if (t4_get_exprom_version(sc, &sc->params.exprom_vers) != 0) + sc->params.exprom_vers = 0; + else { + snprintf(sc->exprom_version, sizeof(sc->exprom_version), + "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.exprom_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.exprom_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.exprom_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.exprom_vers)); + } /* Reset device */ if (need_fw_reset && @@ -4594,6 +4611,14 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD, NULL, chip_rev(sc), "chip hardware revision"); + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version", + CTLFLAG_RD, sc->tp_version, 0, "TP microcode version"); + + if (sc->params.exprom_vers != 0) { + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "exprom_version", + CTLFLAG_RD, sc->exprom_version, 0, "expansion ROM version"); + } + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "firmware_version", CTLFLAG_RD, sc->fw_version, 0, "firmware version"); |