Move pci_bus_speed enum to compat-2.6.34.h
authorVladimir Sokolovsky <vlad@mellanox.com>
Wed, 5 Nov 2014 12:28:16 +0000 (14:28 +0200)
committerVladimir Sokolovsky <vlad@mellanox.com>
Wed, 5 Nov 2014 12:28:16 +0000 (14:28 +0200)
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
config/rdma.m4
include/linux/compat-2.6.34.h
include/linux/compat-3.12.h

index cd07a45..d7d1ddb 100644 (file)
@@ -458,6 +458,21 @@ AC_DEFUN([LINUX_CONFIG_COMPAT],
                AC_MSG_RESULT(no)
        ])
 
+       AC_MSG_CHECKING([if pci.h has enum pci_bus_speed])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/pci.h>
+       ],[
+               enum pci_bus_speed speed = PCI_SPEED_UNKNOWN;
+
+               return 0;
+       ],[
+               AC_MSG_RESULT(yes)
+               AC_DEFINE(HAVE_PCI_BUS_SPEED, 1,
+                         [pci_bus_speed is defined])
+       ],[
+               AC_MSG_RESULT(no)
+       ])
+
        AC_MSG_CHECKING([if netdevice.h has struct netdev_phys_port_id])
        LB_LINUX_TRY_COMPILE([
                #include <linux/netdevice.h>
index 7fba70b..370bf99 100644 (file)
@@ -390,6 +390,35 @@ static inline u8 pci_vpd_srdt_size(const u8 *srdt)
        return (*srdt) & PCI_VPD_SRDT_LEN_MASK;
 }
 
+#ifndef HAVE_PCI_BUS_SPEED
+/* Based on the PCI Hotplug Spec, but some values are made up by us */
+enum pci_bus_speed {
+       PCI_SPEED_33MHz                 = 0x00,
+       PCI_SPEED_66MHz                 = 0x01,
+       PCI_SPEED_66MHz_PCIX            = 0x02,
+       PCI_SPEED_100MHz_PCIX           = 0x03,
+       PCI_SPEED_133MHz_PCIX           = 0x04,
+       PCI_SPEED_66MHz_PCIX_ECC        = 0x05,
+       PCI_SPEED_100MHz_PCIX_ECC       = 0x06,
+       PCI_SPEED_133MHz_PCIX_ECC       = 0x07,
+       PCI_SPEED_66MHz_PCIX_266        = 0x09,
+       PCI_SPEED_100MHz_PCIX_266       = 0x0a,
+       PCI_SPEED_133MHz_PCIX_266       = 0x0b,
+       AGP_UNKNOWN                     = 0x0c,
+       AGP_1X                          = 0x0d,
+       AGP_2X                          = 0x0e,
+       AGP_4X                          = 0x0f,
+       AGP_8X                          = 0x10,
+       PCI_SPEED_66MHz_PCIX_533        = 0x11,
+       PCI_SPEED_100MHz_PCIX_533       = 0x12,
+       PCI_SPEED_133MHz_PCIX_533       = 0x13,
+       PCIE_SPEED_2_5GT                = 0x14,
+       PCIE_SPEED_5_0GT                = 0x15,
+       PCIE_SPEED_8_0GT                = 0x16,
+       PCI_SPEED_UNKNOWN               = 0xff,
+};
+#endif
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
 
 
index b50c700..36bb58e 100644 (file)
@@ -34,33 +34,6 @@ enum pcie_link_width {
        PCIE_LNK_WIDTH_UNKNOWN  = 0xFF,
 };
 
-/* Based on the PCI Hotplug Spec, but some values are made up by us */
-enum pci_bus_speed {
-       PCI_SPEED_33MHz                 = 0x00,
-       PCI_SPEED_66MHz                 = 0x01,
-       PCI_SPEED_66MHz_PCIX            = 0x02,
-       PCI_SPEED_100MHz_PCIX           = 0x03,
-       PCI_SPEED_133MHz_PCIX           = 0x04,
-       PCI_SPEED_66MHz_PCIX_ECC        = 0x05,
-       PCI_SPEED_100MHz_PCIX_ECC       = 0x06,
-       PCI_SPEED_133MHz_PCIX_ECC       = 0x07,
-       PCI_SPEED_66MHz_PCIX_266        = 0x09,
-       PCI_SPEED_100MHz_PCIX_266       = 0x0a,
-       PCI_SPEED_133MHz_PCIX_266       = 0x0b,
-       AGP_UNKNOWN                     = 0x0c,
-       AGP_1X                          = 0x0d,
-       AGP_2X                          = 0x0e,
-       AGP_4X                          = 0x0f,
-       AGP_8X                          = 0x10,
-       PCI_SPEED_66MHz_PCIX_533        = 0x11,
-       PCI_SPEED_100MHz_PCIX_533       = 0x12,
-       PCI_SPEED_133MHz_PCIX_533       = 0x13,
-       PCIE_SPEED_2_5GT                = 0x14,
-       PCIE_SPEED_5_0GT                = 0x15,
-       PCIE_SPEED_8_0GT                = 0x16,
-       PCI_SPEED_UNKNOWN               = 0xff,
-};
-
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) */
 
 #endif /* LINUX_3_12_COMPAT_H */