Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/virtio/random/virtio_random.c
Show First 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | vtrnd_harvest(struct vtrnd_softc *sc) | ||||
/* | /* | ||||
* Poll for the response, but the command is likely already | * Poll for the response, but the command is likely already | ||||
* done when we return from the notify. | * done when we return from the notify. | ||||
*/ | */ | ||||
virtqueue_notify(vq); | virtqueue_notify(vq); | ||||
virtqueue_poll(vq, NULL); | virtqueue_poll(vq, NULL); | ||||
random_harvest_queue(&value, sizeof(value), sizeof(value) * NBBY / 2, | random_harvest_queue(&value, sizeof(value), RANDOM_PURE_VIRTIO); | ||||
RANDOM_PURE_VIRTIO); | |||||
} | } | ||||
static void | static void | ||||
vtrnd_timer(void *xsc) | vtrnd_timer(void *xsc) | ||||
{ | { | ||||
struct vtrnd_softc *sc; | struct vtrnd_softc *sc; | ||||
sc = xsc; | sc = xsc; | ||||
vtrnd_harvest(sc); | vtrnd_harvest(sc); | ||||
callout_schedule(&sc->vtrnd_callout, 5 * hz); | callout_schedule(&sc->vtrnd_callout, 5 * hz); | ||||
} | } |