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

Change-Id: I2842ac9a3e88d1c27ded1a1f52a5f13511d8058d
---
 drivers/net/ethernet/mellanox/mlx5/core/fw.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

--- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
@@ -262,11 +262,13 @@ int mlx5_query_hca_caps(struct mlx5_core
 			return err;
 	}
 
+#ifdef HAVE_UAPI_LINUX_TLS_H
 	if (mlx5_accel_is_ktls_tx(dev) || mlx5_accel_is_ktls_rx(dev)) {
 		err = mlx5_core_get_caps(dev, MLX5_CAP_TLS);
 		if (err)
 			return err;
 	}
+#endif
 
 	if (MLX5_CAP_GEN_64(dev, general_obj_types) &
 		MLX5_GENERAL_OBJ_TYPES_CAP_VIRTIO_NET_Q) {
@@ -706,15 +708,20 @@ static const struct mlxfw_dev_ops mlx5_m
 };
 
 int mlx5_firmware_flash(struct mlx5_core_dev *dev,
-			const struct firmware *firmware,
-			struct netlink_ext_ack *extack)
+			const struct firmware *firmware
+#ifdef HAVE_NETLINK_EXT_ACK
+			, struct netlink_ext_ack *extack
+#endif
+			)
 {
 	struct mlx5_mlxfw_dev mlx5_mlxfw_dev = {
 		.mlxfw_dev = {
 			.ops = &mlx5_mlxfw_dev_ops,
 			.psid = dev->board_id,
 			.psid_size = strlen(dev->board_id),
+#ifdef HAVE_DEVLINK_H
 			.devlink = priv_to_devlink(dev),
+#endif
 		},
 		.mlx5_core_dev = dev
 	};
@@ -728,7 +735,11 @@ int mlx5_firmware_flash(struct mlx5_core
 	}
 
 	return mlxfw_firmware_flash(&mlx5_mlxfw_dev.mlxfw_dev,
-				    firmware, extack);
+				    firmware
+#ifdef HAVE_NETLINK_EXT_ACK
+				    , extack
+#endif
+				    );
 }
 
 static int mlx5_reg_mcqi_version_query(struct mlx5_core_dev *dev,
