Date: Wed, 5 Dec 2018 13:17:46 +0000 (UTC) From: Slava Shwartsman <slavash@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341520 - head/sys/compat/linuxkpi/common/include/linux Message-ID: <201812051317.wB5DHkZ9064024@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: slavash Date: Wed Dec 5 13:17:45 2018 New Revision: 341520 URL: https://svnweb.freebsd.org/changeset/base/341520 Log: 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. Approved by: hselasky (mentor) MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/pci.h Wed Dec 5 13:17:15 2018 (r341519) +++ head/sys/compat/linuxkpi/common/include/linux/pci.h Wed Dec 5 13:17:45 2018 (r341520) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812051317.wB5DHkZ9064024>