diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2011-09-01 12:42:09 -0400 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2011-09-17 05:42:21 -0400 |
commit | 2544bfc0eb2581e0eedbdfea1468b3866223d47e (patch) | |
tree | 3578e87042060396a96f8f1cc2c873b26abba747 /drivers/net/r8169.c | |
parent | e03f33af79f0772156e1a1a1e36bdddf8012b2e4 (diff) |
r8169: do not enable the TBI for anything but the original 8169.
The TBI bit in PHYStatus is reserved on anything but the oldest 8169.
Nobody complained after I disabled it for the 8168 and the 810x (see
66ec5d4fb1ce6f0bd9df4bc4b758f0916d9f37ab).
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Hayes Wang <hayeswang@realtek.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index dff0bf094168..c23667017922 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -3080,6 +3080,14 @@ static void rtl8169_phy_reset(struct net_device *dev, | |||
3080 | netif_err(tp, link, dev, "PHY reset failed\n"); | 3080 | netif_err(tp, link, dev, "PHY reset failed\n"); |
3081 | } | 3081 | } |
3082 | 3082 | ||
3083 | static bool rtl_tbi_enabled(struct rtl8169_private *tp) | ||
3084 | { | ||
3085 | void __iomem *ioaddr = tp->mmio_addr; | ||
3086 | |||
3087 | return (tp->mac_version == RTL_GIGA_MAC_VER_01) && | ||
3088 | (RTL_R8(PHYstatus) & TBI_Enable); | ||
3089 | } | ||
3090 | |||
3083 | static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) | 3091 | static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) |
3084 | { | 3092 | { |
3085 | void __iomem *ioaddr = tp->mmio_addr; | 3093 | void __iomem *ioaddr = tp->mmio_addr; |
@@ -3112,7 +3120,7 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) | |||
3112 | ADVERTISED_1000baseT_Half | | 3120 | ADVERTISED_1000baseT_Half | |
3113 | ADVERTISED_1000baseT_Full : 0)); | 3121 | ADVERTISED_1000baseT_Full : 0)); |
3114 | 3122 | ||
3115 | if (RTL_R8(PHYstatus) & TBI_Enable) | 3123 | if (rtl_tbi_enabled(tp)) |
3116 | netif_info(tp, link, dev, "TBI auto-negotiating\n"); | 3124 | netif_info(tp, link, dev, "TBI auto-negotiating\n"); |
3117 | } | 3125 | } |
3118 | 3126 | ||
@@ -3738,8 +3746,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3738 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); | 3746 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); |
3739 | RTL_W8(Cfg9346, Cfg9346_Lock); | 3747 | RTL_W8(Cfg9346, Cfg9346_Lock); |
3740 | 3748 | ||
3741 | if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) && | 3749 | if (rtl_tbi_enabled(tp)) { |
3742 | (RTL_R8(PHYstatus) & TBI_Enable)) { | ||
3743 | tp->set_speed = rtl8169_set_speed_tbi; | 3750 | tp->set_speed = rtl8169_set_speed_tbi; |
3744 | tp->get_settings = rtl8169_gset_tbi; | 3751 | tp->get_settings = rtl8169_gset_tbi; |
3745 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; | 3752 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; |