Skip to content

Commit ad42566

Browse files
RealtekNICdavem330
authored andcommitted
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 <[email protected]> Reviewed-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e71460d commit ad42566

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
@@ -2210,28 +2210,6 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
22102210
return 0;
22112211
}
22122212

2213-
static void rtl_wol_enable_rx(struct rtl8169_private *tp)
2214-
{
2215-
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
2216-
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
2217-
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2218-
}
2219-
2220-
static void rtl_prepare_power_down(struct rtl8169_private *tp)
2221-
{
2222-
if (tp->dash_type != RTL_DASH_NONE)
2223-
return;
2224-
2225-
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
2226-
tp->mac_version == RTL_GIGA_MAC_VER_33)
2227-
rtl_ephy_write(tp, 0x19, 0xff64);
2228-
2229-
if (device_may_wakeup(tp_to_dev(tp))) {
2230-
phy_speed_down(tp->phydev, false);
2231-
rtl_wol_enable_rx(tp);
2232-
}
2233-
}
2234-
22352213
static void rtl_init_rxcfg(struct rtl8169_private *tp)
22362214
{
22372215
switch (tp->mac_version) {
@@ -2455,6 +2433,28 @@ static void rtl_enable_rxdvgate(struct rtl8169_private *tp)
24552433
rtl_wait_txrx_fifo_empty(tp);
24562434
}
24572435

2436+
static void rtl_wol_enable_rx(struct rtl8169_private *tp)
2437+
{
2438+
if (tp->mac_version >= RTL_GIGA_MAC_VER_25)
2439+
RTL_W32(tp, RxConfig, RTL_R32(tp, RxConfig) |
2440+
AcceptBroadcast | AcceptMulticast | AcceptMyPhys);
2441+
}
2442+
2443+
static void rtl_prepare_power_down(struct rtl8169_private *tp)
2444+
{
2445+
if (tp->dash_type != RTL_DASH_NONE)
2446+
return;
2447+
2448+
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
2449+
tp->mac_version == RTL_GIGA_MAC_VER_33)
2450+
rtl_ephy_write(tp, 0x19, 0xff64);
2451+
2452+
if (device_may_wakeup(tp_to_dev(tp))) {
2453+
phy_speed_down(tp->phydev, false);
2454+
rtl_wol_enable_rx(tp);
2455+
}
2456+
}
2457+
24582458
static void rtl_set_tx_config_registers(struct rtl8169_private *tp)
24592459
{
24602460
u32 val = TX_DMA_BURST << TxDMAShift |

0 commit comments

Comments
 (0)