Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/age/if_age.c
Show All 12 Lines | |||||
static void | static void | ||||
age_sysctl_node(struct age_softc *sc) | age_sysctl_node(struct age_softc *sc) | ||||
{ | { | ||||
int error; | int error; | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, | ||||
"stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, sysctl_age_stats, | "stats", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
sc, 0, sysctl_age_stats, | |||||
"I", "Statistics"); | "I", "Statistics"); | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, | ||||
"int_mod", CTLTYPE_INT | CTLFLAG_RW, &sc->age_int_mod, 0, | "int_mod", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&sc->age_int_mod, 0, | |||||
sysctl_hw_age_int_mod, "I", "age interrupt moderation"); | sysctl_hw_age_int_mod, "I", "age interrupt moderation"); | ||||
/* Pull in device tunables. */ | /* Pull in device tunables. */ | ||||
sc->age_int_mod = AGE_IM_TIMER_DEFAULT; | sc->age_int_mod = AGE_IM_TIMER_DEFAULT; | ||||
error = resource_int_value(device_get_name(sc->age_dev), | error = resource_int_value(device_get_name(sc->age_dev), | ||||
device_get_unit(sc->age_dev), "int_mod", &sc->age_int_mod); | device_get_unit(sc->age_dev), "int_mod", &sc->age_int_mod); | ||||
if (error == 0) { | if (error == 0) { | ||||
if (sc->age_int_mod < AGE_IM_TIMER_MIN || | if (sc->age_int_mod < AGE_IM_TIMER_MIN || | ||||
sc->age_int_mod > AGE_IM_TIMER_MAX) { | sc->age_int_mod > AGE_IM_TIMER_MAX) { | ||||
device_printf(sc->age_dev, | device_printf(sc->age_dev, | ||||
"int_mod value out of range; using default: %d\n", | "int_mod value out of range; using default: %d\n", | ||||
AGE_IM_TIMER_DEFAULT); | AGE_IM_TIMER_DEFAULT); | ||||
sc->age_int_mod = AGE_IM_TIMER_DEFAULT; | sc->age_int_mod = AGE_IM_TIMER_DEFAULT; | ||||
} | } | ||||
} | } | ||||
SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), | SYSCTL_ADD_PROC(device_get_sysctl_ctx(sc->age_dev), | ||||
SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, | SYSCTL_CHILDREN(device_get_sysctl_tree(sc->age_dev)), OID_AUTO, | ||||
"process_limit", CTLTYPE_INT | CTLFLAG_RW, &sc->age_process_limit, | "process_limit", | ||||
CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | |||||
&sc->age_process_limit, | |||||
0, sysctl_hw_age_proc_limit, "I", | 0, sysctl_hw_age_proc_limit, "I", | ||||
"max number of Rx events to process"); | "max number of Rx events to process"); | ||||
/* Pull in device tunables. */ | /* Pull in device tunables. */ | ||||
sc->age_process_limit = AGE_PROC_DEFAULT; | sc->age_process_limit = AGE_PROC_DEFAULT; | ||||
error = resource_int_value(device_get_name(sc->age_dev), | error = resource_int_value(device_get_name(sc->age_dev), | ||||
device_get_unit(sc->age_dev), "process_limit", | device_get_unit(sc->age_dev), "process_limit", | ||||
&sc->age_process_limit); | &sc->age_process_limit); | ||||
Show All 12 Lines |