]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/r8169.c
r8169: add PCI ID for the 8168 in the Abit Fatal1ty F-190HD motherboard
[linux-2.6-omap-h63xx.git] / drivers / net / r8169.c
index 3680ee7ccb0dd8157dcab8c9608878d1b7844748..702334e6b28adfcc2d432cd85cd687f045ce1c37 100644 (file)
@@ -171,6 +171,8 @@ static struct pci_device_id rtl8169_pci_tbl[] = {
        { PCI_DEVICE(0x16ec,                    0x0116), 0, 0, RTL_CFG_0 },
        { PCI_VENDOR_ID_LINKSYS,                0x1032,
                PCI_ANY_ID, 0x0024, 0, 0, RTL_CFG_0 },
+       { 0x0001,                               0x8168,
+               PCI_ANY_ID, 0x2410, 0, 0, RTL_CFG_2 },
        {0,},
 };
 
@@ -392,7 +394,9 @@ struct rtl8169_private {
        void __iomem *mmio_addr;        /* memory map physical address */
        struct pci_dev *pci_dev;        /* Index of PCI device */
        struct net_device *dev;
+#ifdef CONFIG_R8169_NAPI
        struct napi_struct napi;
+#endif
        spinlock_t lock;                /* spin lock flag */
        u32 msg_enable;
        int chipset;
@@ -1243,6 +1247,16 @@ static void rtl8169sb_hw_phy_config(void __iomem *ioaddr)
 
        rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
+static void rtl8168b_hw_phy_config(void __iomem *ioaddr)
+{
+       struct phy_reg phy_reg_init[] = {
+               { 0x1f, 0x0000 },
+               { 0x10, 0xf41b },
+               { 0x1f, 0x0000 }
+       };
+
+       rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+}
 
 static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
 {
@@ -1260,6 +1274,8 @@ static void rtl8168cp_hw_phy_config(void __iomem *ioaddr)
 static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
 {
        struct phy_reg phy_reg_init[] = {
+               { 0x1f, 0x0001 },
+               { 0x12, 0x2300 },
                { 0x1f, 0x0002 },
                { 0x00, 0x88d4 },
                { 0x01, 0x82b1 },
@@ -1277,6 +1293,22 @@ static void rtl8168c_hw_phy_config(void __iomem *ioaddr)
        rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
+static void rtl8168cx_hw_phy_config(void __iomem *ioaddr)
+{
+       struct phy_reg phy_reg_init[] = {
+               { 0x1f, 0x0000 },
+               { 0x12, 0x2300 },
+               { 0x1f, 0x0003 },
+               { 0x16, 0x0f0a },
+               { 0x1f, 0x0000 },
+               { 0x1f, 0x0002 },
+               { 0x0c, 0x7eb8 },
+               { 0x1f, 0x0000 }
+       };
+
+       rtl_phy_write(ioaddr, phy_reg_init, ARRAY_SIZE(phy_reg_init));
+}
+
 static void rtl_hw_phy_config(struct net_device *dev)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
@@ -1294,12 +1326,20 @@ static void rtl_hw_phy_config(struct net_device *dev)
        case RTL_GIGA_MAC_VER_04:
                rtl8169sb_hw_phy_config(ioaddr);
                break;
+       case RTL_GIGA_MAC_VER_11:
+       case RTL_GIGA_MAC_VER_12:
+       case RTL_GIGA_MAC_VER_17:
+               rtl8168b_hw_phy_config(ioaddr);
+               break;
        case RTL_GIGA_MAC_VER_18:
                rtl8168cp_hw_phy_config(ioaddr);
                break;
        case RTL_GIGA_MAC_VER_19:
                rtl8168c_hw_phy_config(ioaddr);
                break;
+       case RTL_GIGA_MAC_VER_20:
+               rtl8168cx_hw_phy_config(ioaddr);
+               break;
        default:
                break;
        }
@@ -2953,13 +2993,16 @@ static void rtl8169_down(struct net_device *dev)
 {
        struct rtl8169_private *tp = netdev_priv(dev);
        void __iomem *ioaddr = tp->mmio_addr;
-       unsigned int poll_locked = 0;
        unsigned int intrmask;
 
        rtl8169_delete_timer(dev);
 
        netif_stop_queue(dev);
 
+#ifdef CONFIG_R8169_NAPI
+       napi_disable(&tp->napi);
+#endif
+
 core_down:
        spin_lock_irq(&tp->lock);
 
@@ -2973,11 +3016,6 @@ core_down:
 
        synchronize_irq(dev->irq);
 
-       if (!poll_locked) {
-               napi_disable(&tp->napi);
-               poll_locked++;
-       }
-
        /* Give a racing hard_start_xmit a few cycles to complete. */
        synchronize_sched();  /* FIXME: should this be synchronize_irq()? */