diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 02339b3352e7..c23667017922 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -407,6 +407,7 @@ enum rtl_register_content { | |||
407 | RxOK = 0x0001, | 407 | RxOK = 0x0001, |
408 | 408 | ||
409 | /* RxStatusDesc */ | 409 | /* RxStatusDesc */ |
410 | RxBOVF = (1 << 24), | ||
410 | RxFOVF = (1 << 23), | 411 | RxFOVF = (1 << 23), |
411 | RxRWT = (1 << 22), | 412 | RxRWT = (1 << 22), |
412 | RxRES = (1 << 21), | 413 | RxRES = (1 << 21), |
@@ -682,6 +683,7 @@ struct rtl8169_private { | |||
682 | struct mii_if_info mii; | 683 | struct mii_if_info mii; |
683 | struct rtl8169_counters counters; | 684 | struct rtl8169_counters counters; |
684 | u32 saved_wolopts; | 685 | u32 saved_wolopts; |
686 | u32 opts1_mask; | ||
685 | 687 | ||
686 | struct rtl_fw { | 688 | struct rtl_fw { |
687 | const struct firmware *fw; | 689 | const struct firmware *fw; |
@@ -710,6 +712,7 @@ MODULE_FIRMWARE(FIRMWARE_8168D_1); | |||
710 | MODULE_FIRMWARE(FIRMWARE_8168D_2); | 712 | MODULE_FIRMWARE(FIRMWARE_8168D_2); |
711 | MODULE_FIRMWARE(FIRMWARE_8168E_1); | 713 | MODULE_FIRMWARE(FIRMWARE_8168E_1); |
712 | MODULE_FIRMWARE(FIRMWARE_8168E_2); | 714 | MODULE_FIRMWARE(FIRMWARE_8168E_2); |
715 | MODULE_FIRMWARE(FIRMWARE_8168E_3); | ||
713 | MODULE_FIRMWARE(FIRMWARE_8105E_1); | 716 | MODULE_FIRMWARE(FIRMWARE_8105E_1); |
714 | 717 | ||
715 | static int rtl8169_open(struct net_device *dev); | 718 | static int rtl8169_open(struct net_device *dev); |
@@ -3077,6 +3080,14 @@ static void rtl8169_phy_reset(struct net_device *dev, | |||
3077 | netif_err(tp, link, dev, "PHY reset failed\n"); | 3080 | netif_err(tp, link, dev, "PHY reset failed\n"); |
3078 | } | 3081 | } |
3079 | 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 | |||
3080 | 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) |
3081 | { | 3092 | { |
3082 | void __iomem *ioaddr = tp->mmio_addr; | 3093 | void __iomem *ioaddr = tp->mmio_addr; |
@@ -3109,7 +3120,7 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) | |||
3109 | ADVERTISED_1000baseT_Half | | 3120 | ADVERTISED_1000baseT_Half | |
3110 | ADVERTISED_1000baseT_Full : 0)); | 3121 | ADVERTISED_1000baseT_Full : 0)); |
3111 | 3122 | ||
3112 | if (RTL_R8(PHYstatus) & TBI_Enable) | 3123 | if (rtl_tbi_enabled(tp)) |
3113 | netif_info(tp, link, dev, "TBI auto-negotiating\n"); | 3124 | netif_info(tp, link, dev, "TBI auto-negotiating\n"); |
3114 | } | 3125 | } |
3115 | 3126 | ||
@@ -3319,9 +3330,16 @@ static void r810x_phy_power_up(struct rtl8169_private *tp) | |||
3319 | 3330 | ||
3320 | static void r810x_pll_power_down(struct rtl8169_private *tp) | 3331 | static void r810x_pll_power_down(struct rtl8169_private *tp) |
3321 | { | 3332 | { |
3333 | void __iomem *ioaddr = tp->mmio_addr; | ||
3334 | |||
3322 | if (__rtl8169_get_wol(tp) & WAKE_ANY) { | 3335 | if (__rtl8169_get_wol(tp) & WAKE_ANY) { |
3323 | rtl_writephy(tp, 0x1f, 0x0000); | 3336 | rtl_writephy(tp, 0x1f, 0x0000); |
3324 | rtl_writephy(tp, MII_BMCR, 0x0000); | 3337 | rtl_writephy(tp, MII_BMCR, 0x0000); |
3338 | |||
3339 | if (tp->mac_version == RTL_GIGA_MAC_VER_29 || | ||
3340 | tp->mac_version == RTL_GIGA_MAC_VER_30) | ||
3341 | RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | | ||
3342 | AcceptMulticast | AcceptMyPhys); | ||
3325 | return; | 3343 | return; |
3326 | } | 3344 | } |
3327 | 3345 | ||
@@ -3417,7 +3435,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) | |||
3417 | rtl_writephy(tp, MII_BMCR, 0x0000); | 3435 | rtl_writephy(tp, MII_BMCR, 0x0000); |
3418 | 3436 | ||
3419 | if (tp->mac_version == RTL_GIGA_MAC_VER_32 || | 3437 | if (tp->mac_version == RTL_GIGA_MAC_VER_32 || |
3420 | tp->mac_version == RTL_GIGA_MAC_VER_33) | 3438 | tp->mac_version == RTL_GIGA_MAC_VER_33 || |
3439 | tp->mac_version == RTL_GIGA_MAC_VER_34) | ||
3421 | RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | | 3440 | RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast | |
3422 | AcceptMulticast | AcceptMyPhys); | 3441 | AcceptMulticast | AcceptMyPhys); |
3423 | return; | 3442 | return; |
@@ -3727,8 +3746,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3727 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); | 3746 | tp->features |= rtl_try_msi(pdev, ioaddr, cfg); |
3728 | RTL_W8(Cfg9346, Cfg9346_Lock); | 3747 | RTL_W8(Cfg9346, Cfg9346_Lock); |
3729 | 3748 | ||
3730 | if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) && | 3749 | if (rtl_tbi_enabled(tp)) { |
3731 | (RTL_R8(PHYstatus) & TBI_Enable)) { | ||
3732 | tp->set_speed = rtl8169_set_speed_tbi; | 3750 | tp->set_speed = rtl8169_set_speed_tbi; |
3733 | tp->get_settings = rtl8169_gset_tbi; | 3751 | tp->get_settings = rtl8169_gset_tbi; |
3734 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; | 3752 | tp->phy_reset_enable = rtl8169_tbi_reset_enable; |
@@ -3777,6 +3795,9 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3777 | tp->intr_event = cfg->intr_event; | 3795 | tp->intr_event = cfg->intr_event; |
3778 | tp->napi_event = cfg->napi_event; | 3796 | tp->napi_event = cfg->napi_event; |
3779 | 3797 | ||
3798 | tp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ? | ||
3799 | ~(RxBOVF | RxFOVF) : ~0; | ||
3800 | |||
3780 | init_timer(&tp->timer); | 3801 | init_timer(&tp->timer); |
3781 | tp->timer.data = (unsigned long) dev; | 3802 | tp->timer.data = (unsigned long) dev; |
3782 | tp->timer.function = rtl8169_phy_timer; | 3803 | tp->timer.function = rtl8169_phy_timer; |
@@ -3988,6 +4009,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp) | |||
3988 | while (RTL_R8(TxPoll) & NPQ) | 4009 | while (RTL_R8(TxPoll) & NPQ) |
3989 | udelay(20); | 4010 | udelay(20); |
3990 | } else if (tp->mac_version == RTL_GIGA_MAC_VER_34) { | 4011 | } else if (tp->mac_version == RTL_GIGA_MAC_VER_34) { |
4012 | RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq); | ||
3991 | while (!(RTL_R32(TxConfig) & TXCFG_EMPTY)) | 4013 | while (!(RTL_R32(TxConfig) & TXCFG_EMPTY)) |
3992 | udelay(100); | 4014 | udelay(100); |
3993 | } else { | 4015 | } else { |
@@ -5314,7 +5336,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
5314 | u32 status; | 5336 | u32 status; |
5315 | 5337 | ||
5316 | rmb(); | 5338 | rmb(); |
5317 | status = le32_to_cpu(desc->opts1); | 5339 | status = le32_to_cpu(desc->opts1) & tp->opts1_mask; |
5318 | 5340 | ||
5319 | if (status & DescOwn) | 5341 | if (status & DescOwn) |
5320 | break; | 5342 | break; |