Lines Matching +full:inactive +full:-
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
55 bool inactive; member
147 sc->vtrnd_dev = dev; in vtrnd_attach()
150 len = sizeof(*sc->vtrnd_value) * HARVESTSIZE; in vtrnd_attach()
151 sc->vtrnd_value = malloc_aligned(len, len, M_DEVBUF, M_WAITOK); in vtrnd_attach()
152 sc->vtrnd_sg = sglist_build(sc->vtrnd_value, len, M_WAITOK); in vtrnd_attach()
173 sc->eh = EVENTHANDLER_REGISTER(shutdown_post_sync, in vtrnd_attach()
175 if (sc->eh == NULL) { in vtrnd_attach()
181 sc->inactive = false; in vtrnd_attach()
204 sc->inactive = true; in vtrnd_detach()
205 if (sc->eh != NULL) { in vtrnd_detach()
206 EVENTHANDLER_DEREGISTER(shutdown_post_sync, sc->eh); in vtrnd_detach()
207 sc->eh = NULL; in vtrnd_detach()
212 virtqueue_poll(sc->vtrnd_vq, &rdlen); in vtrnd_detach()
215 sglist_free(sc->vtrnd_sg); in vtrnd_detach()
216 zfree(sc->vtrnd_value, M_DEVBUF); in vtrnd_detach()
226 sc->inactive = true; in vtrnd_shutdown()
237 dev = sc->vtrnd_dev; in vtrnd_negotiate_features()
240 sc->vtrnd_features = virtio_negotiate_features(dev, features); in vtrnd_negotiate_features()
262 dev = sc->vtrnd_dev; in vtrnd_alloc_virtqueue()
264 VQ_ALLOC_INFO_INIT(&vq_info, 0, NULL, sc, &sc->vtrnd_vq, in vtrnd_alloc_virtqueue()
276 vq = sc->vtrnd_vq; in vtrnd_enqueue()
278 KASSERT(virtqueue_empty(vq), ("%s: non-empty queue", __func__)); in vtrnd_enqueue()
280 error = virtqueue_enqueue(vq, sc, sc->vtrnd_sg, 0, 1); in vtrnd_enqueue()
294 if (sc->inactive) in vtrnd_harvest()
297 vq = sc->vtrnd_vq; in vtrnd_harvest()
305 memcpy(buf, sc->vtrnd_value, *sz); in vtrnd_harvest()