[vbox-dev] vboxpci patch for linux-next-20180227

valdis.kletnieks at vt.edu valdis.kletnieks at vt.edu
Wed Feb 28 21:03:10 UTC 2018


Needed the following patch for yesterday's linux-next tree.

Note that Linus's tree 4.16.0-rc1 contains the patch that adds
pci_get_domain_bus_and_slot(), so the following should build on any kernel
that claims to be a 4.16.something.

Commit 5cf0c37a71da0f3a4802806c597b21d99c33ca60 which removes
pci_get_slot() looks to be 4.17 material, as it wasn't in the 4.16 merge window
but is in linux-next already.

Somebody at a higher pay grade than me will have to figure out if
passing '0' as the domain number is the right thing to do or not - it
can't be *too* wrong, because that's what the previous pci_get_slot()
code was implicitly assuming anyhow....

--- vboxpci/linux/VBoxPci-linux.c.dist	2017-12-19 02:15:30.000000000 -0500
+++ vboxpci/linux/VBoxPci-linux.c	2018-02-28 13:44:22.105771738 -0500
@@ -85,7 +85,11 @@
 MODULE_VERSION(VBOX_VERSION_STRING " r" RT_XSTR(VBOX_SVN_REV));
 #endif

-
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)
+# define PCI_DEV_GET(v,d,p)            pci_get_device(v,d,p)
+# define PCI_DEV_PUT(x)                pci_dev_put(x)
+# define  PCI_DEV_GET_SLOT(bus, devfn) pci_get_domain_bus_and_slot(0, bus, devfn)
+#else
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
 # define PCI_DEV_GET(v,d,p)            pci_get_device(v,d,p)
 # define PCI_DEV_PUT(x)                pci_dev_put(x)
@@ -95,6 +99,7 @@
 # define PCI_DEV_PUT(x)                do { } while (0)
 # define PCI_DEV_GET_SLOT(bus, devfn)  pci_find_slot(bus, devfn)
 #endif
+#endif

 /**
  * Name of module used to attach to the host PCI device, when

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 486 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20180228/73afd708/attachment.sig>


More information about the vbox-dev mailing list