r8169: sync EEE handling for RTL8168h with vendor driver
authorHeiner Kallweit <hkallweit1@gmail.com>
Thu, 15 Aug 2019 12:21:30 +0000 (14:21 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 15 Aug 2019 18:49:43 +0000 (11:49 -0700)
Sync EEE init for RTL8168h with vendor driver and add two writes to
vendor-specific registers.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/realtek/r8169_main.c

index c9550b4f97b9cfa33b551bc5d03ba29b2623909c..910944120a6588d3e80f9701467e1367ab8f8637 100644 (file)
@@ -2216,6 +2216,16 @@ static void rtl8168g_config_eee_phy(struct rtl8169_private *tp)
        phy_modify_paged(tp->phydev, 0x0a43, 0x11, 0, BIT(4));
 }
 
+static void rtl8168h_config_eee_phy(struct rtl8169_private *tp)
+{
+       struct phy_device *phydev = tp->phydev;
+
+       rtl8168g_config_eee_phy(tp);
+
+       phy_modify_paged(phydev, 0xa4a, 0x11, 0x0000, 0x0200);
+       phy_modify_paged(phydev, 0xa42, 0x14, 0x0000, 0x0080);
+}
+
 static void rtl8169s_hw_phy_config(struct rtl8169_private *tp)
 {
        static const struct phy_reg phy_reg_init[] = {
@@ -3283,7 +3293,7 @@ static void rtl8168h_1_hw_phy_config(struct rtl8169_private *tp)
        phy_modify_paged(tp->phydev, 0x0a44, 0x11, BIT(7), 0);
 
        rtl8168g_disable_aldps(tp);
-       rtl8168g_config_eee_phy(tp);
+       rtl8168h_config_eee_phy(tp);
        rtl_enable_eee(tp);
 }