From owner-dev-commits-src-all@freebsd.org Tue Dec 29 22:27:01 2020 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 892D94CCA6B; Tue, 29 Dec 2020 22:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D58D53W33z3kZh; Tue, 29 Dec 2020 22:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6B7781375C; Tue, 29 Dec 2020 22:27:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 0BTMR1mM044027; Tue, 29 Dec 2020 22:27:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 0BTMR1DK044026; Tue, 29 Dec 2020 22:27:01 GMT (envelope-from git) Date: Tue, 29 Dec 2020 22:27:01 GMT Message-Id: <202012292227.0BTMR1DK044026@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hiroki Sato Subject: git: 6338833c50a7 - stable/12 - Add MODULE_PNP_INFO() to vmci(4). This allows devd(8) to load the kernel module automatically when FreeBSD is running on VMware. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hrs X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 6338833c50a7566d006b722c791a6a92071309b8 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for all branches of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 22:27:01 -0000 The branch stable/12 has been updated by hrs: URL: https://cgit.FreeBSD.org/src/commit/?id=6338833c50a7566d006b722c791a6a92071309b8 commit 6338833c50a7566d006b722c791a6a92071309b8 Author: Hiroki Sato AuthorDate: 2019-08-25 18:46:10 +0000 Commit: Hiroki Sato CommitDate: 2020-12-29 21:48:32 +0000 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 (cherry picked from commit 639eac208771e9eb3d1141882514be35377abeee) --- sys/dev/vmware/vmci/vmci.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/dev/vmware/vmci/vmci.c b/sys/dev/vmware/vmci/vmci.c index dc029419e20d..82e23daa4c71 100644 --- a/sys/dev/vmware/vmci/vmci.c +++ b/sys/dev/vmware/vmci/vmci.c @@ -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); }