Commit 9617886f authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Jakub Kicinski

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent e031ce80
...@@ -2494,6 +2494,12 @@ DECLARE_RTL_COND(rtl_txcfg_empty_cond) ...@@ -2494,6 +2494,12 @@ DECLARE_RTL_COND(rtl_txcfg_empty_cond)
return RTL_R32(tp, TxConfig) & TXCFG_EMPTY; 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) static void rtl8169_hw_reset(struct rtl8169_private *tp)
{ {
/* Disable interrupts */ /* Disable interrupts */
...@@ -5131,7 +5137,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp) ...@@ -5131,7 +5137,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
static void rtl_hw_init_8168g(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)) if (!rtl_loop_wait_high(tp, &rtl_txcfg_empty_cond, 100, 42))
return; return;
...@@ -5152,7 +5158,7 @@ static void rtl_hw_init_8168g(struct rtl8169_private *tp) ...@@ -5152,7 +5158,7 @@ static void rtl_hw_init_8168g(struct rtl8169_private *tp)
static void rtl_hw_init_8125(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)) if (!rtl_loop_wait_high(tp, &rtl_rxtx_empty_cond, 100, 42))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment