Lines Matching defs:vsc

175 	struct virtio_softc *vsc = (struct virtio_softc *)parent;
178 if (vsc->sc_child)
180 vsc->sc_child = self;
181 vsc->sc_ipl = IPL_TTY;
182 sc->sc_virtio = vsc;
185 vsc->sc_vqs = malloc(2 * (maxports + 1) * sizeof(struct virtqueue), M_DEVBUF,
189 if (vsc->sc_vqs == NULL || sc->sc_ports == NULL) {
194 vsc->sc_driver_features = VIRTIO_CONSOLE_F_SIZE;
195 if (virtio_negotiate_features(vsc, viocon_feature_names) != 0)
204 if (virtio_attach_finish(vsc, va) != 0)
210 vsc->sc_child = VIRTIO_CHILD_ERROR;
211 free(vsc->sc_vqs, M_DEVBUF, 2 * (maxports + 1) * sizeof(struct virtqueue));
218 struct virtio_softc *vsc = sc->sc_virtio;
239 if (virtio_alloc_vq(vsc, &vsc->sc_vqs[rxidx], rxidx, 1, name) != 0) {
243 vp->vp_rx = &vsc->sc_vqs[rxidx];
249 if (virtio_alloc_vq(vsc, &vsc->sc_vqs[txidx], txidx, 1, name) != 0) {
253 vp->vp_tx = &vsc->sc_vqs[txidx];
257 vsc->sc_nvqs += 2;
261 if (bus_dmamap_create(vsc->sc_dmat, allocsize, 1, allocsize, 0,
264 if (bus_dmamem_alloc(vsc->sc_dmat, allocsize, 8, 0, &vp->vp_dmaseg,
267 if (bus_dmamem_map(vsc->sc_dmat, &vp->vp_dmaseg, nsegs,
270 if (bus_dmamap_load(vsc->sc_dmat, vp->vp_dmamap, kva,
279 if (virtio_has_feature(vsc, VIRTIO_CONSOLE_F_SIZE)) {
280 vp->vp_cols = virtio_read_device_config_2(vsc,
282 vp->vp_rows = virtio_read_device_config_2(vsc,
294 virtio_start_vq_intr(vsc, vp->vp_rx);
295 virtio_start_vq_intr(vsc, vp->vp_tx);
306 struct virtio_softc *vsc = vq->vq_owner;
310 while (virtio_dequeue(vsc, vq, &slot, &len) == 0) {
311 bus_dmamap_sync(vsc->sc_dmat, vp->vp_dmamap,
323 struct virtio_softc *vsc = vq->vq_owner;
324 struct viocon_softc *sc = (struct viocon_softc *)vsc->sc_child;
344 struct virtio_softc *vsc = vp->vp_sc->sc_virtio;
350 bus_dmamap_sync(vsc->sc_dmat, vp->vp_dmamap, slot * BUFSIZE,
354 virtio_enqueue_commit(vsc, vq, slot, 0);
359 virtio_notify(vsc, vq);
365 struct virtio_softc *vsc = vq->vq_owner;
366 struct viocon_softc *sc = (struct viocon_softc *)vsc->sc_child;
379 struct virtio_softc *vsc = vq->vq_owner;
384 while (!vp->vp_iflow && virtio_dequeue(vsc, vq, &slot, &len) == 0) {
385 bus_dmamap_sync(vsc->sc_dmat, vp->vp_dmamap,
402 struct virtio_softc *vsc;
408 vsc = sc->sc_virtio;
436 bus_dmamap_sync(vsc->sc_dmat, vp->vp_dmamap,
441 virtio_enqueue_commit(vsc, vq, slot, 0);
447 virtio_notify(vsc, vq);