From a1ae8be4d73ddc65cb3c52cdc677e7e2636a92e9 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 3 Apr 2019 00:48:15 +0000 Subject: [PATCH] scst/include/backport.h: Add dummy pcie_capability_read_*() backports git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8142 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index caeaec206..014ab9b31 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -941,6 +941,30 @@ struct nvmefc_fcp_req { } __aligned(sizeof(u64)); /* alignment for other things alloc'd with */ #endif +/* */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) && !defined(RHEL_MAJOR) +/* + * See also commit 8c0d3a02c130 ("PCI: Add accessors for PCI Express + * Capability") # v3.7. + */ +static inline int pcie_capability_read_word(struct pci_dev *dev, int pos, + u16 *val) +{ + WARN_ON_ONCE(true); + *val = 0; + return -ENOTSUPP; +} + +static inline int pcie_capability_read_dword(struct pci_dev *dev, int pos, + u32 *val) +{ + WARN_ON_ONCE(true); + *val = 0; + return -ENOTSUPP; +} +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)