VirtualBox

Changeset 72139 in vbox


Ignore:
Timestamp:
May 7, 2018 1:54:48 PM (7 years ago)
Author:
vboxsync
Message:

Patch to fix kernel API changes in 4.17
In kernel 4.17, pci_get_bus_and_slot() has been removed in favor of
pci_get_domain_bus_and_slot(). It appears that VirtualBox only uses
domain number 0, thus pci_get_domain_bus_and_slot(0, bus, devfn)
is a suitable replacement for pci_get_bus_and_slot(bus, devfn).

The resulting code compiles; however, I do not use PCI passthru, which
I think means that I have not actually tested the code.

This patch released under a combined MIT/GPLv2 license.

Signed-off-by: Larry Finger <Larry.Finger@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxPci/linux/VBoxPci-linux.c

    r69744 r72139  
    9090# define PCI_DEV_GET(v,d,p)            pci_get_device(v,d,p)
    9191# define PCI_DEV_PUT(x)                pci_dev_put(x)
     92#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
     93/* assume the domain number to be zero - exactly the same assumption of
     94 * pci_get_bus_and_slot()
     95 */
     96# define PCI_DEV_GET_SLOT(bus, devfn)  pci_get_domain_bus_and_slot(0, bus, devfn)
     97#else
    9298# define PCI_DEV_GET_SLOT(bus, devfn)  pci_get_bus_and_slot(bus, devfn)
     99#endif
    93100#else
    94101# define PCI_DEV_GET(v,d,p)            pci_find_device(v,d,p)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette