Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2017 01:05:20 +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: r320635 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201707040105.v6415KWo008103@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Tue Jul  4 01:05:20 2017
New Revision: 320635
URL: https://svnweb.freebsd.org/changeset/base/320635

Log:
  Add a field for the class code to struct pci_driver.
  
  Fill out some previously uninitialized fields as well.
  
  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	Tue Jul  4 00:48:50 2017	(r320634)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h	Tue Jul  4 01:05:20 2017	(r320635)
@@ -56,8 +56,9 @@
 struct pci_device_id {
 	uint32_t	vendor;
 	uint32_t	device;
-        uint32_t	subvendor;
+	uint32_t	subvendor;
 	uint32_t	subdevice;
+	uint32_t	class;
 	uint32_t	class_mask;
 	uintptr_t	driver_data;
 };
@@ -202,7 +203,8 @@ struct pci_dev {
 	uint16_t		vendor;
 	unsigned int		irq;
 	unsigned int		devfn;
-	u8			revision;
+	uint32_t		class;
+	uint8_t			revision;
 };
 
 static inline struct resource_list_entry *

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_pci.c	Tue Jul  4 00:48:50 2017	(r320634)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c	Tue Jul  4 01:05:20 2017	(r320635)
@@ -129,8 +129,11 @@ linux_pci_attach(device_t dev)
 	pdev->dev.parent = &linux_root_device;
 	pdev->dev.bsddev = dev;
 	INIT_LIST_HEAD(&pdev->dev.irqents);
+	pdev->devfn = PCI_DEVFN(pci_get_slot(dev), pci_get_function(dev));
 	pdev->device = id->device;
 	pdev->vendor = id->vendor;
+	pdev->class = pci_get_class(dev);
+	pdev->revision = pci_get_revid(dev);
 	pdev->dev.dma_mask = &pdev->dma_mask;
 	pdev->pdrv = pdrv;
 	kobject_init(&pdev->dev.kobj, &linux_dev_ktype);



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