@@ -2210,28 +2210,6 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
2210
2210
return 0 ;
2211
2211
}
2212
2212
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
-
2235
2213
static void rtl_init_rxcfg (struct rtl8169_private * tp )
2236
2214
{
2237
2215
switch (tp -> mac_version ) {
@@ -2455,6 +2433,31 @@ static void rtl_enable_rxdvgate(struct rtl8169_private *tp)
2455
2433
rtl_wait_txrx_fifo_empty (tp );
2456
2434
}
2457
2435
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
+ if (tp -> mac_version >= RTL_GIGA_MAC_VER_40 )
2443
+ rtl_disable_rxdvgate (tp );
2444
+ }
2445
+
2446
+ static void rtl_prepare_power_down (struct rtl8169_private * tp )
2447
+ {
2448
+ if (tp -> dash_type != RTL_DASH_NONE )
2449
+ return ;
2450
+
2451
+ if (tp -> mac_version == RTL_GIGA_MAC_VER_32 ||
2452
+ tp -> mac_version == RTL_GIGA_MAC_VER_33 )
2453
+ rtl_ephy_write (tp , 0x19 , 0xff64 );
2454
+
2455
+ if (device_may_wakeup (tp_to_dev (tp ))) {
2456
+ phy_speed_down (tp -> phydev , false);
2457
+ rtl_wol_enable_rx (tp );
2458
+ }
2459
+ }
2460
+
2458
2461
static void rtl_set_tx_config_registers (struct rtl8169_private * tp )
2459
2462
{
2460
2463
u32 val = TX_DMA_BURST << TxDMAShift |
@@ -3872,7 +3875,7 @@ static void rtl8169_tx_clear(struct rtl8169_private *tp)
3872
3875
netdev_reset_queue (tp -> dev );
3873
3876
}
3874
3877
3875
- static void rtl8169_cleanup (struct rtl8169_private * tp , bool going_down )
3878
+ static void rtl8169_cleanup (struct rtl8169_private * tp )
3876
3879
{
3877
3880
napi_disable (& tp -> napi );
3878
3881
@@ -3884,9 +3887,6 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
3884
3887
3885
3888
rtl_rx_close (tp );
3886
3889
3887
- if (going_down && tp -> dev -> wol_enabled )
3888
- goto no_reset ;
3889
-
3890
3890
switch (tp -> mac_version ) {
3891
3891
case RTL_GIGA_MAC_VER_28 :
3892
3892
case RTL_GIGA_MAC_VER_31 :
@@ -3907,7 +3907,7 @@ static void rtl8169_cleanup(struct rtl8169_private *tp, bool going_down)
3907
3907
}
3908
3908
3909
3909
rtl_hw_reset (tp );
3910
- no_reset :
3910
+
3911
3911
rtl8169_tx_clear (tp );
3912
3912
rtl8169_init_ring_indexes (tp );
3913
3913
}
@@ -3918,7 +3918,7 @@ static void rtl_reset_work(struct rtl8169_private *tp)
3918
3918
3919
3919
netif_stop_queue (tp -> dev );
3920
3920
3921
- rtl8169_cleanup (tp , false );
3921
+ rtl8169_cleanup (tp );
3922
3922
3923
3923
for (i = 0 ; i < NUM_RX_DESC ; i ++ )
3924
3924
rtl8169_mark_to_asic (tp -> RxDescArray + i );
@@ -4605,7 +4605,7 @@ static void rtl8169_down(struct rtl8169_private *tp)
4605
4605
pci_clear_master (tp -> pci_dev );
4606
4606
rtl_pci_commit (tp );
4607
4607
4608
- rtl8169_cleanup (tp , true );
4608
+ rtl8169_cleanup (tp );
4609
4609
rtl_disable_exit_l1 (tp );
4610
4610
rtl_prepare_power_down (tp );
4611
4611
}
0 commit comments