Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ale/if_ale.c
Show All 12 Lines | |||||
struct ale_hw_stats *stats; | struct ale_hw_stats *stats; | ||||
int error; | int error; | ||||
stats = &sc->ale_stats; | stats = &sc->ale_stats; | ||||
ctx = device_get_sysctl_ctx(sc->ale_dev); | ctx = device_get_sysctl_ctx(sc->ale_dev); | ||||
child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ale_dev)); | child = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->ale_dev)); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_rx_mod", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_rx_mod, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&sc->ale_int_rx_mod, 0, | |||||
sysctl_hw_ale_int_mod, "I", "ale Rx interrupt moderation"); | sysctl_hw_ale_int_mod, "I", "ale Rx interrupt moderation"); | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "int_tx_mod", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->ale_int_tx_mod, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&sc->ale_int_tx_mod, 0, | |||||
sysctl_hw_ale_int_mod, "I", "ale Tx interrupt moderation"); | sysctl_hw_ale_int_mod, "I", "ale Tx interrupt moderation"); | ||||
/* Pull in device tunables. */ | /* Pull in device tunables. */ | ||||
sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; | sc->ale_int_rx_mod = ALE_IM_RX_TIMER_DEFAULT; | ||||
error = resource_int_value(device_get_name(sc->ale_dev), | error = resource_int_value(device_get_name(sc->ale_dev), | ||||
device_get_unit(sc->ale_dev), "int_rx_mod", &sc->ale_int_rx_mod); | device_get_unit(sc->ale_dev), "int_rx_mod", &sc->ale_int_rx_mod); | ||||
if (error == 0) { | if (error == 0) { | ||||
if (sc->ale_int_rx_mod < ALE_IM_TIMER_MIN || | if (sc->ale_int_rx_mod < ALE_IM_TIMER_MIN || | ||||
sc->ale_int_rx_mod > ALE_IM_TIMER_MAX) { | sc->ale_int_rx_mod > ALE_IM_TIMER_MAX) { | ||||
Show All 11 Lines | |||||
sc->ale_int_tx_mod > ALE_IM_TIMER_MAX) { | sc->ale_int_tx_mod > ALE_IM_TIMER_MAX) { | ||||
device_printf(sc->ale_dev, "int_tx_mod value out of " | device_printf(sc->ale_dev, "int_tx_mod value out of " | ||||
"range; using default: %d\n", | "range; using default: %d\n", | ||||
ALE_IM_TX_TIMER_DEFAULT); | ALE_IM_TX_TIMER_DEFAULT); | ||||
sc->ale_int_tx_mod = ALE_IM_TX_TIMER_DEFAULT; | sc->ale_int_tx_mod = ALE_IM_TX_TIMER_DEFAULT; | ||||
} | } | ||||
} | } | ||||
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", | SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "process_limit", | ||||
CTLTYPE_INT | CTLFLAG_RW, &sc->ale_process_limit, 0, | CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, | ||||
&sc->ale_process_limit, 0, | |||||
sysctl_hw_ale_proc_limit, "I", | sysctl_hw_ale_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->ale_process_limit = ALE_PROC_DEFAULT; | sc->ale_process_limit = ALE_PROC_DEFAULT; | ||||
error = resource_int_value(device_get_name(sc->ale_dev), | error = resource_int_value(device_get_name(sc->ale_dev), | ||||
device_get_unit(sc->ale_dev), "process_limit", | device_get_unit(sc->ale_dev), "process_limit", | ||||
&sc->ale_process_limit); | &sc->ale_process_limit); | ||||
if (error == 0) { | if (error == 0) { | ||||
Show All 12 Lines |