From owner-svn-src-head@freebsd.org Thu Aug 3 21:14:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E181FDD3A59; Thu, 3 Aug 2017 21:14:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A23606B5BF; Thu, 3 Aug 2017 21:14:47 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v73LEkib041275; Thu, 3 Aug 2017 21:14:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v73LEkr8041273; Thu, 3 Aug 2017 21:14:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201708032114.v73LEkr8041273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Aug 2017 21:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322028 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 322028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Aug 2017 21:14:48 -0000 Author: markj Date: Thu Aug 3 21:14:46 2017 New Revision: 322028 URL: https://svnweb.freebsd.org/changeset/base/322028 Log: Add subsystem vendor and device ID fields to struct pci_dev. MFC after: 1 week Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h head/sys/compat/linuxkpi/common/src/linux_pci.c Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Aug 3 19:01:46 2017 (r322027) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Thu Aug 3 21:14:46 2017 (r322028) @@ -202,6 +202,8 @@ struct pci_dev { uint64_t dma_mask; uint16_t device; uint16_t vendor; + uint16_t subsystem_vendor; + uint16_t subsystem_device; unsigned int irq; unsigned int devfn; uint32_t class; Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Aug 3 19:01:46 2017 (r322027) +++ head/sys/compat/linuxkpi/common/src/linux_pci.c Thu Aug 3 21:14:46 2017 (r322028) @@ -119,10 +119,13 @@ linux_pci_attach(device_t dev) { struct resource_list_entry *rle; struct pci_dev *pdev; + struct pci_devinfo *dinfo; struct pci_driver *pdrv; const struct pci_device_id *id; int error; + dinfo = device_get_ivars(dev); + linux_set_current(curthread); pdrv = linux_pci_find(dev, &id); pdev = device_get_softc(dev); @@ -132,6 +135,8 @@ linux_pci_attach(device_t dev) pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev)); pdev->device = id->device; pdev->vendor = id->vendor; + pdev->subsystem_vendor = dinfo->cfg.subvendor; + pdev->subsystem_device = dinfo->cfg.subdevice; pdev->class = pci_get_class(dev); pdev->revision = pci_get_revid(dev); pdev->dev.dma_mask = &pdev->dma_mask;