net/mlx4_core: Add ethernet backplane autoneg device capability
authorSaeed Mahameed <saeedm@mellanox.com>
Mon, 27 Oct 2014 09:37:38 +0000 (11:37 +0200)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Oct 2014 21:18:00 +0000 (17:18 -0400)
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/fw.c
include/linux/mlx4/device.h

index 6fd9b8581e95acb7ce6fa23188426f4da2d83184..72289ef5ebbecc6e10ccb8ad2b5765723a59306d 100644 (file)
@@ -140,7 +140,8 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
                [11] = "MAD DEMUX (Secure-Host) support",
                [12] = "Large cache line (>64B) CQE stride support",
                [13] = "Large cache line (>64B) EQE stride support",
-               [14] = "Ethernet protocol control support"
+               [14] = "Ethernet protocol control support",
+               [15] = "Ethernet Backplane autoneg support"
        };
        int i;
 
@@ -575,6 +576,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
 #define QUERY_DEV_CAP_BMME_FLAGS_OFFSET                0x94
 #define QUERY_DEV_CAP_RSVD_LKEY_OFFSET         0x98
 #define QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET                0xa0
+#define QUERY_DEV_CAP_ETH_BACKPL_OFFSET                0x9c
 #define QUERY_DEV_CAP_FW_REASSIGN_MAC          0x9d
 #define QUERY_DEV_CAP_VXLAN                    0x9e
 #define QUERY_DEV_CAP_MAD_DEMUX_OFFSET         0xb0
@@ -749,6 +751,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
                 QUERY_DEV_CAP_BMME_FLAGS_OFFSET);
        MLX4_GET(dev_cap->reserved_lkey, outbox,
                 QUERY_DEV_CAP_RSVD_LKEY_OFFSET);
+       MLX4_GET(field32, outbox, QUERY_DEV_CAP_ETH_BACKPL_OFFSET);
+       if (field32 & (1 << 0))
+               dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP;
        MLX4_GET(field, outbox, QUERY_DEV_CAP_FW_REASSIGN_MAC);
        if (field & 1<<6)
                dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_REASSIGN_MAC_EN;
index 181cd9fc90f2601a35b10eb853fd52c5053c7e4e..e4c136ebe79bc9e72c0b493e7ca65e51723f3f8e 100644 (file)
@@ -187,7 +187,8 @@ enum {
        MLX4_DEV_CAP_FLAG2_MAD_DEMUX            = 1LL <<  11,
        MLX4_DEV_CAP_FLAG2_CQE_STRIDE           = 1LL <<  12,
        MLX4_DEV_CAP_FLAG2_EQE_STRIDE           = 1LL <<  13,
-       MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL        = 1LL <<  14
+       MLX4_DEV_CAP_FLAG2_ETH_PROT_CTRL        = 1LL <<  14,
+       MLX4_DEV_CAP_FLAG2_ETH_BACKPL_AN_REP    = 1LL <<  15
 };
 
 enum {