FreeBSD/sys/dev/mps/mps.c
/* Get the driver parameter tunables.  Lowest priority are the driver defaults.
 * Next are the global settings, if they exist.  Highest are the per-unit
 * settings, if they exist.
 */
Get the driver parameter tunables.  Lowest priority are the driver defaults.
Next are the global settings, if they exist.  Highest are the per-unit
settings, if they exist.
Get the driver parameter tunables . Lowest priority are the driver defaults . Next are the global settings if they exist . Highest are the per - unit settings if they exist .
static void
mps_get_tunables(struct mps_softc *sc)
{
	char tmpstr[80];
	sc->mps_debug = MPS_INFO|MPS_FAULT;
	sc->disable_msix = 0;
	sc->disable_msi = 0;
	sc->max_chains = MPS_CHAIN_FRAMES;
	sc->max_io_pages = MPS_MAXIO_PAGES;
	sc->enable_ssu = MPS_SSU_ENABLE_SSD_DISABLE_HDD;
	sc->spinup_wait_time = DEFAULT_SPINUP_WAIT;
	TUNABLE_INT_FETCH("hw.mps.debug_level", &sc->mps_debug);
	TUNABLE_INT_FETCH("hw.mps.disable_msix", &sc->disable_msix);
	TUNABLE_INT_FETCH("hw.mps.disable_msi", &sc->disable_msi);
	TUNABLE_INT_FETCH("hw.mps.max_chains", &sc->max_chains);
	TUNABLE_INT_FETCH("hw.mps.max_io_pages", &sc->max_io_pages);
	TUNABLE_INT_FETCH("hw.mps.enable_ssu", &sc->enable_ssu);
	TUNABLE_INT_FETCH("hw.mps.spinup_wait_time", &sc->spinup_wait_time);
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.debug_level",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->mps_debug);
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.disable_msix",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->disable_msix);
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.disable_msi",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->disable_msi);
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.max_chains",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->max_chains);
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.max_io_pages",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->max_io_pages);
	bzero(sc->exclude_ids, sizeof(sc->exclude_ids));
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.exclude_ids",
	    device_get_unit(sc->mps_dev));
	TUNABLE_STR_FETCH(tmpstr, sc->exclude_ids, sizeof(sc->exclude_ids));
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.enable_ssu",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->enable_ssu);
	snprintf(tmpstr, sizeof(tmpstr), "dev.mps.%d.spinup_wait_time",
	    device_get_unit(sc->mps_dev));
	TUNABLE_INT_FETCH(tmpstr, &sc->spinup_wait_time);
}
static void mps_get_tunables ( struct mps_softc * sc ) { char tmpstr [ 80 ] ; sc -> mps_debug = MPS_INFO | MPS_FAULT ; sc -> disable_msix = 0 ; sc -> disable_msi = 0 ; sc -> max_chains = MPS_CHAIN_FRAMES ; sc -> max_io_pages = MPS_MAXIO_PAGES ; sc -> enable_ssu = MPS_SSU_ENABLE_SSD_DISABLE_HDD ; sc -> spinup_wait_time = DEFAULT_SPINUP_WAIT ; TUNABLE_INT_FETCH ( " " , & sc -> mps_debug ) ; TUNABLE_INT_FETCH ( " " , & sc -> disable_msix ) ; TUNABLE_INT_FETCH ( " " , & sc -> disable_msi ) ; TUNABLE_INT_FETCH ( " " , & sc -> max_chains ) ; TUNABLE_INT_FETCH ( " " , & sc -> max_io_pages ) ; TUNABLE_INT_FETCH ( " " , & sc -> enable_ssu ) ; TUNABLE_INT_FETCH ( " " , & sc -> spinup_wait_time ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> mps_debug ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> disable_msix ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> disable_msi ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> max_chains ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> max_io_pages ) ; bzero ( sc -> exclude_ids , sizeof ( sc -> exclude_ids ) ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_STR_FETCH ( tmpstr , sc -> exclude_ids , sizeof ( sc -> exclude_ids ) ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> enable_ssu ) ; snprintf ( tmpstr , sizeof ( tmpstr ) , " " , device_get_unit ( sc -> mps_dev ) ) ; TUNABLE_INT_FETCH ( tmpstr , & sc -> spinup_wait_time ) ; }
Get the driver parameter tunables.
Get the driver parameter tunables .
/* XXX default to some debugging for now */ /*
	 * Grab the global variables.
	 */ /* Grab the unit-instance variables */