drivers/net/: Use the DMA_{64,32}BIT_MASK constants
authorDomen Puncer <domen@coderock.org>
Sun, 26 Jun 2005 22:22:14 +0000 (18:22 -0400)
committerJeff Garzik <jgarzik@pobox.com>
Sun, 26 Jun 2005 22:22:14 +0000 (18:22 -0400)
Use the DMA_{64,32}BIT_MASK constants from dma-mapping.h when calling
pci_set_dma_mask() or pci_set_consistent_dma_mask()

This patch includes dma-mapping.h explicitly because it caused errors
on some architectures otherwise.

See http://marc.theaimsgroup.com/?t=108001993000001&r=1&w=2 for details

Signed-off-by: Tobias Klauser <tklauser@nuerscht.ch>
Signed-off-by: Domen Puncer <domen@coderock.org>
drivers/net/acenic.c
drivers/net/e100.c
drivers/net/hp100.c
drivers/net/ns83820.c
drivers/net/s2io.c
drivers/net/sk98lin/skge.c
drivers/net/sungem.c
drivers/net/tlan.c
drivers/net/tokenring/lanstreamer.c
drivers/net/via-rhine.c
drivers/net/wan/wanxl.c

index 6eea3a8accb72757b43759fd10910317013d3729..dbecc6bf78519ce09088cad0e0b48d96200a8c07 100644 (file)
@@ -58,6 +58,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -1167,9 +1168,9 @@ static int __devinit ace_init(struct net_device *dev)
        /*
         * Configure DMA attributes.
         */
-       if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
+       if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
                ap->pci_using_dac = 1;
-       } else if (!pci_set_dma_mask(pdev, 0xffffffffULL)) {
+       } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                ap->pci_using_dac = 0;
        } else {
                ecode = -ENODEV;
index 4a47df5a9ff9c076ddee640a437eca7f7c9348c9..cfaa6b2bf345e7f2dbe504c1c95e18a006cb23cc 100644 (file)
 #include <linux/delay.h>
 #include <linux/init.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/mii.h>
@@ -2286,7 +2287,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
                goto err_out_disable_pdev;
        }
 
-       if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
+       if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) {
                DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
                goto err_out_free_res;
        }
index c9d1a86d95948b74a0f4ec9555f9cc2fa072ef04..cf0ac6fda1a1741390486e2168271cf3fc4ba554 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/eisa.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/spinlock.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -557,7 +558,7 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
                         * Also, we can have EISA Busmaster cards (not tested),
                         * so beware !!! - Jean II */
                        if((bus == HP100_BUS_PCI) &&
-                          (pci_set_dma_mask(pci_dev, 0xffffffff))) {
+                          (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK))) {
                                /* Gracefully fallback to shared memory */
                                goto busmasterfail;
                        }
index c336b46bd332676155f01fee160a63b590b30e9b..cc7965271778b1e87b1726c006dfc67c04d034da 100644 (file)
 #include <linux/moduleparam.h>
 #include <linux/types.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
index 9c224eba057d527d8f1764fed8fef4a64398555e..bb639a8794d455459244d1aa556ff5ecaef27122 100644 (file)
@@ -42,6 +42,7 @@
 #include <linux/errno.h>
 #include <linux/ioport.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
@@ -4593,19 +4594,19 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
                return ret;
        }
 
-       if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
+       if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
                DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 64bit DMA\n");
                dma_flag = TRUE;
 
                if (pci_set_consistent_dma_mask
-                   (pdev, 0xffffffffffffffffULL)) {
+                   (pdev, DMA_64BIT_MASK)) {
                        DBG_PRINT(ERR_DBG,
                                  "Unable to obtain 64bit DMA for \
                                        consistent allocations\n");
                        pci_disable_device(pdev);
                        return -ENOMEM;
                }
