aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorFrancois Romieu <romieu@fr.zoreil.com>2008-06-29 05:54:28 -0400
committerFrancois Romieu <romieu@fr.zoreil.com>2008-10-10 17:08:50 -0400
commit6fb07058d2b6c748c308e4ee453035433d34ca93 (patch)
tree8401625f99e6f8b75f199fb300c80faed6c7ea20 /drivers/net/r8169.c
parent197ff761dbf9fa5de9a4684a51ee5cb534cbb852 (diff)
r8169: add a new 8168c flavor (bis)
Taken from Realtek's 8.006.00 r8168 driver. I have left some bits related to jumbo frame aside for now. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Cc: Edward Hsu <edward_hsu@realtek.com.tw>
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 9681aca75afe..9a0d4e631afe 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -110,7 +110,8 @@ enum mac_version {
110 RTL_GIGA_MAC_VER_18 = 0x12, // 8168CP 110 RTL_GIGA_MAC_VER_18 = 0x12, // 8168CP
111 RTL_GIGA_MAC_VER_19 = 0x13, // 8168C 111 RTL_GIGA_MAC_VER_19 = 0x13, // 8168C
112 RTL_GIGA_MAC_VER_20 = 0x14, // 8168C 112 RTL_GIGA_MAC_VER_20 = 0x14, // 8168C
113 RTL_GIGA_MAC_VER_21 = 0x15 // 8168C 113 RTL_GIGA_MAC_VER_21 = 0x15, // 8168C
114 RTL_GIGA_MAC_VER_22 = 0x16 // 8168C
114}; 115};
115 116
116#define _R(NAME,MAC,MASK) \ 117#define _R(NAME,MAC,MASK) \
@@ -141,7 +142,8 @@ static const struct {
141 _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_18, 0xff7e1880), // PCI-E 142 _R("RTL8168cp/8111cp", RTL_GIGA_MAC_VER_18, 0xff7e1880), // PCI-E
142 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_19, 0xff7e1880), // PCI-E 143 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_19, 0xff7e1880), // PCI-E
143 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880), // PCI-E 144 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_20, 0xff7e1880), // PCI-E
144 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880) // PCI-E 145 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_21, 0xff7e1880), // PCI-E
146 _R("RTL8168c/8111c", RTL_GIGA_MAC_VER_22, 0xff7e1880) // PCI-E
145}; 147};
146#undef _R 148#undef _R
147 149
@@ -1223,6 +1225,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
1223 { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 }, 1225 { 0x7cf00000, 0x3c000000, RTL_GIGA_MAC_VER_19 },
1224 { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 }, 1226 { 0x7cf00000, 0x3c200000, RTL_GIGA_MAC_VER_20 },
1225 { 0x7cf00000, 0x3c300000, RTL_GIGA_MAC_VER_21 }, 1227 { 0x7cf00000, 0x3c300000, RTL_GIGA_MAC_VER_21 },
1228 { 0x7cf00000, 0x3c400000, RTL_GIGA_MAC_VER_22 },
1226 { 0x7c800000, 0x3c000000, RTL_GIGA_MAC_VER_20 }, 1229 { 0x7c800000, 0x3c000000, RTL_GIGA_MAC_VER_20 },
1227 1230
1228 /* 8168B family. */ 1231 /* 8168B family. */
@@ -1469,6 +1472,11 @@ static void rtl8168c_3_hw_phy_config(void __iomem *ioaddr)
1469 mdio_write(ioaddr, 0x1f, 0x0000); 1472 mdio_write(ioaddr, 0x1f, 0x0000);
1470} 1473}
1471 1474
1475static void rtl8168c_4_hw_phy_config(void __iomem *ioaddr)
1476{
1477 rtl8168c_3_hw_phy_config(ioaddr);
1478}
1479
1472static void rtl8102e_hw_phy_config(void __iomem *ioaddr) 1480static void rtl8102e_hw_phy_config(void __iomem *ioaddr)
1473{ 1481{
1474 struct phy_reg phy_reg_init[] = { 1482 struct phy_reg phy_reg_init[] = {
@@ -1528,6 +1536,9 @@ static void rtl_hw_phy_config(struct net_device *dev)
1528 case RTL_GIGA_MAC_VER_21: 1536 case RTL_GIGA_MAC_VER_21:
1529 rtl8168c_3_hw_phy_config(ioaddr); 1537 rtl8168c_3_hw_phy_config(ioaddr);
1530 break; 1538 break;
1539 case RTL_GIGA_MAC_VER_22:
1540 rtl8168c_4_hw_phy_config(ioaddr);
1541 break;
1531 default: 1542 default:
1532 break; 1543 break;
1533 } 1544 }
@@ -2523,6 +2534,13 @@ static void rtl_hw_start_8168c_3(void __iomem *ioaddr, struct pci_dev *pdev)
2523 rtl_hw_start_8168c_2(ioaddr, pdev); 2534 rtl_hw_start_8168c_2(ioaddr, pdev);
2524} 2535}
2525 2536
2537static void rtl_hw_start_8168c_4(void __iomem *ioaddr, struct pci_dev *pdev)
2538{
2539 rtl_csi_access_enable(ioaddr);
2540
2541 __rtl_hw_start_8168cp(ioaddr, pdev);
2542}
2543
2526static void rtl_hw_start_8168(struct net_device *dev) 2544static void rtl_hw_start_8168(struct net_device *dev)
2527{ 2545{
2528 struct rtl8169_private *tp = netdev_priv(dev); 2546 struct rtl8169_private *tp = netdev_priv(dev);
@@ -2582,6 +2600,10 @@ static void rtl_hw_start_8168(struct net_device *dev)
2582 rtl_hw_start_8168c_3(ioaddr, pdev); 2600 rtl_hw_start_8168c_3(ioaddr, pdev);
2583 break; 2601 break;
2584 2602
2603 case RTL_GIGA_MAC_VER_22:
2604 rtl_hw_start_8168c_4(ioaddr, pdev);
2605 break;
2606
2585 default: 2607 default:
2586 printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n", 2608 printk(KERN_ERR PFX "%s: unknown chipset (mac_version = %d).\n",
2587 dev->name, tp->mac_version); 2609 dev->name, tp->mac_version);