Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 2015 17:38:08 +0000 (UTC)
From:      Peter Grehan <grehan@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282865 - head/usr.sbin/bhyve
Message-ID:  <201505131738.t4DHc8tW007662@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: grehan
Date: Wed May 13 17:38:07 2015
New Revision: 282865
URL: https://svnweb.freebsd.org/changeset/base/282865

Log:
  Set the subvendor field in config space to the vendor ID.
  This is required by the Windows virtio drivers to correctly
  match a device.
  
  Submitted by:	Leon Dang (ldang@nahannisys.com)
  MFC after:	2 weeks

Modified:
  head/usr.sbin/bhyve/pci_virtio_block.c
  head/usr.sbin/bhyve/pci_virtio_net.c
  head/usr.sbin/bhyve/pci_virtio_rnd.c

Modified: head/usr.sbin/bhyve/pci_virtio_block.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_block.c	Wed May 13 16:02:55 2015	(r282864)
+++ head/usr.sbin/bhyve/pci_virtio_block.c	Wed May 13 17:38:07 2015	(r282865)
@@ -370,6 +370,7 @@ pci_vtblk_init(struct vmctx *ctx, struct
 	pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR);
 	pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE);
 	pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_BLOCK);
+	pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR);
 
 	if (vi_intr_init(&sc->vbsc_vs, 1, fbsdrun_virtio_msix())) {
 		blockif_close(sc->bc);

Modified: head/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_net.c	Wed May 13 16:02:55 2015	(r282864)
+++ head/usr.sbin/bhyve/pci_virtio_net.c	Wed May 13 17:38:07 2015	(r282865)
@@ -640,6 +640,7 @@ pci_vtnet_init(struct vmctx *ctx, struct
 	pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR);
 	pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_NETWORK);
 	pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET);
+	pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR);
 
 	/* Link is up if we managed to open tap device. */
 	sc->vsc_config.status = (opts == NULL || sc->vsc_tapfd >= 0);

Modified: head/usr.sbin/bhyve/pci_virtio_rnd.c
==============================================================================
--- head/usr.sbin/bhyve/pci_virtio_rnd.c	Wed May 13 16:02:55 2015	(r282864)
+++ head/usr.sbin/bhyve/pci_virtio_rnd.c	Wed May 13 17:38:07 2015	(r282865)
@@ -170,6 +170,7 @@ pci_vtrnd_init(struct vmctx *ctx, struct
 	pci_set_cfgdata16(pi, PCIR_VENDOR, VIRTIO_VENDOR);
 	pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_CRYPTO);
 	pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_ENTROPY);
+	pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR);
 
 	if (vi_intr_init(&sc->vrsc_vs, 1, fbsdrun_virtio_msix()))
 		return (1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201505131738.t4DHc8tW007662>