pci_virtio_console.c (d7b72f7b52f902da47cc7210a9121f4caabbcb9c) pci_virtio_console.c (4f3f3e9a1dee62c031fa67cfe64e11d6dd3fab1b)
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2016 iXsystems Inc.
5 * All rights reserved.
6 *
7 * This software was developed by Jakub Klama <jceel@FreeBSD.org>
8 * under sponsorship from iXsystems Inc.

--- 647 unchanged lines hidden (view full) ---

656 port = pci_vtcon_vq_to_port(sc, vq);
657
658 if (!port->vsp_rx_ready) {
659 port->vsp_rx_ready = 1;
660 vq_kick_disable(vq);
661 }
662}
663
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2016 iXsystems Inc.
5 * All rights reserved.
6 *
7 * This software was developed by Jakub Klama <jceel@FreeBSD.org>
8 * under sponsorship from iXsystems Inc.

--- 647 unchanged lines hidden (view full) ---

656 port = pci_vtcon_vq_to_port(sc, vq);
657
658 if (!port->vsp_rx_ready) {
659 port->vsp_rx_ready = 1;
660 vq_kick_disable(vq);
661 }
662}
663
664#ifdef __FreeBSD__
665/*
666 * Each console device has a "port" node which contains nodes for
667 * each port. Ports are numbered starting at 0.
668 */
669static int
670pci_vtcon_legacy_config_port(nvlist_t *nvl, int port, char *opt)
671{
672 char *name, *path;

--- 32 unchanged lines hidden (view full) ---

705 error = pci_vtcon_legacy_config_port(ports_nvl, port, opt);
706 if (error)
707 break;
708 port++;
709 }
710 free(tofree);
711 return (error);
712}
664/*
665 * Each console device has a "port" node which contains nodes for
666 * each port. Ports are numbered starting at 0.
667 */
668static int
669pci_vtcon_legacy_config_port(nvlist_t *nvl, int port, char *opt)
670{
671 char *name, *path;

--- 32 unchanged lines hidden (view full) ---

704 error = pci_vtcon_legacy_config_port(ports_nvl, port, opt);
705 if (error)
706 break;
707 port++;
708 }
709 free(tofree);
710 return (error);
711}
713#endif
714
715static int
716pci_vtcon_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
717{
718 struct pci_vtcon_softc *sc;
719 nvlist_t *ports_nvl;
720 int i;
721

--- 52 unchanged lines hidden (view full) ---

774 return (1);
775 }
776 }
777 }
778
779 return (0);
780}
781
712
713static int
714pci_vtcon_init(struct vmctx *ctx, struct pci_devinst *pi, nvlist_t *nvl)
715{
716 struct pci_vtcon_softc *sc;
717 nvlist_t *ports_nvl;
718 int i;
719

--- 52 unchanged lines hidden (view full) ---

772 return (1);
773 }
774 }
775 }
776
777 return (0);
778}
779
782struct pci_devemu pci_de_vcon = {
780static const struct pci_devemu pci_de_vcon = {
783 .pe_emu = "virtio-console",
784 .pe_init = pci_vtcon_init,
785 .pe_barwrite = vi_pci_write,
781 .pe_emu = "virtio-console",
782 .pe_init = pci_vtcon_init,
783 .pe_barwrite = vi_pci_write,
786 .pe_barread = vi_pci_read
784 .pe_barread = vi_pci_read,
785 .pe_legacy_config = pci_vtcon_legacy_config,
787};
788PCI_EMUL_SET(pci_de_vcon);
786};
787PCI_EMUL_SET(pci_de_vcon);