diff options
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index a53164612cdc..3a8931e29da2 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -1280,6 +1280,12 @@ static bool r8168_check_dash(struct rtl8169_private *tp) | |||
1280 | } | 1280 | } |
1281 | } | 1281 | } |
1282 | 1282 | ||
1283 | static void rtl_reset_packet_filter(struct rtl8169_private *tp) | ||
1284 | { | ||
1285 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
1286 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
1287 | } | ||
1288 | |||
1283 | struct exgmac_reg { | 1289 | struct exgmac_reg { |
1284 | u16 addr; | 1290 | u16 addr; |
1285 | u16 mask; | 1291 | u16 mask; |
@@ -1357,9 +1363,7 @@ static void rtl_link_chg_patch(struct rtl8169_private *tp) | |||
1357 | rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x0000001f); | 1363 | rtl_eri_write(tp, 0x1bc, ERIAR_MASK_1111, 0x0000001f); |
1358 | rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x0000003f); | 1364 | rtl_eri_write(tp, 0x1dc, ERIAR_MASK_1111, 0x0000003f); |
1359 | } | 1365 | } |
1360 | /* Reset packet filter */ | 1366 | rtl_reset_packet_filter(tp); |
1361 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
1362 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
1363 | } else if (tp->mac_version == RTL_GIGA_MAC_VER_35 || | 1367 | } else if (tp->mac_version == RTL_GIGA_MAC_VER_35 || |
1364 | tp->mac_version == RTL_GIGA_MAC_VER_36) { | 1368 | tp->mac_version == RTL_GIGA_MAC_VER_36) { |
1365 | if (phydev->speed == SPEED_1000) { | 1369 | if (phydev->speed == SPEED_1000) { |
@@ -5031,8 +5035,7 @@ static void rtl_hw_start_8168f(struct rtl8169_private *tp) | |||
5031 | rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); | 5035 | rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); |
5032 | rtl_eri_write(tp, 0xc8, ERIAR_MASK_1111, 0x00100002); | 5036 | rtl_eri_write(tp, 0xc8, ERIAR_MASK_1111, 0x00100002); |
5033 | rtl_eri_write(tp, 0xe8, ERIAR_MASK_1111, 0x00100006); | 5037 | rtl_eri_write(tp, 0xe8, ERIAR_MASK_1111, 0x00100006); |
5034 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | 5038 | rtl_reset_packet_filter(tp); |
5035 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
5036 | rtl_eri_set_bits(tp, 0x1b0, ERIAR_MASK_0001, BIT(4)); | 5039 | rtl_eri_set_bits(tp, 0x1b0, ERIAR_MASK_0001, BIT(4)); |
5037 | rtl_eri_set_bits(tp, 0x1d0, ERIAR_MASK_0001, BIT(4)); | 5040 | rtl_eri_set_bits(tp, 0x1d0, ERIAR_MASK_0001, BIT(4)); |
5038 | rtl_eri_write(tp, 0xcc, ERIAR_MASK_1111, 0x00000050); | 5041 | rtl_eri_write(tp, 0xcc, ERIAR_MASK_1111, 0x00000050); |
@@ -5097,8 +5100,7 @@ static void rtl_hw_start_8168g(struct rtl8169_private *tp) | |||
5097 | 5100 | ||
5098 | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); | 5101 | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); |
5099 | 5102 | ||
5100 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | 5103 | rtl_reset_packet_filter(tp); |
5101 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
5102 | rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011, 0x1d8f); | 5104 | rtl_eri_write(tp, 0x2f8, ERIAR_MASK_0011, 0x1d8f); |
5103 | 5105 | ||
5104 | RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN); | 5106 | RTL_W32(tp, MISC, RTL_R32(tp, MISC) & ~RXDV_GATED_EN); |
@@ -5196,8 +5198,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp) | |||
5196 | 5198 | ||
5197 | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); | 5199 | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); |
5198 | 5200 | ||
5199 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | 5201 | rtl_reset_packet_filter(tp); |
5200 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
5201 | 5202 | ||
5202 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_1111, BIT(4)); | 5203 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_1111, BIT(4)); |
5203 | 5204 | ||
@@ -5280,8 +5281,7 @@ static void rtl_hw_start_8168ep(struct rtl8169_private *tp) | |||
5280 | 5281 | ||
5281 | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); | 5282 | rtl_tx_performance_tweak(tp, PCI_EXP_DEVCTL_READRQ_4096B); |
5282 | 5283 | ||
5283 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | 5284 | rtl_reset_packet_filter(tp); |
5284 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
5285 | 5285 | ||
5286 | rtl_eri_set_bits(tp, 0xd4, ERIAR_MASK_1111, 0x1f80); | 5286 | rtl_eri_set_bits(tp, 0xd4, ERIAR_MASK_1111, 0x1f80); |
5287 | 5287 | ||
@@ -5480,8 +5480,7 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp) | |||
5480 | 5480 | ||
5481 | rtl_eri_write(tp, 0xc8, ERIAR_MASK_1111, 0x00000002); | 5481 | rtl_eri_write(tp, 0xc8, ERIAR_MASK_1111, 0x00000002); |
5482 | rtl_eri_write(tp, 0xe8, ERIAR_MASK_1111, 0x00000006); | 5482 | rtl_eri_write(tp, 0xe8, ERIAR_MASK_1111, 0x00000006); |
5483 | rtl_eri_clear_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | 5483 | rtl_reset_packet_filter(tp); |
5484 | rtl_eri_set_bits(tp, 0xdc, ERIAR_MASK_0001, BIT(0)); | ||
5485 | rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); | 5484 | rtl_eri_write(tp, 0xc0, ERIAR_MASK_0011, 0x0000); |
5486 | rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); | 5485 | rtl_eri_write(tp, 0xb8, ERIAR_MASK_0011, 0x0000); |
5487 | rtl_w0w1_eri(tp, 0x0d4, ERIAR_MASK_0011, 0x0e00, 0xff00); | 5486 | rtl_w0w1_eri(tp, 0x0d4, ERIAR_MASK_0011, 0x0e00, 0xff00); |