diff --git a/Makefile b/Makefile index 5051f7e..7eb86b5 100644 --- a/Makefile +++ b/Makefile @@ -37,14 +37,14 @@ ENABLE_DASH_PRINTER_SUPPORT = n CONFIG_DOWN_SPEED_100 = n CONFIG_ASPM = y ENABLE_S5WOL = y -ENABLE_S5_KEEP_CURR_MAC = n +ENABLE_S5_KEEP_CURR_MAC = y ENABLE_EEE = y ENABLE_S0_MAGIC_PACKET = n ENABLE_TX_NO_CLOSE = y ENABLE_MULTIPLE_TX_QUEUE = y ENABLE_PTP_SUPPORT = n ENABLE_PTP_MASTER_MODE = n -ENABLE_RSS_SUPPORT = n +ENABLE_RSS_SUPPORT = y ENABLE_LIB_SUPPORT = n ENABLE_USE_FIRMWARE_FILE = n DISABLE_WOL_SUPPORT = n diff --git a/r8125.h b/r8125.h index 0d7474f..a94fcdd 100644 --- a/r8125.h +++ b/r8125.h @@ -1563,6 +1563,8 @@ enum RTL8125_register_content { LinkStatus = 0x02, FullDup = 0x01, +#define RTL8125_FULL_DUPLEX_MASK (_2500bpsF | _1000bpsF | FullDup) + /* DBG_reg */ Fix_Nak_1 = (1 << 4), Fix_Nak_2 = (1 << 3), diff --git a/r8125_n.c b/r8125_n.c index 90a8707..a880093 100644 --- a/r8125_n.c +++ b/r8125_n.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -5112,6 +5113,38 @@ rtl8125_link_down_patch(struct net_device *dev) #endif } +static unsigned int rtl8125_phy_duplex(u16 status) +{ + unsigned int duplex = DUPLEX_UNKNOWN; + + if (status & LinkStatus) { + if (status & RTL8125_FULL_DUPLEX_MASK) + duplex = DUPLEX_FULL; + else + duplex = DUPLEX_HALF; + } + + return duplex; +} + +static int rtl8125_phy_speed(u16 status) +{ + int speed = SPEED_UNKNOWN; + + if (status & LinkStatus) { + if (status & _2500bpsF) + speed = SPEED_2500; + else if (status & _1000bpsF) + speed = SPEED_1000; + else if (status & _100bps) + speed = SPEED_100; + else if (status & _10bps) + speed = SPEED_10; + } + + return speed; +} + static void _rtl8125_check_link_status(struct net_device *dev) { @@ -5120,11 +5153,18 @@ _rtl8125_check_link_status(struct net_device *dev) if (tp->link_ok(dev)) { rtl8125_link_on_patch(dev); - if (netif_msg_ifup(tp)) - printk(KERN_INFO PFX "%s: link up\n", dev->name); + if (netif_msg_ifup(tp)) { + const u16 phy_status = RTL_R16(tp, PHYstatus); + const unsigned int phy_duplex = rtl8125_phy_duplex(phy_status); + const int phy_speed = rtl8125_phy_speed(phy_status); + printk(KERN_INFO PFX "%s: Link is Up - %s/%s\n", + dev->name, + phy_speed_to_str(phy_speed), + phy_duplex_to_str(phy_duplex)); + } } else { if (netif_msg_ifdown(tp)) - printk(KERN_INFO PFX "%s: link down\n", dev->name); + printk(KERN_INFO PFX "%s: Link is Down\n", dev->name); rtl8125_link_down_patch(dev); } diff --git a/r8125_rss.c b/r8125_rss.c index 691cd8d..4ee77af 100644 --- a/r8125_rss.c +++ b/r8125_rss.c @@ -91,7 +91,7 @@ int rtl8125_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, struct rtl8125_private *tp = netdev_priv(dev); int ret = -EOPNOTSUPP; - netif_info(tp, drv, tp->dev, "rss get rxnfc\n"); + netif_dbg(tp, drv, tp->dev, "rss get rxnfc\n"); if (!(dev->features & NETIF_F_RXHASH)) return ret;