From: Valentine Fatiev <valentinef@nvidia.com>
Subject: [PATCH] BACKPORT: drivers/net/ethernet/mellanox/mlx5/core/uar.c

Change-Id: Ib7d7c27094e7ab37a45ceef4a1660629f4038420
---
 drivers/net/ethernet/mellanox/mlx5/core/uar.c | 4 ++++
 1 file changed, 4 insertions(+)

--- a/drivers/net/ethernet/mellanox/mlx5/core/uar.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/uar.c
@@ -358,9 +358,13 @@ static int mlx5_get_pcie_dev_link_caps(s
 		*width = (lnkcap1 & PCI_EXP_LNKCAP_MLW) >>
 			PCI_EXP_LNKCAP_MLW_SHIFT;
 		if (*speed == PCI_SPEED_UNKNOWN) { /* pre-r3.0 */
+#ifdef PCI_EXP_LNKCAP_SLS_8_0GB
 			if (lnkcap1 & PCI_EXP_LNKCAP_SLS_8_0GB)
 				*speed = PCIE_SPEED_8_0GT;
 			else if (lnkcap1 & PCI_EXP_LNKCAP_SLS_5_0GB)
+#else
+			if (lnkcap1 & PCI_EXP_LNKCAP_SLS_5_0GB)
+#endif
 				*speed = PCIE_SPEED_5_0GT;
 			else if (lnkcap1 & PCI_EXP_LNKCAP_SLS_2_5GB)
 				*speed = PCIE_SPEED_2_5GT;
