diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 18 |
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 | ||
1608 | static void rtl8169_get_mac_version(struct rtl8169_private *tp, | 1608 | static 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 | ||
1699 | static void rtl8169_print_mac_version(struct rtl8169_private *tp) | 1706 | static 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; |