Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/broadcom/bcm2835/bcm2835_rng.c
Show All 12 Lines | |||||
} | } | ||||
sysctl_ctx = device_get_sysctl_ctx(dev); | sysctl_ctx = device_get_sysctl_ctx(dev); | ||||
sysctl_tree = device_get_sysctl_tree(dev); | sysctl_tree = device_get_sysctl_tree(dev); | ||||
SYSCTL_ADD_LONG(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | SYSCTL_ADD_LONG(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | ||||
"underrun", CTLFLAG_RD, &sc->sc_underrun, | "underrun", CTLFLAG_RD, &sc->sc_underrun, | ||||
"Number of FIFO underruns"); | "Number of FIFO underruns"); | ||||
SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | ||||
"2xspeed", CTLTYPE_INT | CTLFLAG_RW, sc, 0, | "2xspeed", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_NEEDGIANT, sc, 0, | ||||
sysctl_bcm2835_rng_2xspeed, "I", "Enable RBG 2X SPEED"); | sysctl_bcm2835_rng_2xspeed, "I", "Enable RBG 2X SPEED"); | ||||
SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | SYSCTL_ADD_INT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | ||||
"stall_count", CTLFLAG_RW, &sc->sc_stall_count, | "stall_count", CTLFLAG_RW, &sc->sc_stall_count, | ||||
RNG_STALL_COUNT_DEFAULT, "Number of underruns to assume RNG stall"); | RNG_STALL_COUNT_DEFAULT, "Number of underruns to assume RNG stall"); | ||||
#ifdef BCM2835_RNG_DEBUG_REGISTERS | #ifdef BCM2835_RNG_DEBUG_REGISTERS | ||||
SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | SYSCTL_ADD_PROC(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), OID_AUTO, | ||||
"dumpregs", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, | "dumpregs", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NEEDGIANT, sc, 0, | ||||
sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); | sysctl_bcm2835_rng_dump, "S", "Dump RNG registers"); | ||||
#endif | #endif | ||||
/* | /* | ||||
* Schedule the initial harvesting one second from now, which should give the | * Schedule the initial harvesting one second from now, which should give the | ||||
* hardware RNG plenty of time to generate the first random bytes. | * hardware RNG plenty of time to generate the first random bytes. | ||||
*/ | */ | ||||
callout_reset(&sc->sc_rngto, hz, bcm2835_rng_harvest, sc); | callout_reset(&sc->sc_rngto, hz, bcm2835_rng_harvest, sc); | ||||
Show All 12 Lines |