]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
r8169: fix RTL8111EVL EEE and green settings
authorHeiner Kallweit <hkallweit1@gmail.com>
Sun, 19 Nov 2017 10:09:58 +0000 (11:09 +0100)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Nov 2017 12:27:49 +0000 (21:27 +0900)
Name of functions rtl_w0w1_eri and rtl_w0w1_phy is somewhat misleading
regarding order of arguments. One could assume that w0w1 means
argument with bits to be reset comes before argument with bits to set.
However this is not the case.
So fix the order of arguments in several statements.

In addition fix EEE advertisement. The current code resets the bits
for 100BaseT and 1000BaseT EEE advertisement what is not what we want.

I have a little of a hard time to find a proper "Fixes" line as the
issue seems to have been there forever (at least it existed already
when the driver was moved to the current place in 2011).

The patch was tested on a Zotac Mini-PC with a RTL8111E-VL chip.
Before the patch EEE was disabled, now it's properly advertised and
works fine.

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

index dcb8c39382e70560a996832785bfbbd1db76d7e9..19f3074a0a689e5b7d26fb0d8c3f6d570425e4f2 100644 (file)
@@ -3789,26 +3789,26 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
        rtl_writephy(tp, 0x1f, 0x0000);
 
        /* EEE setting */
-       rtl_w0w1_eri(tp, 0x1b0, ERIAR_MASK_1111, 0x0000, 0x0003, ERIAR_EXGMAC);
+       rtl_w0w1_eri(tp, 0x1b0, ERIAR_MASK_1111, 0x0003, 0x0000, ERIAR_EXGMAC);
        rtl_writephy(tp, 0x1f, 0x0005);
        rtl_writephy(tp, 0x05, 0x8b85);
-       rtl_w0w1_phy(tp, 0x06, 0x0000, 0x2000);
+       rtl_w0w1_phy(tp, 0x06, 0x2000, 0x0000);
        rtl_writephy(tp, 0x1f, 0x0004);
        rtl_writephy(tp, 0x1f, 0x0007);
        rtl_writephy(tp, 0x1e, 0x0020);
-       rtl_w0w1_phy(tp, 0x15, 0x0000, 0x0100);
+       rtl_w0w1_phy(tp, 0x15, 0x0100, 0x0000);
        rtl_writephy(tp, 0x1f, 0x0002);
        rtl_writephy(tp, 0x1f, 0x0000);
        rtl_writephy(tp, 0x0d, 0x0007);
        rtl_writephy(tp, 0x0e, 0x003c);
        rtl_writephy(tp, 0x0d, 0x4007);
-       rtl_writephy(tp, 0x0e, 0x0000);
+       rtl_writephy(tp, 0x0e, 0x0006);
        rtl_writephy(tp, 0x0d, 0x0000);
 
        /* Green feature */
        rtl_writephy(tp, 0x1f, 0x0003);
-       rtl_w0w1_phy(tp, 0x19, 0x0000, 0x0001);
-       rtl_w0w1_phy(tp, 0x10, 0x0000, 0x0400);
+       rtl_w0w1_phy(tp, 0x19, 0x0001, 0x0000);
+       rtl_w0w1_phy(tp, 0x10, 0x0400, 0x0000);
        rtl_writephy(tp, 0x1f, 0x0000);
 
        /* Broken BIOS workaround: feed GigaMAC registers with MAC address. */