Commit 38a21b34 authored by Deepak Khungar's avatar Deepak Khungar Committed by David S. Miller

bnxt_en: Add 100G link speed reporting for BCM57454 ASIC in ethtool

Added support for 100G link speed reporting for Broadcom BCM57454
ASIC in ethtool command.
Signed-off-by: default avatarDeepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: default avatarRay Jui <ray.jui@broadcom.com>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0249056
...@@ -5471,7 +5471,8 @@ static void bnxt_report_link(struct bnxt *bp) ...@@ -5471,7 +5471,8 @@ static void bnxt_report_link(struct bnxt *bp)
if (bp->link_info.link_up) { if (bp->link_info.link_up) {
const char *duplex; const char *duplex;
const char *flow_ctrl; const char *flow_ctrl;
u16 speed, fec; u32 speed;
u16 fec;
netif_carrier_on(bp->dev); netif_carrier_on(bp->dev);
if (bp->link_info.duplex == BNXT_LINK_DUPLEX_FULL) if (bp->link_info.duplex == BNXT_LINK_DUPLEX_FULL)
...@@ -5487,7 +5488,7 @@ static void bnxt_report_link(struct bnxt *bp) ...@@ -5487,7 +5488,7 @@ static void bnxt_report_link(struct bnxt *bp)
else else
flow_ctrl = "none"; flow_ctrl = "none";
speed = bnxt_fw_to_ethtool_speed(bp->link_info.link_speed); speed = bnxt_fw_to_ethtool_speed(bp->link_info.link_speed);
netdev_info(bp->dev, "NIC Link is Up, %d Mbps %s duplex, Flow control: %s\n", netdev_info(bp->dev, "NIC Link is Up, %u Mbps %s duplex, Flow control: %s\n",
speed, duplex, flow_ctrl); speed, duplex, flow_ctrl);
if (bp->flags & BNXT_FLAG_EEE_CAP) if (bp->flags & BNXT_FLAG_EEE_CAP)
netdev_info(bp->dev, "EEE is %s\n", netdev_info(bp->dev, "EEE is %s\n",
......
...@@ -851,6 +851,7 @@ struct bnxt_link_info { ...@@ -851,6 +851,7 @@ struct bnxt_link_info {
#define BNXT_LINK_SPEED_25GB PORT_PHY_QCFG_RESP_LINK_SPEED_25GB #define BNXT_LINK_SPEED_25GB PORT_PHY_QCFG_RESP_LINK_SPEED_25GB
#define BNXT_LINK_SPEED_40GB PORT_PHY_QCFG_RESP_LINK_SPEED_40GB #define BNXT_LINK_SPEED_40GB PORT_PHY_QCFG_RESP_LINK_SPEED_40GB
#define BNXT_LINK_SPEED_50GB PORT_PHY_QCFG_RESP_LINK_SPEED_50GB #define BNXT_LINK_SPEED_50GB PORT_PHY_QCFG_RESP_LINK_SPEED_50GB
#define BNXT_LINK_SPEED_100GB PORT_PHY_QCFG_RESP_LINK_SPEED_100GB
u16 support_speeds; u16 support_speeds;
u16 auto_link_speeds; /* fw adv setting */ u16 auto_link_speeds; /* fw adv setting */
#define BNXT_LINK_SPEED_MSK_100MB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100MB #define BNXT_LINK_SPEED_MSK_100MB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100MB
...@@ -862,6 +863,7 @@ struct bnxt_link_info { ...@@ -862,6 +863,7 @@ struct bnxt_link_info {
#define BNXT_LINK_SPEED_MSK_25GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_25GB #define BNXT_LINK_SPEED_MSK_25GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_25GB
#define BNXT_LINK_SPEED_MSK_40GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_40GB #define BNXT_LINK_SPEED_MSK_40GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_40GB
#define BNXT_LINK_SPEED_MSK_50GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_50GB #define BNXT_LINK_SPEED_MSK_50GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_50GB
#define BNXT_LINK_SPEED_MSK_100GB PORT_PHY_QCFG_RESP_SUPPORT_SPEEDS_100GB
u16 support_auto_speeds; u16 support_auto_speeds;
u16 lp_auto_link_speeds; u16 lp_auto_link_speeds;
u16 force_link_speed; u16 force_link_speed;
......
...@@ -929,6 +929,9 @@ u32 _bnxt_fw_to_ethtool_adv_spds(u16 fw_speeds, u8 fw_pause) ...@@ -929,6 +929,9 @@ u32 _bnxt_fw_to_ethtool_adv_spds(u16 fw_speeds, u8 fw_pause)
if ((fw_speeds) & BNXT_LINK_SPEED_MSK_50GB) \ if ((fw_speeds) & BNXT_LINK_SPEED_MSK_50GB) \
ethtool_link_ksettings_add_link_mode(lk_ksettings, name,\ ethtool_link_ksettings_add_link_mode(lk_ksettings, name,\
50000baseCR2_Full);\ 50000baseCR2_Full);\
if ((fw_speeds) & BNXT_LINK_SPEED_MSK_100GB) \
ethtool_link_ksettings_add_link_mode(lk_ksettings, name,\
100000baseCR4_Full);\
if ((fw_pause) & BNXT_LINK_PAUSE_RX) { \ if ((fw_pause) & BNXT_LINK_PAUSE_RX) { \
ethtool_link_ksettings_add_link_mode(lk_ksettings, name,\ ethtool_link_ksettings_add_link_mode(lk_ksettings, name,\
Pause); \ Pause); \
...@@ -965,6 +968,9 @@ u32 _bnxt_fw_to_ethtool_adv_spds(u16 fw_speeds, u8 fw_pause) ...@@ -965,6 +968,9 @@ u32 _bnxt_fw_to_ethtool_adv_spds(u16 fw_speeds, u8 fw_pause)
if (ethtool_link_ksettings_test_link_mode(lk_ksettings, name, \ if (ethtool_link_ksettings_test_link_mode(lk_ksettings, name, \
50000baseCR2_Full)) \ 50000baseCR2_Full)) \
(fw_speeds) |= BNXT_LINK_SPEED_MSK_50GB; \ (fw_speeds) |= BNXT_LINK_SPEED_MSK_50GB; \
if (ethtool_link_ksettings_test_link_mode(lk_ksettings, name, \
100000baseCR4_Full)) \
(fw_speeds) |= BNXT_LINK_SPEED_MSK_100GB; \
} }
static void bnxt_fw_to_ethtool_advertised_spds(struct bnxt_link_info *link_info, static void bnxt_fw_to_ethtool_advertised_spds(struct bnxt_link_info *link_info,
...@@ -1027,6 +1033,8 @@ u32 bnxt_fw_to_ethtool_speed(u16 fw_link_speed) ...@@ -1027,6 +1033,8 @@ u32 bnxt_fw_to_ethtool_speed(u16 fw_link_speed)
return SPEED_40000; return SPEED_40000;
case BNXT_LINK_SPEED_50GB: case BNXT_LINK_SPEED_50GB:
return SPEED_50000; return SPEED_50000;
case BNXT_LINK_SPEED_100GB:
return SPEED_100000;
default: default:
return SPEED_UNKNOWN; return SPEED_UNKNOWN;
} }
...@@ -1092,7 +1100,7 @@ static int bnxt_get_link_ksettings(struct net_device *dev, ...@@ -1092,7 +1100,7 @@ static int bnxt_get_link_ksettings(struct net_device *dev,
return 0; return 0;
} }
static u32 bnxt_get_fw_speed(struct net_device *dev, u16 ethtool_speed) static u32 bnxt_get_fw_speed(struct net_device *dev, u32 ethtool_speed)
{ {
struct bnxt *bp = netdev_priv(dev); struct bnxt *bp = netdev_priv(dev);
struct bnxt_link_info *link_info = &bp->link_info; struct bnxt_link_info *link_info = &bp->link_info;
...@@ -1132,6 +1140,10 @@ static u32 bnxt_get_fw_speed(struct net_device *dev, u16 ethtool_speed) ...@@ -1132,6 +1140,10 @@ static u32 bnxt_get_fw_speed(struct net_device *dev, u16 ethtool_speed)
if (support_spds & BNXT_LINK_SPEED_MSK_50GB) if (support_spds & BNXT_LINK_SPEED_MSK_50GB)
fw_speed = PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_50GB; fw_speed = PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_50GB;
break; break;
case SPEED_100000:
if (support_spds & BNXT_LINK_SPEED_MSK_100GB)
fw_speed = PORT_PHY_CFG_REQ_AUTO_LINK_SPEED_100GB;
break;
default: default:
netdev_err(dev, "unsupported speed!\n"); netdev_err(dev, "unsupported speed!\n");
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment