aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHayes Wang <hayeswang@realtek.com>2011-02-22 04:26:18 -0500
committerFrancois Romieu <romieu@fr.zoreil.com>2011-03-01 11:52:41 -0500
commit716b50a31fb237c480e67ad66dc23feb35d40772 (patch)
tree9599e03d0c2cd94a9c121a17880af061726af28f
parent8da83f8e73a42fa3142843938aa1590b82acb6ec (diff)
r8169: adjust rtl8169_set_speed_xmii function.
- adjust code of rtl8169_set_speed_xmii function - remove parts of code which are done in rtl_pll_power_up function (8168 only) Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
-rw-r--r--drivers/net/r8169.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 469ab0b7ce31..de94489cf96e 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1124,6 +1124,8 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
1124 struct rtl8169_private *tp = netdev_priv(dev); 1124 struct rtl8169_private *tp = netdev_priv(dev);
1125 int giga_ctrl, bmcr; 1125 int giga_ctrl, bmcr;
1126 1126
1127 rtl_writephy(tp, 0x1f, 0x0000);
1128
1127 if (autoneg == AUTONEG_ENABLE) { 1129 if (autoneg == AUTONEG_ENABLE) {
1128 int auto_nego; 1130 int auto_nego;
1129 1131
@@ -1152,18 +1154,6 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
1152 1154
1153 bmcr = BMCR_ANENABLE | BMCR_ANRESTART; 1155 bmcr = BMCR_ANENABLE | BMCR_ANRESTART;
1154 1156
1155 if ((tp->mac_version == RTL_GIGA_MAC_VER_11) ||
1156 (tp->mac_version == RTL_GIGA_MAC_VER_12) ||
1157 (tp->mac_version >= RTL_GIGA_MAC_VER_17)) {
1158 /*
1159 * Wake up the PHY.
1160 * Vendor specific (0x1f) and reserved (0x0e) MII
1161 * registers.
1162 */
1163 rtl_writephy(tp, 0x1f, 0x0000);
1164 rtl_writephy(tp, 0x0e, 0x0000);
1165 }
1166
1167 rtl_writephy(tp, MII_ADVERTISE, auto_nego); 1157 rtl_writephy(tp, MII_ADVERTISE, auto_nego);
1168 rtl_writephy(tp, MII_CTRL1000, giga_ctrl); 1158 rtl_writephy(tp, MII_CTRL1000, giga_ctrl);
1169 } else { 1159 } else {
@@ -1178,8 +1168,6 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
1178 1168
1179 if (duplex == DUPLEX_FULL) 1169 if (duplex == DUPLEX_FULL)
1180 bmcr |= BMCR_FULLDPLX; 1170 bmcr |= BMCR_FULLDPLX;
1181
1182 rtl_writephy(tp, 0x1f, 0x0000);
1183 } 1171 }
1184 1172
1185 tp->phy_1000_ctrl_reg = giga_ctrl; 1173 tp->phy_1000_ctrl_reg = giga_ctrl;