Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mpr/mpr.c
Show First 20 Lines • Show All 1,476 Lines • ▼ Show 20 Lines | mpr_init_queues(struct mpr_softc *sc) | ||||
return (0); | return (0); | ||||
} | } | ||||
/* Get the driver parameter tunables. Lowest priority are the driver defaults. | /* Get the driver parameter tunables. Lowest priority are the driver defaults. | ||||
* Next are the global settings, if they exist. Highest are the per-unit | * Next are the global settings, if they exist. Highest are the per-unit | ||||
* settings, if they exist. | * settings, if they exist. | ||||
*/ | */ | ||||
static void | void | ||||
mpr_get_tunables(struct mpr_softc *sc) | mpr_get_tunables(struct mpr_softc *sc) | ||||
{ | { | ||||
char tmpstr[80]; | char tmpstr[80]; | ||||
/* XXX default to some debugging for now */ | /* XXX default to some debugging for now */ | ||||
sc->mpr_debug = MPR_INFO | MPR_FAULT; | sc->mpr_debug = MPR_INFO | MPR_FAULT; | ||||
sc->disable_msix = 0; | sc->disable_msix = 0; | ||||
sc->disable_msi = 0; | sc->disable_msi = 0; | ||||
▲ Show 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | SYSCTL_ADD_UQUAD(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), | ||||
OID_AUTO, "prp_page_alloc_fail", CTLFLAG_RD, | OID_AUTO, "prp_page_alloc_fail", CTLFLAG_RD, | ||||
&sc->prp_page_alloc_fail, "PRP page allocation failures"); | &sc->prp_page_alloc_fail, "PRP page allocation failures"); | ||||
} | } | ||||
int | int | ||||
mpr_attach(struct mpr_softc *sc) | mpr_attach(struct mpr_softc *sc) | ||||
{ | { | ||||
int error; | int error; | ||||
mpr_get_tunables(sc); | |||||
MPR_FUNCTRACE(sc); | MPR_FUNCTRACE(sc); | ||||
mtx_init(&sc->mpr_mtx, "MPR lock", NULL, MTX_DEF); | mtx_init(&sc->mpr_mtx, "MPR lock", NULL, MTX_DEF); | ||||
callout_init_mtx(&sc->periodic, &sc->mpr_mtx, 0); | callout_init_mtx(&sc->periodic, &sc->mpr_mtx, 0); | ||||
callout_init_mtx(&sc->device_check_callout, &sc->mpr_mtx, 0); | callout_init_mtx(&sc->device_check_callout, &sc->mpr_mtx, 0); | ||||
TAILQ_INIT(&sc->event_list); | TAILQ_INIT(&sc->event_list); | ||||
timevalclear(&sc->lastfail); | timevalclear(&sc->lastfail); | ||||
▲ Show 20 Lines • Show All 1,836 Lines • Show Last 20 Lines |