aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorHayes Wang <hayeswang@realtek.com>2011-02-22 04:26:22 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2011-02-23 17:31:17 -0500
commit5d2e19572a66be1e349faba289b7bd049b85bc98 (patch)
treeae0e47807171ccb41616e4c9f84502f0a873c4af /drivers/net/r8169.c
parentd24e9aafe5d5dfdf6d114b29e67f8afd5fae5ef0 (diff)
r8169: fix RTL8168DP power off issue.
- fix the RTL8111DP turn off the power when DASH is enabled. - RTL_GIGA_MAC_VER_27 must wait for tx finish before reset. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 336ba9480e18..ef2133b16f8c 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2869,8 +2869,11 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
2869{ 2869{
2870 void __iomem *ioaddr = tp->mmio_addr; 2870 void __iomem *ioaddr = tp->mmio_addr;
2871 2871
2872 if (tp->mac_version == RTL_GIGA_MAC_VER_27) 2872 if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
2873 (tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
2874 (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
2873 return; 2875 return;
2876 }
2874 2877
2875 if (((tp->mac_version == RTL_GIGA_MAC_VER_23) || 2878 if (((tp->mac_version == RTL_GIGA_MAC_VER_23) ||
2876 (tp->mac_version == RTL_GIGA_MAC_VER_24)) && 2879 (tp->mac_version == RTL_GIGA_MAC_VER_24)) &&
@@ -2892,6 +2895,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
2892 switch (tp->mac_version) { 2895 switch (tp->mac_version) {
2893 case RTL_GIGA_MAC_VER_25: 2896 case RTL_GIGA_MAC_VER_25:
2894 case RTL_GIGA_MAC_VER_26: 2897 case RTL_GIGA_MAC_VER_26:
2898 case RTL_GIGA_MAC_VER_27:
2899 case RTL_GIGA_MAC_VER_28:
2895 RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80); 2900 RTL_W8(PMCH, RTL_R8(PMCH) & ~0x80);
2896 break; 2901 break;
2897 } 2902 }
@@ -2901,12 +2906,17 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
2901{ 2906{
2902 void __iomem *ioaddr = tp->mmio_addr; 2907 void __iomem *ioaddr = tp->mmio_addr;
2903 2908
2904 if (tp->mac_version == RTL_GIGA_MAC_VER_27) 2909 if (((tp->mac_version == RTL_GIGA_MAC_VER_27) ||
2910 (tp->mac_version == RTL_GIGA_MAC_VER_28)) &&
2911 (ocp_read(tp, 0x0f, 0x0010) & 0x00008000)) {
2905 return; 2912 return;
2913 }
2906 2914
2907 switch (tp->mac_version) { 2915 switch (tp->mac_version) {
2908 case RTL_GIGA_MAC_VER_25: 2916 case RTL_GIGA_MAC_VER_25:
2909 case RTL_GIGA_MAC_VER_26: 2917 case RTL_GIGA_MAC_VER_26:
2918 case RTL_GIGA_MAC_VER_27:
2919 case RTL_GIGA_MAC_VER_28:
2910 RTL_W8(PMCH, RTL_R8(PMCH) | 0x80); 2920 RTL_W8(PMCH, RTL_R8(PMCH) | 0x80);
2911 break; 2921 break;
2912 } 2922 }
@@ -3319,7 +3329,8 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
3319 /* Disable interrupts */ 3329 /* Disable interrupts */
3320 rtl8169_irq_mask_and_ack(ioaddr); 3330 rtl8169_irq_mask_and_ack(ioaddr);
3321 3331
3322 if (tp->mac_version == RTL_GIGA_MAC_VER_28) { 3332 if (tp->mac_version == RTL_GIGA_MAC_VER_27 ||
3333 tp->mac_version == RTL_GIGA_MAC_VER_28) {
3323 while (RTL_R8(TxPoll) & NPQ) 3334 while (RTL_R8(TxPoll) & NPQ)
3324 udelay(20); 3335 udelay(20);
3325 3336