Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Aug 2019 18:46:10 +0000 (UTC)
From:      Hiroki Sato <hrs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r351482 - head/sys/dev/vmware/vmci
Message-ID:  <201908251846.x7PIkAUc002314@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hrs
Date: Sun Aug 25 18:46:10 2019
New Revision: 351482
URL: https://svnweb.freebsd.org/changeset/base/351482

Log:
  Add MODULE_PNP_INFO() to vmci(4).  This allows devd(8) to load the
  kernel module automatically when FreeBSD is running on VMware.
  
  Reviewed by:		mp
  Differential Revision:	https://reviews.freebsd.org/D21182

Modified:
  head/sys/dev/vmware/vmci/vmci.c

Modified: head/sys/dev/vmware/vmci/vmci.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci.c	Sun Aug 25 17:55:31 2019	(r351481)
+++ head/sys/dev/vmware/vmci/vmci.c	Sun Aug 25 18:46:10 2019	(r351482)
@@ -73,6 +73,16 @@ static driver_t vmci_driver = {
 static devclass_t vmci_devclass;
 DRIVER_MODULE(vmci, pci, vmci_driver, vmci_devclass, 0, 0);
 MODULE_VERSION(vmci, VMCI_VERSION);
+const struct {
+	uint16_t vendor;
+	uint16_t device;
+	const char *desc;
+} vmci_ids[] = {
+	{ VMCI_VMWARE_VENDOR_ID, VMCI_VMWARE_DEVICE_ID,
+	    "VMware Virtual Machine Communication Interface" },
+};
+MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, vmci, vmci_ids,
+    nitems(vmci_ids));
 
 MODULE_DEPEND(vmci, pci, 1, 1, 1);
 
@@ -112,10 +122,9 @@ static int
 vmci_probe(device_t dev)
 {
 
-	if (pci_get_vendor(dev) == VMCI_VMWARE_VENDOR_ID &&
-	    pci_get_device(dev) == VMCI_VMWARE_DEVICE_ID) {
-		device_set_desc(dev,
-		    "VMware Virtual Machine Communication Interface");
+	if (pci_get_vendor(dev) == vmci_ids[0].vendor &&
+	    pci_get_device(dev) == vmci_ids[0].device) {
+		device_set_desc(dev, vmci_ids[0].desc);
 
 		return (BUS_PROBE_DEFAULT);
 	}



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