svn commit: r341854 - stable/11/sys/compat/linuxkpi/common/include/linux
Hans Petter Selasky
hselasky at FreeBSD.org
Wed Dec 12 10:14:53 UTC 2018
Author: hselasky
Date: Wed Dec 12 10:14:52 2018
New Revision: 341854
URL: https://svnweb.freebsd.org/changeset/base/341854
Log:
MFC r341520:
linuxkpi: Really check if PCI is offline
Currently we always return false if for PCI offline query.
Try to read PCI config, if the return value if 0xffff probably the
PCI is offline.
Sponsored by: Mellanox Technologies
Modified:
stable/11/sys/compat/linuxkpi/common/include/linux/pci.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Wed Dec 12 10:13:49 2018 (r341853)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Wed Dec 12 10:14:52 2018 (r341854)
@@ -601,9 +601,11 @@ pci_enable_msix_range(struct pci_dev *dev, struct msix
return (nvec);
}
-static inline int pci_channel_offline(struct pci_dev *pdev)
+static inline int
+pci_channel_offline(struct pci_dev *pdev)
{
- return false;
+
+ return (pci_get_vendor(pdev->dev.bsddev) == 0xffff);
}
static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn)
More information about the svn-src-stable-11
mailing list