aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2011-05-08 11:47:36 -0400
committerFrancois romieu <romieu@fr.zoreil.com>2011-05-09 15:03:12 -0400
commit5d320a205de277774962782a4b1923e4f8cdf781 (patch)
treee7d970b1bd5867ea845f4ff621886edb17eaaf53 /drivers/net/r8169.c
parent85bffe6ca2e2d7e9510c115aa4f11c3d4209051f (diff)
r8169: avoid late chip identifier initialisation.
Unknown 8168 chips did not have any PLL power method set as they did not inherit a default family soon enough. Fix it. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 4f1d45bd3303..04f4e6086cd0 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1606,8 +1606,9 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
1606}; 1606};
1607 1607
1608static void rtl8169_get_mac_version(struct rtl8169_private *tp, 1608static void rtl8169_get_mac_version(struct rtl8169_private *tp,
1609 void __iomem *ioaddr) 1609 struct net_device *dev, u8 default_version)
1610{ 1610{
1611 void __iomem *ioaddr = tp->mmio_addr;
1611 /* 1612 /*
1612 * The driver currently handles the 8168Bf and the 8168Be identically 1613 * The driver currently handles the 8168Bf and the 8168Be identically
1613 * but they can be identified more specifically through the test below 1614 * but they can be identified more specifically through the test below
@@ -1694,6 +1695,12 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
1694 while ((reg & p->mask) != p->val) 1695 while ((reg & p->mask) != p->val)
1695 p++; 1696 p++;
1696 tp->mac_version = p->mac_version; 1697 tp->mac_version = p->mac_version;
1698
1699 if (tp->mac_version == RTL_GIGA_MAC_NONE) {
1700 netif_notice(tp, probe, dev,
1701 "unknown MAC, using family default\n");
1702 tp->mac_version = default_version;
1703 }
1697} 1704}
1698 1705
1699static void rtl8169_print_mac_version(struct rtl8169_private *tp) 1706static void rtl8169_print_mac_version(struct rtl8169_private *tp)
@@ -3353,7 +3360,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3353 pci_set_master(pdev); 3360 pci_set_master(pdev);
3354 3361
3355 /* Identify chip attached to board */ 3362 /* Identify chip attached to board */
3356 rtl8169_get_mac_version(tp, ioaddr); 3363 rtl8169_get_mac_version(tp, dev, cfg->default_ver);
3357 3364
3358 /* 3365 /*
3359 * Pretend we are using VLANs; This bypasses a nasty bug where 3366 * Pretend we are using VLANs; This bypasses a nasty bug where
@@ -3365,13 +3372,6 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3365 rtl_init_mdio_ops(tp); 3372 rtl_init_mdio_ops(tp);
3366 rtl_init_pll_power_ops(tp); 3373 rtl_init_pll_power_ops(tp);
3367 3374
3368 /* Use appropriate default if unknown */
3369 if (tp->mac_version == RTL_GIGA_MAC_NONE) {
3370 netif_notice(tp, probe, dev,
3371 "unknown MAC, using family default\n");
3372 tp->mac_version = cfg->default_ver;
3373 }
3374
3375 rtl8169_print_mac_version(tp); 3375 rtl8169_print_mac_version(tp);
3376 3376
3377 chipset = tp->mac_version; 3377 chipset = tp->mac_version;