From 1e7f0bd8c8f2d0496ad338be5e69ff4395d77da4 Mon Sep 17 00:00:00 2001 From: Domen Puncer Date: Sun, 26 Jun 2005 18:22:14 -0400 Subject: [PATCH] drivers/net/: Use the DMA_{64,32}BIT_MASK constants 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 Signed-off-by: Domen Puncer --- drivers/net/acenic.c | 5 +++-- drivers/net/e100.c | 3 ++- drivers/net/hp100.c | 3 ++- drivers/net/ns83820.c | 1 + drivers/net/s2io.c | 7 ++++--- drivers/net/sk98lin/skge.c | 5 +++-- drivers/net/sungem.c | 5 +++-- drivers/net/tlan.c | 3 ++- drivers/net/tokenring/lanstreamer.c | 3 ++- drivers/net/via-rhine.c | 3 ++- drivers/net/wan/wanxl.c | 5 +++-- 11 files changed, 27 insertions(+), 16 deletions(-) diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c index 6eea3a8acc..dbecc6bf78 100644 --- a/drivers/net/acenic.c +++ b/drivers/net/acenic.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -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; diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 4a47df5a9f..cfaa6b2bf3 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c @@ -143,6 +143,7 @@ #include #include #include +#include #include #include #include @@ -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; } diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c index c9d1a86d95..cf0ac6fda1 100644 --- a/drivers/net/hp100.c +++ b/drivers/net/hp100.c @@ -106,6 +106,7 @@ #include #include #include +#include #include #include #include @@ -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; } diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index c336b46bd3..cc79652717 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c @@ -101,6 +101,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 9c224eba05..bb639a8794 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -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); diff --git a/drivers/net/sk98lin/skge.c b/drivers/net/sk98lin/skge.c index 1ccb298900..82570ec44d 100644 --- a/drivers/net/sk98lin/skge.c +++ b/drivers/net/sk98lin/skge.c @@ -112,6 +112,7 @@ #include #include #include +#include #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; diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index 5cd50fd53c..1f5655655c 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -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"); diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index cf31c06298..942fae0f21 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c @@ -171,6 +171,7 @@ #include #include #include +#include #include #include #include @@ -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; diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c index 99e0b03b69..6e5ade99a3 100644 --- a/drivers/net/tokenring/lanstreamer.c +++ b/drivers/net/tokenring/lanstreamer.c @@ -118,6 +118,7 @@ #include #include #include +#include #include #include #include @@ -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); diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index 7b57d55209..6200cfc424 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c @@ -186,6 +186,7 @@ static const int multicast_filter_limit = 32; #include #include #include +#include #include #include #include @@ -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"); diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 1e7b47704a..9c1e10602f 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -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; -- 2.39.5