[NET]: Replace CHECKSUM_HW by CHECKSUM_PARTIAL/CHECKSUM_COMPLETE
[linux-drm-fsl-dcu.git] / drivers / net / 8139cp.c
index c1e1dc505138461da50c087d3497ae4db76d4fcc..a48b211c489dfe947b1683af9d0cde36e2bb0846 100644 (file)
@@ -52,7 +52,6 @@
 #define DRV_RELDATE            "Mar 22, 2004"
 
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/kernel.h>
@@ -814,7 +813,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
 
                if (mss)
                        flags |= LargeSend | ((mss & MSSMask) << MSSShift);
-               else if (skb->ip_summed == CHECKSUM_HW) {
+               else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        const struct iphdr *ip = skb->nh.iph;
                        if (ip->protocol == IPPROTO_TCP)
                                flags |= IPCS | TCPCS;
@@ -868,7 +867,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                        if (mss)
                                ctrl |= LargeSend |
                                        ((mss & MSSMask) << MSSShift);
-                       else if (skb->ip_summed == CHECKSUM_HW) {
+                       else if (skb->ip_summed == CHECKSUM_PARTIAL) {
                                if (ip->protocol == IPPROTO_TCP)
                                        ctrl |= IPCS | TCPCS;
                                else if (ip->protocol == IPPROTO_UDP)
@@ -899,7 +898,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
                txd->addr = cpu_to_le64(first_mapping);
                wmb();
 
-               if (skb->ip_summed == CHECKSUM_HW) {
+               if (skb->ip_summed == CHECKSUM_PARTIAL) {
                        if (ip->protocol == IPPROTO_TCP)
                                txd->opts1 = cpu_to_le32(first_eor | first_len |
                                                         FirstFrag | DescOwn |
@@ -1204,7 +1203,7 @@ static int cp_open (struct net_device *dev)
 
        cp_init_hw(cp);
 
-       rc = request_irq(dev->irq, cp_interrupt, SA_SHIRQ, dev->name, dev);
+       rc = request_irq(dev->irq, cp_interrupt, IRQF_SHARED, dev->name, dev);
        if (rc)
                goto err_out_hw;
 
@@ -1823,7 +1822,7 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        struct cp_private *cp;
        int rc;
        void __iomem *regs;
-       long pciaddr;
+       resource_size_t pciaddr;
        unsigned int addr_len, i, pci_using_dac;
        u8 pci_rev;
 
@@ -1837,9 +1836,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 
        if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
            pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
-               printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
-                      pci_name(pdev), pdev->vendor, pdev->device, pci_rev);
-               printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n");
+               dev_err(&pdev->dev,
+                          "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
+                          pdev->vendor, pdev->device, pci_rev);
+               dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n");
                return -ENODEV;
        }
 
@@ -1877,14 +1877,13 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        pciaddr = pci_resource_start(pdev, 1);
        if (!pciaddr) {
                rc = -EIO;
-               printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n",
-                      pci_name(pdev));
+               dev_err(&pdev->dev, "no MMIO resource\n");
                goto err_out_res;
        }
        if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
                rc = -EIO;
-               printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n",
-                      (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev));
+               dev_err(&pdev->dev, "MMIO resource (%llx) too small\n",
+                      (unsigned long long)pci_resource_len(pdev, 1));
                goto err_out_res;
        }
 
@@ -1898,14 +1897,15 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
 
                rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
                if (rc) {
-                       printk(KERN_ERR PFX "No usable DMA configuration, "
-                              "aborting.\n");
+                       dev_err(&pdev->dev,
+                                  "No usable DMA configuration, aborting.\n");
                        goto err_out_res;
                }
                rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
                if (rc) {
-                       printk(KERN_ERR PFX "No usable consistent DMA configuration, "
-                              "aborting.\n");
+                       dev_err(&pdev->dev,
+                                  "No usable consistent DMA configuration, "
+                                  "aborting.\n");
                        goto err_out_res;
                }
        }
@@ -1916,9 +1916,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        regs = ioremap(pciaddr, CP_REGS_SIZE);
        if (!regs) {
                rc = -EIO;
-               printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%llx) on pci dev %s\n",
-                       (unsigned long long)pci_resource_len(pdev, 1),
-                       (unsigned long long)pciaddr, pci_name(pdev));
+               dev_err(&pdev->dev, "Cannot map PCI MMIO (%Lx@%Lx)\n",
+                      (unsigned long long)pci_resource_len(pdev, 1),
+                      (unsigned long long)pciaddr);
                goto err_out_res;
        }
        dev->base_addr = (unsigned long) regs;
@@ -1987,7 +1987,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        /* enable busmastering and memory-write-invalidate */
        pci_set_master(pdev);
 
-       if (cp->wol_enabled) cp_set_d3_state (cp);
+       if (cp->wol_enabled)
+               cp_set_d3_state (cp);
 
        return 0;
 
@@ -2012,7 +2013,8 @@ static void cp_remove_one (struct pci_dev *pdev)
        BUG_ON(!dev);
        unregister_netdev(dev);
        iounmap(cp->regs);
-       if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0);
+       if (cp->wol_enabled)
+               pci_set_power_state (pdev, PCI_D0);
        pci_release_regions(pdev);
        pci_clear_mwi(pdev);
        pci_disable_device(pdev);