bnxt_en: Print FEC settings as part of the linkup dmesg.
authorMichael Chan <michael.chan@broadcom.com>
Mon, 13 Feb 2017 00:18:16 +0000 (19:18 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 13 Feb 2017 03:18:49 +0000 (22:18 -0500)
Print FEC (Forward Error Correction) autoneg and encoding settings during
link up.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index afd119097344b9526d6eef3a75cbc5f33bb70761..9f1dfbe5aae99406c5e99f5d6143ac21ba15e1fd 100644 (file)
@@ -5437,7 +5437,7 @@ static void bnxt_report_link(struct bnxt *bp)
        if (bp->link_info.link_up) {
                const char *duplex;
                const char *flow_ctrl;
-               u16 speed;
+               u16 speed, fec;
 
                netif_carrier_on(bp->dev);
                if (bp->link_info.duplex == BNXT_LINK_DUPLEX_FULL)
@@ -5459,6 +5459,12 @@ static void bnxt_report_link(struct bnxt *bp)
                        netdev_info(bp->dev, "EEE is %s\n",
                                    bp->eee.eee_active ? "active" :
                                                         "not active");
+               fec = bp->link_info.fec_cfg;
+               if (!(fec & PORT_PHY_QCFG_RESP_FEC_CFG_FEC_NONE_SUPPORTED))
+                       netdev_info(bp->dev, "FEC autoneg %s encodings: %s\n",
+                                   (fec & BNXT_FEC_AUTONEG) ? "on" : "off",
+                                   (fec & BNXT_FEC_ENC_BASE_R) ? "BaseR" :
+                                    (fec & BNXT_FEC_ENC_RS) ? "RS" : "None");
        } else {
                netif_carrier_off(bp->dev);
                netdev_err(bp->dev, "NIC Link is Down\n");
@@ -5583,6 +5589,11 @@ static int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
                        }
                }
        }
+
+       link_info->fec_cfg = PORT_PHY_QCFG_RESP_FEC_CFG_FEC_NONE_SUPPORTED;
+       if (bp->hwrm_spec_code >= 0x10504)
+               link_info->fec_cfg = le16_to_cpu(resp->fec_cfg);
+
        /* TODO: need to add more logic to report VF link */
        if (chng_link_state) {
                if (link_info->phy_link_status == BNXT_LINK_LINK)
index eaed70061dfc222608f41847effc3e994429d17f..faf26a2f726b808792fd837437bf7abb9279a8c7 100644 (file)
@@ -867,6 +867,10 @@ struct bnxt_link_info {
        u16                     force_link_speed;
        u32                     preemphasis;
        u8                      module_status;
+       u16                     fec_cfg;
+#define BNXT_FEC_AUTONEG       PORT_PHY_QCFG_RESP_FEC_CFG_FEC_AUTONEG_ENABLED
+#define BNXT_FEC_ENC_BASE_R    PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE74_ENABLED
+#define BNXT_FEC_ENC_RS                PORT_PHY_QCFG_RESP_FEC_CFG_FEC_CLAUSE91_ENABLED
 
        /* copy of requested setting from ethtool cmd */
        u8                      autoneg;