1 #ifndef LINUX_3_12_COMPAT_H
2 #define LINUX_3_12_COMPAT_H
4 #include <linux/version.h>
5 #include <../../compat/config.h>
7 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0))
9 #ifndef PTR_ERR_OR_ZERO
10 #define PTR_ERR_OR_ZERO(p) PTR_RET(p)
13 #define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
15 #include <linux/pci.h>
17 #ifndef HAVE_PCIE_LINK_WIDTH
18 /* These values come from the PCI Express Spec */
19 enum pcie_link_width {
20 PCIE_LNK_WIDTH_RESRV = 0x00,
28 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
32 extern const unsigned char pcie_link_speed[];
34 #ifndef HAVE_PCIE_GET_MINIMUM_LINK
35 #define pcie_get_minimum_link LINUX_BACKPORT(pcie_get_minimum_link)
36 int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
37 enum pcie_link_width *width);
39 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) */
40 #endif /* LINUX_3_12_COMPAT_H */