1 #ifndef LINUX_3_12_COMPAT_H
2 #define LINUX_3_12_COMPAT_H
4 #include <linux/version.h>
6 #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 #define file_inode LINUX_BACKPORT(file_inode)
16 static inline struct inode *file_inode(struct file *f)
18 return f->f_dentry->d_inode;
21 int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
22 enum pcie_link_width *width);
24 /* These values come from the PCI Express Spec */
25 enum pcie_link_width {
26 PCIE_LNK_WIDTH_RESRV = 0x00,
34 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
37 /* Based on the PCI Hotplug Spec, but some values are made up by us */
39 PCI_SPEED_33MHz = 0x00,
40 PCI_SPEED_66MHz = 0x01,
41 PCI_SPEED_66MHz_PCIX = 0x02,
42 PCI_SPEED_100MHz_PCIX = 0x03,
43 PCI_SPEED_133MHz_PCIX = 0x04,
44 PCI_SPEED_66MHz_PCIX_ECC = 0x05,
45 PCI_SPEED_100MHz_PCIX_ECC = 0x06,
46 PCI_SPEED_133MHz_PCIX_ECC = 0x07,
47 PCI_SPEED_66MHz_PCIX_266 = 0x09,
48 PCI_SPEED_100MHz_PCIX_266 = 0x0a,
49 PCI_SPEED_133MHz_PCIX_266 = 0x0b,
55 PCI_SPEED_66MHz_PCIX_533 = 0x11,
56 PCI_SPEED_100MHz_PCIX_533 = 0x12,
57 PCI_SPEED_133MHz_PCIX_533 = 0x13,
58 PCIE_SPEED_2_5GT = 0x14,
59 PCIE_SPEED_5_0GT = 0x15,
60 PCIE_SPEED_8_0GT = 0x16,
61 PCI_SPEED_UNKNOWN = 0xff,
64 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) */
66 #endif /* LINUX_3_12_COMPAT_H */