Lines Matching defs:vsc
126 struct virtio_softc *vsc = device_private(parent);
130 if (virtio_child(vsc) != NULL) {
149 sc->sc_virtio = vsc;
151 virtio_child_attach_start(vsc, self, IPL_VM,
154 features = virtio_features(vsc);
166 virtio_init_vq_vqdone(vsc, &sc->sc_vq[VQ_INFLATE], VQ_INFLATE,
168 virtio_init_vq_vqdone(vsc, &sc->sc_vq[VQ_DEFLATE], VQ_DEFLATE,
171 if (virtio_alloc_vq(vsc, &sc->sc_vq[VQ_INFLATE],
175 if (virtio_alloc_vq(vsc, &sc->sc_vq[VQ_DEFLATE],
180 if (bus_dmamap_create(virtio_dmat(vsc), sizeof(uint32_t)*PGS_PER_REQ,
186 if (bus_dmamap_load(virtio_dmat(vsc), sc->sc_req.bl_dmamap,
194 if (virtio_child_attach_finish(vsc, sc->sc_vq, __arraycount(sc->sc_vq),
220 bus_dmamap_destroy(virtio_dmat(vsc), sc->sc_req.bl_dmamap);
222 virtio_free_vq(vsc, &sc->sc_vq[VQ_DEFLATE]);
224 virtio_free_vq(vsc, &sc->sc_vq[VQ_INFLATE]);
229 virtio_child_attach_failed(vsc);
248 viomb_config_change(struct virtio_softc *vsc)
250 struct viomb_softc *sc = device_private(virtio_child(vsc));
274 struct virtio_softc *vsc = sc->sc_virtio;
305 if (virtio_enqueue_prep(vsc, vq, &slot) != 0) {
311 if (virtio_enqueue_reserve(vsc, vq, slot, 1)) {
317 bus_dmamap_sync(virtio_dmat(vsc), b->bl_dmamap, 0,
319 virtio_enqueue(vsc, vq, slot, b->bl_dmamap, true);
320 virtio_enqueue_commit(vsc, vq, slot, true);
329 struct virtio_softc *vsc = vq->vq_owner;
330 struct viomb_softc *sc = device_private(virtio_child(vsc));
343 struct virtio_softc *vsc = sc->sc_virtio;
350 r = virtio_dequeue(vsc, vq, &slot, NULL);
356 virtio_dequeue_commit(vsc, vq, slot);
360 bus_dmamap_sync(virtio_dmat(vsc), b->bl_dmamap,
371 virtio_write_device_config_le_4(vsc,
385 struct virtio_softc *vsc = sc->sc_virtio;
411 if (virtio_enqueue_prep(vsc, vq, &slot) != 0) {
421 if (virtio_enqueue_reserve(vsc, vq, slot, 1) != 0) {
431 bus_dmamap_sync(virtio_dmat(vsc), b->bl_dmamap, 0,
433 virtio_enqueue(vsc, vq, slot, b->bl_dmamap, true);
434 virtio_enqueue_commit(vsc, vq, slot, true);
437 if (!(virtio_features(vsc) & VIRTIO_BALLOON_F_MUST_TELL_HOST))
446 struct virtio_softc *vsc = vq->vq_owner;
447 struct viomb_softc *sc = device_private(virtio_child(vsc));
460 struct virtio_softc *vsc = sc->sc_virtio;
466 r = virtio_dequeue(vsc, vq, &slot, NULL);
472 virtio_dequeue_commit(vsc, vq, slot);
476 bus_dmamap_sync(virtio_dmat(vsc), b->bl_dmamap,
481 if (virtio_features(vsc) & VIRTIO_BALLOON_F_MUST_TELL_HOST)
485 virtio_write_device_config_le_4(vsc,