diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2020-05-08 23:30:43 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-05-08 22:41:55 -0700 |
commit | 9617886fa65d3264c5aac5f1305e8e5a6ca865f4 (patch) | |
tree | 4864d559a4bdc7dccaf3c844dfcd636e24adbf8b /drivers/net/ethernet | |
parent | e031ce80d9f9867ab7c27b9acaadd75c62d6007a (diff) | |
download | linux-9617886fa65d3264c5aac5f1305e8e5a6ca865f4.tar.bz2 |
r8169: add helper rtl_enable_rxdvgate
Add a helper for setting RXDV_GATED_EN, the 2ms delay is copied from
the vendor driver.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169_main.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index ba67864c04c1..5b389d3e7c9a 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -2494,6 +2494,12 @@ DECLARE_RTL_COND(rtl_txcfg_empty_cond) return RTL_R32(tp, TxConfig) & TXCFG_EMPTY; } +static void rtl_enable_rxdvgate(struct rtl8169_private *tp) +{ + RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN); + fsleep(2000); +} + static void rtl8169_hw_reset(struct rtl8169_private *tp) { /* Disable interrupts */ @@ -5131,7 +5137,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp) static void rtl_hw_init_8168g(struct rtl8169_private *tp) { - RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN); + rtl_enable_rxdvgate(tp); if (!rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 42)) return; @@ -5152,7 +5158,7 @@ static void rtl_hw_init_8168g(struct rtl8169_private *tp) static void rtl_hw_init_8125(struct rtl8169_private *tp) { - RTL_W32(tp, MISC, RTL_R32(tp, MISC) | RXDV_GATED_EN); + rtl_enable_rxdvgate(tp); if (!rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42)) return; |