Lines Matching defs:vsc
137 struct virtio_softc *vsc = (struct virtio_softc *)parent;
141 if (vsc->sc_child != NULL) {
154 sc->sc_virtio = vsc;
155 vsc->sc_vqs = &sc->sc_vq[VQ_INFLATE];
156 vsc->sc_nvqs = 0;
157 vsc->sc_child = self;
158 vsc->sc_ipl = IPL_BIO;
159 vsc->sc_config_change = viomb_config_change;
161 vsc->sc_driver_features = VIRTIO_BALLOON_F_MUST_TELL_HOST;
162 if (virtio_negotiate_features(vsc, viomb_feature_names) != 0)
165 if ((virtio_alloc_vq(vsc, &sc->sc_vq[VQ_INFLATE], VQ_INFLATE, 1,
168 vsc->sc_nvqs++;
169 if ((virtio_alloc_vq(vsc, &sc->sc_vq[VQ_DEFLATE], VQ_DEFLATE, 1,
172 vsc->sc_nvqs++;
176 virtio_start_vq_intr(vsc, &sc->sc_vq[VQ_INFLATE]);
177 virtio_start_vq_intr(vsc, &sc->sc_vq[VQ_DEFLATE]);
187 if (bus_dmamap_create(vsc->sc_dmat, sizeof(u_int32_t) * PGS_PER_REQ,
193 if (bus_dmamap_load(vsc->sc_dmat, sc->sc_req.bl_dmamap,
223 if (virtio_attach_finish(vsc, va) != 0)
228 bus_dmamap_destroy(vsc->sc_dmat, sc->sc_req.bl_dmamap);
232 for (i = 0; i < vsc->sc_nvqs; i++)
233 virtio_free_vq(vsc, &sc->sc_vq[i]);
234 vsc->sc_nvqs = 0;
235 vsc->sc_child = VIRTIO_CHILD_ERROR;
243 viomb_config_change(struct virtio_softc *vsc)
245 struct viomb_softc *sc = (struct viomb_softc *)vsc->sc_child;
280 struct virtio_softc *vsc = (struct virtio_softc *)sc->sc_virtio;
317 bus_dmamap_sync(vsc->sc_dmat, b->bl_dmamap, 0,
321 virtio_enqueue_commit(vsc, vq, slot, VRING_NOTIFY);
331 struct virtio_softc *vsc = (struct virtio_softc *)sc->sc_virtio;
366 bus_dmamap_sync(vsc->sc_dmat, b->bl_dmamap, 0,
372 if (!virtio_has_feature(vsc, VIRTIO_BALLOON_F_MUST_TELL_HOST))
374 virtio_enqueue_commit(vsc, vq, slot, VRING_NOTIFY);
384 struct virtio_softc *vsc = (struct virtio_softc *)sc->sc_virtio;
388 reg = virtio_read_device_config_4(vsc, VIRTIO_BALLOON_CONFIG_NUM_PAGES);
390 reg = virtio_read_device_config_4(vsc, VIRTIO_BALLOON_CONFIG_ACTUAL);
399 struct virtio_softc *vsc = vq->vq_owner;
400 struct viomb_softc *sc = (struct viomb_softc *)vsc->sc_child;
403 r = virtio_dequeue(vsc, vq, &slot, NULL);
418 struct virtio_softc *vsc = vq->vq_owner;
419 struct viomb_softc *sc = (struct viomb_softc *)vsc->sc_child;
428 bus_dmamap_sync(vsc->sc_dmat, b->bl_dmamap, 0,
434 virtio_write_device_config_4(vsc, VIRTIO_BALLOON_CONFIG_ACTUAL,
448 struct virtio_softc *vsc = vq->vq_owner;
449 struct viomb_softc *sc = (struct viomb_softc *)vsc->sc_child;
458 bus_dmamap_sync(vsc->sc_dmat, b->bl_dmamap, 0,
462 if (virtio_has_feature(vsc, VIRTIO_BALLOON_F_MUST_TELL_HOST))
467 virtio_write_device_config_4(vsc, VIRTIO_BALLOON_CONFIG_ACTUAL,