diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2012-04-17 05:10:11 -0400 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2012-04-17 05:21:19 -0400 |
commit | 851e60221926a53344b4227879858bef841b0477 (patch) | |
tree | 9f698f64b474b2c854a37a79245709c8cb88483e /drivers/net/ethernet/realtek | |
parent | ecffe75f934b4e3c5301fe5db278068e0efb0d6b (diff) |
r8169: Config1 is read-only on 8168c and later.
Suggested by Hayes.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Diffstat (limited to 'drivers/net/ethernet/realtek')
-rw-r--r-- | drivers/net/ethernet/realtek/r8169.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 71393ea8ef51..9b0b00bbe300 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -1396,7 +1396,6 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) | |||
1396 | u16 reg; | 1396 | u16 reg; |
1397 | u8 mask; | 1397 | u8 mask; |
1398 | } cfg[] = { | 1398 | } cfg[] = { |
1399 | { WAKE_ANY, Config1, PMEnable }, | ||
1400 | { WAKE_PHY, Config3, LinkUp }, | 1399 | { WAKE_PHY, Config3, LinkUp }, |
1401 | { WAKE_MAGIC, Config3, MagicPacket }, | 1400 | { WAKE_MAGIC, Config3, MagicPacket }, |
1402 | { WAKE_UCAST, Config5, UWF }, | 1401 | { WAKE_UCAST, Config5, UWF }, |
@@ -1404,16 +1403,28 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts) | |||
1404 | { WAKE_MCAST, Config5, MWF }, | 1403 | { WAKE_MCAST, Config5, MWF }, |
1405 | { WAKE_ANY, Config5, LanWake } | 1404 | { WAKE_ANY, Config5, LanWake } |
1406 | }; | 1405 | }; |
1406 | u8 options; | ||
1407 | 1407 | ||
1408 | RTL_W8(Cfg9346, Cfg9346_Unlock); | 1408 | RTL_W8(Cfg9346, Cfg9346_Unlock); |
1409 | 1409 | ||
1410 | for (i = 0; i < ARRAY_SIZE(cfg); i++) { | 1410 | for (i = 0; i < ARRAY_SIZE(cfg); i++) { |
1411 | u8 options = RTL_R8(cfg[i].reg) & ~cfg[i].mask; | 1411 | options = RTL_R8(cfg[i].reg) & ~cfg[i].mask; |
1412 | if (wolopts & cfg[i].opt) | 1412 | if (wolopts & cfg[i].opt) |
1413 | options |= cfg[i].mask; | 1413 | options |= cfg[i].mask; |
1414 | RTL_W8(cfg[i].reg, options); | 1414 | RTL_W8(cfg[i].reg, options); |
1415 | } | 1415 | } |
1416 | 1416 | ||
1417 | switch (tp->mac_version) { | ||
1418 | case RTL_GIGA_MAC_VER_01 ... RTL_GIGA_MAC_VER_17: | ||
1419 | options = RTL_R8(Config1) & ~PMEnable; | ||
1420 | if (wolopts) | ||
1421 | options |= PMEnable; | ||
1422 | RTL_W8(Config1, options); | ||
1423 | break; | ||
1424 | default: | ||
1425 | break; | ||
1426 | } | ||
1427 | |||
1417 | RTL_W8(Cfg9346, Cfg9346_Lock); | 1428 | RTL_W8(Cfg9346, Cfg9346_Lock); |
1418 | } | 1429 | } |
1419 | 1430 | ||