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
This commit is contained in:
+4
-3
@@ -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,
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user