Skip to content

Commit beacabd

Browse files
committed
r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down()
Bugzilla: https://bugzilla.redhat.com/2159618 commit ad42566 Author: Chunhao Lin <hau@realtek.com> Date: Mon Dec 26 20:31:52 2022 +0800 r8169: move rtl_wol_enable_rx() and rtl_prepare_power_down() There is no functional change. Moving these two functions for following patch "r8169: fix dmar pte write access is not set error". Signed-off-by: Chunhao Lin <hau@realtek.com> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent 5a299a5 commit beacabd

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,28 +2244,6 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
22442244
return 0;
22452245
}
22462246

2247-
static void rtl_wol_enable_rx(struct rtl8169_private *tp)
2248-
{
2249-
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
2250-
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
2251-
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2252-
}
2253-
2254-
static void rtl_prepare_power_down(struct rtl8169_private *tp)
2255-
{
2256-
if (tp->dash_type != RTL_DASH_NONE)
2257-
return;
2258-
2259-
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
2260-
tp->mac_version == RTL_GIGA_MAC_VER_33)
2261-
rtl_ephy_write(tp, 0x19, 0xff64);
2262-
2263-
if (device_may_wakeup(tp_to_dev(tp))) {
2264-
phy_speed_down(tp->phydev, false);
2265-
rtl_wol_enable_rx(tp);
2266-
}
2267-
}
2268-
22692247
static void rtl_init_rxcfg(struct rtl8169_private *tp)
22702248
{
22712249
switch (tp->mac_version) {
@@ -2489,6 +2467,28 @@ static void rtl_enable_rxdvgate(struct rtl8169_private *tp)
24892467
rtl_wait_txrx_fifo_empty(tp);
24902468
}
24912469

2470+
static void rtl_wol_enable_rx(struct rtl8169_private *tp)
2471+
{
2472+
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
2473+
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
2474+
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2475+
}
2476+
2477+
static void rtl_prepare_power_down(struct rtl8169_private *tp)
2478+
{
2479+
if (tp->dash_type != RTL_DASH_NONE)
2480+
return;
2481+
2482+
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
2483+
tp->mac_version == RTL_GIGA_MAC_VER_33)
2484+
rtl_ephy_write(tp, 0x19, 0xff64);
2485+
2486+
if (device_may_wakeup(tp_to_dev(tp))) {
2487+
phy_speed_down(tp->phydev, false);
2488+
rtl_wol_enable_rx(tp);
2489+
}
2490+
}
2491+
24922492
static void rtl_set_tx_config_registers(struct rtl8169_private *tp)
24932493
{
24942494
u32 val = TX_DMA_BURST << TxDMAShift |

0 commit comments

Comments
 (0)