Merge tag 'devicetree-for-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/robh...
[cascardo/linux.git] / drivers / net / ethernet / mellanox / mlx4 / port.c
index 087b23b..3d2095e 100644 (file)
@@ -52,6 +52,7 @@
 
 #define MLX4_FLAG_V_IGNORE_FCS_MASK            0x2
 #define MLX4_IGNORE_FCS_MASK                   0x1
+#define MLNX4_TX_MAX_NUMBER                    8
 
 void mlx4_init_mac_table(struct mlx4_dev *dev, struct mlx4_mac_table *table)
 {
@@ -2015,3 +2016,14 @@ out:
        return ret;
 }
 EXPORT_SYMBOL(mlx4_get_module_info);
+
+int mlx4_max_tc(struct mlx4_dev *dev)
+{
+       u8 num_tc = dev->caps.max_tc_eth;
+
+       if (!num_tc)
+               num_tc = MLNX4_TX_MAX_NUMBER;
+
+       return num_tc;
+}
+EXPORT_SYMBOL(mlx4_max_tc);