Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Aug 2017 21:14:46 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
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
Message-ID:  <201708032114.v73LEkr8041273@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



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