This is to avoid redefinition of 'enum pcie_link_width' on OSes that
backport this enum.
Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
LB_LINUX_TRY_COMPILE([
#include <linux/pci.h>
],[
- enum pcie_link_width *x;
+ enum pcie_link_width width = PCIE_LNK_WIDTH_UNKNOWN;
return 0;
],[
int pcie_get_minimum_link(struct pci_dev *dev, enum pci_bus_speed *speed,
enum pcie_link_width *width);
+#ifndef HAVE_PCIE_LINK_WIDTH
/* These values come from the PCI Express Spec */
enum pcie_link_width {
PCIE_LNK_WIDTH_RESRV = 0x00,
PCIE_LNK_X32 = 0x20,
PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
};
+#endif
#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)) */