aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Osipov <michaelo@FreeBSD.org>2026-02-25 19:48:34 +0000
committerMichael Osipov <michaelo@FreeBSD.org>2026-04-30 19:53:47 +0000
commitea1764e5fcf0fc11680dc104e663ae3d1d0fd7be (patch)
treeb8607a0d3bd7f421fda18f2f6d9d6050c6fc3928
parent5e9f2a6aefabec01c587a169fd5efe3a2720a8e5 (diff)
mfi(4)/mrsas(4): Set sysctl name for driver versions consistently
Instead of printing the driver version over and over again if multiple controllers are used, set a sysctl name for the used driver version. Approved by: imp, ziaee MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D56110
-rw-r--r--sys/dev/mfi/mfi.c7
-rw-r--r--sys/dev/mrsas/mrsas.c3
2 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/mfi/mfi.c b/sys/dev/mfi/mfi.c
index 6f94e4203f1a..767d5ba0902c 100644
--- a/sys/dev/mfi/mfi.c
+++ b/sys/dev/mfi/mfi.c
@@ -371,9 +371,6 @@ mfi_attach(struct mfi_softc *sc)
if (sc == NULL)
return EINVAL;
- device_printf(sc->mfi_dev, "LSI MegaRAID SAS driver version: %s\n",
- MEGASAS_VERSION);
-
mtx_init(&sc->mfi_io_lock, "MFI I/O lock", NULL, MTX_DEF);
sx_init(&sc->mfi_config_lock, "MFI config");
TAILQ_INIT(&sc->mfi_ld_tqh);
@@ -764,6 +761,10 @@ mfi_attach(struct mfi_softc *sc)
sc->mfi_cdev, "%s", "megaraid_sas_ioctl_node");
if (sc->mfi_cdev != NULL)
sc->mfi_cdev->si_drv1 = sc;
+ SYSCTL_ADD_STRING(device_get_sysctl_ctx(sc->mfi_dev),
+ SYSCTL_CHILDREN(device_get_sysctl_tree(sc->mfi_dev)),
+ OID_AUTO, "driver_version", CTLFLAG_RD, MEGASAS_VERSION,
+ strlen(MEGASAS_VERSION), "driver version");
SYSCTL_ADD_INT(device_get_sysctl_ctx(sc->mfi_dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->mfi_dev)),
OID_AUTO, "delete_busy_volumes", CTLFLAG_RW,
diff --git a/sys/dev/mrsas/mrsas.c b/sys/dev/mrsas/mrsas.c
index 379fcbcb19ca..e8f43ad52ed8 100644
--- a/sys/dev/mrsas/mrsas.c
+++ b/sys/dev/mrsas/mrsas.c
@@ -824,9 +824,6 @@ mrsas_attach(device_t dev)
struct mrsas_softc *sc = device_get_softc(dev);
uint32_t cmd, error;
- device_printf(dev, "AVAGO MegaRAID SAS driver version: %s\n",
- MRSAS_VERSION);
-
memset(sc, 0, sizeof(struct mrsas_softc));
/* Look up our softc and initialize its fields. */