-       } else if (!pci_set_dma_mask(pdev, 0xffffffffUL)) {
+       } else if (!pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                DBG_PRINT(INIT_DBG, "s2io_init_nic: Using 32bit DMA\n");
        } else {
                pci_disable_device(pdev);
index 1ccb2989001c4a46dcf28fbacfb06f320389089d..82570ec44d8eefea84aa2b7721ac9f3eafa7bd3e 100644 (file)
 #include       <linux/moduleparam.h>
 #include       <linux/init.h>
 #include       <linux/proc_fs.h>
+#include       <linux/dma-mapping.h>
 
 #include       "h/skdrv1st.h"
 #include       "h/skdrv2nd.h"
@@ -4912,8 +4913,8 @@ static int __devinit skge_probe_one(struct pci_dev *pdev,
                goto out;
  
        /* Configure DMA attributes. */
-       if (pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL) &&
-           pci_set_dma_mask(pdev, (u64) 0xffffffff))
+       if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) &&
+           pci_set_dma_mask(pdev, DMA_32BIT_MASK))
                goto out_disable_device;
 
 
index 5cd50fd53c1251fd8ba9a68a700ca28d96fcc897..1f5655655c40185091146461789f0a08ab7c5282 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/init.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
@@ -2989,10 +2990,10 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
         */
        if (pdev->vendor == PCI_VENDOR_ID_SUN &&
            pdev->device == PCI_DEVICE_ID_SUN_GEM &&
-           !pci_set_dma_mask(pdev, (u64) 0xffffffffffffffffULL)) {
+           !pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
                pci_using_dac = 1;
        } else {
-               err = pci_set_dma_mask(pdev, (u64) 0xffffffff);
+               err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
                if (err) {
                        printk(KERN_ERR PFX "No usable DMA configuration, "
                               "aborting.\n");
index cf31c0629852732defbf52d5ae4537325d1fc7e4..942fae0f2130227794dfcd17d7ccfdeaee63d655 100644 (file)
 #include <linux/ioport.h>
 #include <linux/eisa.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/delay.h>
@@ -566,7 +567,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
 
                priv->adapter = &board_info[ent->driver_data];
 
-               rc = pci_set_dma_mask(pdev, 0xFFFFFFFF);
+               rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
                if (rc) {
                        printk(KERN_ERR "TLAN: No suitable PCI mapping available.\n");
                        goto err_out_free_dev;
index 99e0b03b69a81b318d78251f74cb18c13abea0f9..6e5ade99a38f88adf555dd5baf29c314bc87b176 100644 (file)
 #include <linux/stddef.h>
 #include <linux/init.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/spinlock.h>
 #include <linux/version.h>
 #include <linux/bitops.h>
@@ -257,7 +258,7 @@ static int __devinit streamer_init_one(struct pci_dev *pdev,
 #endif
 #endif
 
-       rc = pci_set_dma_mask(pdev, 0xFFFFFFFFULL);
+       rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
        if (rc) {
                printk(KERN_ERR "%s: No suitable PCI mapping available.\n",
                                dev->name);
index 7b57d552094a4270d653595c5de2ac75f5e05192..6200cfc4244e0ba783f24acb0eeabe3f63e4d041 100644 (file)
@@ -186,6 +186,7 @@ static const int multicast_filter_limit = 32;
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
@@ -740,7 +741,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
                goto err_out;
 
        /* this should always be supported */
-       rc = pci_set_dma_mask(pdev, 0xffffffff);
+       rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
        if (rc) {
                printk(KERN_ERR "32-bit PCI DMA addresses not supported by "
                       "the card!?\n");
index 1e7b47704ad9e15a3c64e47e7374c449bf9b7e79..9c1e10602f2b3ddbf1ae364021d27edab6323bad 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/netdevice.h>
 #include <linux/hdlc.h>
 #include <linux/pci.h>
+#include <linux/dma-mapping.h>
 #include <asm/io.h>
 #include <asm/delay.h>
 
@@ -624,8 +625,8 @@ static int __devinit wanxl_pci_init_one(struct pci_dev *pdev,
        /* FIXME when PCI/DMA subsystems are fixed.
           We set both dma_mask and consistent_dma_mask back to 32 bits
           to indicate the card can do 32-bit DMA addressing */
-       if (pci_set_consistent_dma_mask(pdev, 0xFFFFFFFF) ||
-           pci_set_dma_mask(pdev, 0xFFFFFFFF)) {
+       if (pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK) ||
+           pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
                printk(KERN_ERR "wanXL: No usable DMA configuration\n");
                wanxl_pci_remove_one(pdev);
                return -EIO;