History

Merge branch 'davem.r8169.fixes' of git://violet.fr.zoreil.com/romieu/linux

David S. Miller committed 15 years ago

Commit fe7d1892 parents eebb6fb 2544bfc1 file · +27 −5Browse files

Unified · Split

drivers/net/r8169.c+27−5
@@ -407,6 +407,7 @@ enum rtl_register_content { · 406 unmodified lines
407407 RxOK = 0x0001,
408408
409409 /* RxStatusDesc */
410+ RxBOVF = (1 << 24),
410411 RxFOVF = (1 << 23),
411412 RxRWT = (1 << 22),
412413 RxRES = (1 << 21),
@@ -682,6 +683,7 @@ struct rtl8169_private { · 269 unmodified lines
682683 struct mii_if_info mii;
683684 struct rtl8169_counters counters;
684685 u32 saved_wolopts;
686+ u32 opts1_mask;
685687
686688 struct rtl_fw {
687689 const struct firmware *fw;
@@ -710,6 +712,7 @@ MODULE_FIRMWARE(FIRMWARE_8168D_1); · 22 unmodified lines
710712 MODULE_FIRMWARE(FIRMWARE_8168D_2);
711713 MODULE_FIRMWARE(FIRMWARE_8168E_1);
712714 MODULE_FIRMWARE(FIRMWARE_8168E_2);
715+MODULE_FIRMWARE(FIRMWARE_8168E_3);
713716 MODULE_FIRMWARE(FIRMWARE_8105E_1);
714717
715718 static int rtl8169_open(struct net_device *dev);
@@ -3077,6 +3080,14 @@ static void rtl8169_phy_reset(struct net_device *dev, · 2361 unmodified lines
30773080 netif_err(tp, link, dev, "PHY reset failed\n");
30783081 }
30793082
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+
30803091 static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
30813092 {
30823093 void __iomem *ioaddr = tp->mmio_addr;
@@ -3109,7 +3120,7 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp) · 26 unmodified lines
31093120 ADVERTISED_1000baseT_Half |
31103121 ADVERTISED_1000baseT_Full : 0));
31113122
3112− if (RTL_R8(PHYstatus) & TBI_Enable)
3123+ if (rtl_tbi_enabled(tp))
31133124 netif_info(tp, link, dev, "TBI auto-negotiating\n");
31143125 }
31153126
@@ -3319,9 +3330,16 @@ static void r810x_phy_power_up(struct rtl8169_private *tp) · 203 unmodified lines
33193330
33203331 static void r810x_pll_power_down(struct rtl8169_private *tp)
33213332 {
3333+ void __iomem *ioaddr = tp->mmio_addr;
3334+
33223335 if (__rtl8169_get_wol(tp) & WAKE_ANY) {
33233336 rtl_writephy(tp, 0x1f, 0x0000);
33243337 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);
33253343 return;
33263344 }
33273345
@@ -3417,7 +3435,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp) · 89 unmodified lines
34173435 rtl_writephy(tp, MII_BMCR, 0x0000);
34183436
34193437 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)
34213440 RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
34223441 AcceptMulticast | AcceptMyPhys);
34233442 return;
@@ -3727,8 +3746,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 303 unmodified lines
37273746 tp->features |= rtl_try_msi(pdev, ioaddr, cfg);
37283747 RTL_W8(Cfg9346, Cfg9346_Lock);
37293748
3730− if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) &&
3731− (RTL_R8(PHYstatus) & TBI_Enable)) {
3749+ if (rtl_tbi_enabled(tp)) {
37323750 tp->set_speed = rtl8169_set_speed_tbi;
37333751 tp->get_settings = rtl8169_gset_tbi;
37343752 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) · 42 unmodified lines
37773795 tp->intr_event = cfg->intr_event;
37783796 tp->napi_event = cfg->napi_event;
37793797
3798+ tp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ?
3799+ ~(RxBOVF | RxFOVF) : ~0;
3800+
37803801 init_timer(&tp->timer);
37813802 tp->timer.data = (unsigned long) dev;
37823803 tp->timer.function = rtl8169_phy_timer;
@@ -3988,6 +4009,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp) · 205 unmodified lines
39884009 while (RTL_R8(TxPoll) & NPQ)
39894010 udelay(20);
39904011 } else if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
4012+ RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
39914013 while (!(RTL_R32(TxConfig) & TXCFG_EMPTY))
39924014 udelay(100);
39934015 } else {
@@ -5314,7 +5336,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev, · 1320 unmodified lines
53145336 u32 status;
53155337
53165338 rmb();
5317− status = le32_to_cpu(desc->opts1);
5339+ status = le32_to_cpu(desc->opts1) & tp->opts1_mask;
53185340
53195341 if (status & DescOwn)
53205342 break;