aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm
diff options
context:
space:
mode:
authorchas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>2015-01-16 08:57:21 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-18 00:28:41 -0500
commitede58ef28e105de94475b2b69fa069c9a2ce6933 (patch)
treef7a4a505d2aa25808605b6ff74c2aa7e058ffd39 /drivers/atm
parentabee1cef7343197dd54e40df790ebbc8bd845d29 (diff)
atm: remove deprecated use of pci api
Signed-off-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/eni.c33
-rw-r--r--drivers/atm/fore200e.c22
-rw-r--r--drivers/atm/he.c125
-rw-r--r--drivers/atm/he.h4
-rw-r--r--drivers/atm/idt77252.c107
-rw-r--r--drivers/atm/iphase.c54
-rw-r--r--drivers/atm/lanai.c14
-rw-r--r--drivers/atm/nicstar.c60
-rw-r--r--drivers/atm/solos-pci.c26
-rw-r--r--drivers/atm/zatm.c17
10 files changed, 243 insertions, 219 deletions
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c
index c7fab3ee14ee..6339efd32697 100644
--- a/drivers/atm/eni.c
+++ b/drivers/atm/eni.c
@@ -354,9 +354,9 @@ static int do_rx_dma(struct atm_vcc *vcc,struct sk_buff *skb,
354 eni_vcc = ENI_VCC(vcc); 354 eni_vcc = ENI_VCC(vcc);
355 paddr = 0; /* GCC, shut up */ 355 paddr = 0; /* GCC, shut up */
356 if (skb) { 356 if (skb) {
357 paddr = pci_map_single(eni_dev->pci_dev,skb->data,skb->len, 357 paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
358 PCI_DMA_FROMDEVICE); 358 DMA_FROM_DEVICE);
359 if (pci_dma_mapping_error(eni_dev->pci_dev, paddr)) 359 if (dma_mapping_error(&eni_dev->pci_dev->dev, paddr))
360 goto dma_map_error; 360 goto dma_map_error;
361 ENI_PRV_PADDR(skb) = paddr; 361 ENI_PRV_PADDR(skb) = paddr;
362 if (paddr & 3) 362 if (paddr & 3)
@@ -481,8 +481,8 @@ rx_enqueued++;
481 481
482trouble: 482trouble:
483 if (paddr) 483 if (paddr)
484 pci_unmap_single(eni_dev->pci_dev,paddr,skb->len, 484 dma_unmap_single(&eni_dev->pci_dev->dev,paddr,skb->len,
485 PCI_DMA_FROMDEVICE); 485 DMA_FROM_DEVICE);
486dma_map_error: 486dma_map_error:
487 if (skb) dev_kfree_skb_irq(skb); 487 if (skb) dev_kfree_skb_irq(skb);
488 return -1; 488 return -1;
@@ -758,8 +758,8 @@ rx_dequeued++;
758 } 758 }
759 eni_vcc->rxing--; 759 eni_vcc->rxing--;
760 eni_vcc->rx_pos = ENI_PRV_POS(skb) & (eni_vcc->words-1); 760 eni_vcc->rx_pos = ENI_PRV_POS(skb) & (eni_vcc->words-1);
761 pci_unmap_single(eni_dev->pci_dev,ENI_PRV_PADDR(skb),skb->len, 761 dma_unmap_single(&eni_dev->pci_dev->dev,ENI_PRV_PADDR(skb),skb->len,
762 PCI_DMA_TODEVICE); 762 DMA_TO_DEVICE);
763 if (!skb->len) dev_kfree_skb_irq(skb); 763 if (!skb->len) dev_kfree_skb_irq(skb);
764 else { 764 else {
765 EVENT("pushing (len=%ld)\n",skb->len,0); 765 EVENT("pushing (len=%ld)\n",skb->len,0);
@@ -1112,8 +1112,8 @@ DPRINTK("iovcnt = %d\n",skb_shinfo(skb)->nr_frags);
1112 vcc->dev->number); 1112 vcc->dev->number);
1113 return enq_jam; 1113 return enq_jam;
1114 } 1114 }
1115 paddr = pci_map_single(eni_dev->pci_dev,skb->data,skb->len, 1115 paddr = dma_map_single(&eni_dev->pci_dev->dev,skb->data,skb->len,
1116 PCI_DMA_TODEVICE); 1116 DMA_TO_DEVICE);
1117 ENI_PRV_PADDR(skb) = paddr; 1117 ENI_PRV_PADDR(skb) = paddr;
1118 /* prepare DMA queue entries */ 1118 /* prepare DMA queue entries */
1119 j = 0; 1119 j = 0;
@@ -1226,8 +1226,8 @@ static void dequeue_tx(struct atm_dev *dev)
1226 break; 1226 break;
1227 } 1227 }
1228 ENI_VCC(vcc)->txing -= ENI_PRV_SIZE(skb); 1228 ENI_VCC(vcc)->txing -= ENI_PRV_SIZE(skb);
1229 pci_unmap_single(eni_dev->pci_dev,ENI_PRV_PADDR(skb),skb->len, 1229 dma_unmap_single(&eni_dev->pci_dev->dev,ENI_PRV_PADDR(skb),skb->len,
1230 PCI_DMA_TODEVICE); 1230 DMA_TO_DEVICE);
1231 if (vcc->pop) vcc->pop(vcc,skb); 1231 if (vcc->pop) vcc->pop(vcc,skb);
1232 else dev_kfree_skb_irq(skb); 1232 else dev_kfree_skb_irq(skb);
1233 atomic_inc(&vcc->stats->tx); 1233 atomic_inc(&vcc->stats->tx);
@@ -2240,13 +2240,18 @@ static int eni_init_one(struct pci_dev *pci_dev,
2240 if (rc < 0) 2240 if (rc < 0)
2241 goto out; 2241 goto out;
2242 2242
2243 rc = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
2244 if (rc < 0)
2245 goto out;
2246
2243 rc = -ENOMEM; 2247 rc = -ENOMEM;
2244 eni_dev = kmalloc(sizeof(struct eni_dev), GFP_KERNEL); 2248 eni_dev = kmalloc(sizeof(struct eni_dev), GFP_KERNEL);
2245 if (!eni_dev) 2249 if (!eni_dev)
2246 goto err_disable; 2250 goto err_disable;
2247 2251
2248 zero = &eni_dev->zero; 2252 zero = &eni_dev->zero;
2249 zero->addr = pci_alloc_consistent(pci_dev, ENI_ZEROES_SIZE, &zero->dma); 2253 zero->addr = dma_alloc_coherent(&pci_dev->dev,
2254 ENI_ZEROES_SIZE, &zero->dma, GFP_KERNEL);
2250 if (!zero->addr) 2255 if (!zero->addr)
2251 goto err_kfree; 2256 goto err_kfree;
2252 2257
@@ -2277,7 +2282,7 @@ err_eni_release:
2277err_unregister: 2282err_unregister:
2278 atm_dev_deregister(dev); 2283 atm_dev_deregister(dev);
2279err_free_consistent: 2284err_free_consistent:
2280 pci_free_consistent(pci_dev, ENI_ZEROES_SIZE, zero->addr, zero->dma); 2285 dma_free_coherent(&pci_dev->dev, ENI_ZEROES_SIZE, zero->addr, zero->dma);
2281err_kfree: 2286err_kfree:
2282 kfree(eni_dev); 2287 kfree(eni_dev);
2283err_disable: 2288err_disable:
@@ -2302,7 +2307,7 @@ static void eni_remove_one(struct pci_dev *pdev)
2302 2307
2303 eni_do_release(dev); 2308 eni_do_release(dev);
2304 atm_dev_deregister(dev); 2309 atm_dev_deregister(dev);
2305 pci_free_consistent(pdev, ENI_ZEROES_SIZE, zero->addr, zero->dma); 2310 dma_free_coherent(&pdev->dev, ENI_ZEROES_SIZE, zero->addr, zero->dma);
2306 kfree(ed); 2311 kfree(ed);
2307 pci_disable_device(pdev); 2312 pci_disable_device(pdev);
2308} 2313}
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c
index d5d9eafbbfcf..75dde903b238 100644
--- a/drivers/atm/fore200e.c
+++ b/drivers/atm/fore200e.c
@@ -425,7 +425,7 @@ static void fore200e_pca_write(u32 val, volatile u32 __iomem *addr)
425static u32 425static u32
426fore200e_pca_dma_map(struct fore200e* fore200e, void* virt_addr, int size, int direction) 426fore200e_pca_dma_map(struct fore200e* fore200e, void* virt_addr, int size, int direction)
427{ 427{
428 u32 dma_addr = pci_map_single((struct pci_dev*)fore200e->bus_dev, virt_addr, size, direction); 428 u32 dma_addr = dma_map_single(&((struct pci_dev *) fore200e->bus_dev)->dev, virt_addr, size, direction);
429 429
430 DPRINTK(3, "PCI DVMA mapping: virt_addr = 0x%p, size = %d, direction = %d, --> dma_addr = 0x%08x\n", 430 DPRINTK(3, "PCI DVMA mapping: virt_addr = 0x%p, size = %d, direction = %d, --> dma_addr = 0x%08x\n",
431 virt_addr, size, direction, dma_addr); 431 virt_addr, size, direction, dma_addr);
@@ -440,7 +440,7 @@ fore200e_pca_dma_unmap(struct fore200e* fore200e, u32 dma_addr, int size, int di
440 DPRINTK(3, "PCI DVMA unmapping: dma_addr = 0x%08x, size = %d, direction = %d\n", 440 DPRINTK(3, "PCI DVMA unmapping: dma_addr = 0x%08x, size = %d, direction = %d\n",
441 dma_addr, size, direction); 441 dma_addr, size, direction);
442 442
443 pci_unmap_single((struct pci_dev*)fore200e->bus_dev, dma_addr, size, direction); 443 dma_unmap_single(&((struct pci_dev *) fore200e->bus_dev)->dev, dma_addr, size, direction);
444} 444}
445 445
446 446
@@ -449,7 +449,7 @@ fore200e_pca_dma_sync_for_cpu(struct fore200e* fore200e, u32 dma_addr, int size,
449{ 449{
450 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction); 450 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction);
451 451
452 pci_dma_sync_single_for_cpu((struct pci_dev*)fore200e->bus_dev, dma_addr, size, direction); 452 dma_sync_single_for_cpu(&((struct pci_dev *) fore200e->bus_dev)->dev, dma_addr, size, direction);
453} 453}
454 454
455static void 455static void
@@ -457,7 +457,7 @@ fore200e_pca_dma_sync_for_device(struct fore200e* fore200e, u32 dma_addr, int si
457{ 457{
458 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction); 458 DPRINTK(3, "PCI DVMA sync: dma_addr = 0x%08x, size = %d, direction = %d\n", dma_addr, size, direction);
459 459
460 pci_dma_sync_single_for_device((struct pci_dev*)fore200e->bus_dev, dma_addr, size, direction); 460 dma_sync_single_for_device(&((struct pci_dev *) fore200e->bus_dev)->dev, dma_addr, size, direction);
461} 461}
462 462
463 463
@@ -470,9 +470,10 @@ fore200e_pca_dma_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk,
470{ 470{
471 /* returned chunks are page-aligned */ 471 /* returned chunks are page-aligned */
472 chunk->alloc_size = size * nbr; 472 chunk->alloc_size = size * nbr;
473 chunk->alloc_addr = pci_alloc_consistent((struct pci_dev*)fore200e->bus_dev, 473 chunk->alloc_addr = dma_alloc_coherent(&((struct pci_dev *) fore200e->bus_dev)->dev,
474 chunk->alloc_size, 474 chunk->alloc_size,
475 &chunk->dma_addr); 475 &chunk->dma_addr,
476 GFP_KERNEL);
476 477
477 if ((chunk->alloc_addr == NULL) || (chunk->dma_addr == 0)) 478 if ((chunk->alloc_addr == NULL) || (chunk->dma_addr == 0))
478 return -ENOMEM; 479 return -ENOMEM;
@@ -488,7 +489,7 @@ fore200e_pca_dma_chunk_alloc(struct fore200e* fore200e, struct chunk* chunk,
488static void 489static void
489fore200e_pca_dma_chunk_free(struct fore200e* fore200e, struct chunk* chunk) 490fore200e_pca_dma_chunk_free(struct fore200e* fore200e, struct chunk* chunk)
490{ 491{
491 pci_free_consistent((struct pci_dev*)fore200e->bus_dev, 492 dma_free_coherent(&((struct pci_dev *) fore200e->bus_dev)->dev,
492 chunk->alloc_size, 493 chunk->alloc_size,
493 chunk->alloc_addr, 494 chunk->alloc_addr,
494 chunk->dma_addr); 495 chunk->dma_addr);
@@ -2707,6 +2708,11 @@ static int fore200e_pca_detect(struct pci_dev *pci_dev,
2707 err = -EINVAL; 2708 err = -EINVAL;
2708 goto out; 2709 goto out;
2709 } 2710 }
2711
2712 if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32))) {
2713 err = -EINVAL;
2714 goto out;
2715 }
2710 2716
2711 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL); 2717 fore200e = kzalloc(sizeof(struct fore200e), GFP_KERNEL);
2712 if (fore200e == NULL) { 2718 if (fore200e == NULL) {
diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index c39702bc279d..93dca2e73bf5 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -359,7 +359,7 @@ static int he_init_one(struct pci_dev *pci_dev,
359 359
360 if (pci_enable_device(pci_dev)) 360 if (pci_enable_device(pci_dev))
361 return -EIO; 361 return -EIO;
362 if (pci_set_dma_mask(pci_dev, DMA_BIT_MASK(32)) != 0) { 362 if (dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32)) != 0) {
363 printk(KERN_WARNING "he: no suitable dma available\n"); 363 printk(KERN_WARNING "he: no suitable dma available\n");
364 err = -EIO; 364 err = -EIO;
365 goto init_one_failure; 365 goto init_one_failure;
@@ -533,9 +533,9 @@ static void he_init_tx_lbfp(struct he_dev *he_dev)
533 533
534static int he_init_tpdrq(struct he_dev *he_dev) 534static int he_init_tpdrq(struct he_dev *he_dev)
535{ 535{
536 he_dev->tpdrq_base = pci_zalloc_consistent(he_dev->pci_dev, 536 he_dev->tpdrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
537 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq), 537 CONFIG_TPDRQ_SIZE * sizeof(struct he_tpdrq),
538 &he_dev->tpdrq_phys); 538 &he_dev->tpdrq_phys, GFP_KERNEL);
539 if (he_dev->tpdrq_base == NULL) { 539 if (he_dev->tpdrq_base == NULL) {
540 hprintk("failed to alloc tpdrq\n"); 540 hprintk("failed to alloc tpdrq\n");
541 return -ENOMEM; 541 return -ENOMEM;
@@ -796,16 +796,16 @@ static int he_init_group(struct he_dev *he_dev, int group)
796 } 796 }
797 797
798 /* large buffer pool */ 798 /* large buffer pool */
799 he_dev->rbpl_pool = pci_pool_create("rbpl", he_dev->pci_dev, 799 he_dev->rbpl_pool = dma_pool_create("rbpl", &he_dev->pci_dev->dev,
800 CONFIG_RBPL_BUFSIZE, 64, 0); 800 CONFIG_RBPL_BUFSIZE, 64, 0);
801 if (he_dev->rbpl_pool == NULL) { 801 if (he_dev->rbpl_pool == NULL) {
802 hprintk("unable to create rbpl pool\n"); 802 hprintk("unable to create rbpl pool\n");
803 goto out_free_rbpl_virt; 803 goto out_free_rbpl_virt;
804 } 804 }
805 805
806 he_dev->rbpl_base = pci_zalloc_consistent(he_dev->pci_dev, 806 he_dev->rbpl_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
807 CONFIG_RBPL_SIZE * sizeof(struct he_rbp), 807 CONFIG_RBPL_SIZE * sizeof(struct he_rbp),
808 &he_dev->rbpl_phys); 808 &he_dev->rbpl_phys, GFP_KERNEL);
809 if (he_dev->rbpl_base == NULL) { 809 if (he_dev->rbpl_base == NULL) {
810 hprintk("failed to alloc rbpl_base\n"); 810 hprintk("failed to alloc rbpl_base\n");
811 goto out_destroy_rbpl_pool; 811 goto out_destroy_rbpl_pool;
@@ -815,7 +815,7 @@ static int he_init_group(struct he_dev *he_dev, int group)
815 815
816 for (i = 0; i < CONFIG_RBPL_SIZE; ++i) { 816 for (i = 0; i < CONFIG_RBPL_SIZE; ++i) {
817 817
818 heb = pci_pool_alloc(he_dev->rbpl_pool, GFP_KERNEL|GFP_DMA, &mapping); 818 heb = dma_pool_alloc(he_dev->rbpl_pool, GFP_KERNEL, &mapping);
819 if (!heb) 819 if (!heb)
820 goto out_free_rbpl; 820 goto out_free_rbpl;
821 heb->mapping = mapping; 821 heb->mapping = mapping;
@@ -842,9 +842,9 @@ static int he_init_group(struct he_dev *he_dev, int group)
842 842
843 /* rx buffer ready queue */ 843 /* rx buffer ready queue */
844 844
845 he_dev->rbrq_base = pci_zalloc_consistent(he_dev->pci_dev, 845 he_dev->rbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
846 CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), 846 CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
847 &he_dev->rbrq_phys); 847 &he_dev->rbrq_phys, GFP_KERNEL);
848 if (he_dev->rbrq_base == NULL) { 848 if (he_dev->rbrq_base == NULL) {
849 hprintk("failed to allocate rbrq\n"); 849 hprintk("failed to allocate rbrq\n");
850 goto out_free_rbpl; 850 goto out_free_rbpl;
@@ -866,9 +866,9 @@ static int he_init_group(struct he_dev *he_dev, int group)
866 866
867 /* tx buffer ready queue */ 867 /* tx buffer ready queue */
868 868
869 he_dev->tbrq_base = pci_zalloc_consistent(he_dev->pci_dev, 869 he_dev->tbrq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
870 CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), 870 CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
871 &he_dev->tbrq_phys); 871 &he_dev->tbrq_phys, GFP_KERNEL);
872 if (he_dev->tbrq_base == NULL) { 872 if (he_dev->tbrq_base == NULL) {
873 hprintk("failed to allocate tbrq\n"); 873 hprintk("failed to allocate tbrq\n");
874 goto out_free_rbpq_base; 874 goto out_free_rbpq_base;
@@ -884,18 +884,18 @@ static int he_init_group(struct he_dev *he_dev, int group)
884 return 0; 884 return 0;
885 885
886out_free_rbpq_base: 886out_free_rbpq_base:
887 pci_free_consistent(he_dev->pci_dev, CONFIG_RBRQ_SIZE * 887 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE *
888 sizeof(struct he_rbrq), he_dev->rbrq_base, 888 sizeof(struct he_rbrq), he_dev->rbrq_base,
889 he_dev->rbrq_phys); 889 he_dev->rbrq_phys);
890out_free_rbpl: 890out_free_rbpl:
891 list_for_each_entry_safe(heb, next, &he_dev->rbpl_outstanding, entry) 891 list_for_each_entry_safe(heb, next, &he_dev->rbpl_outstanding, entry)
892 pci_pool_free(he_dev->rbpl_pool, heb, heb->mapping); 892 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping);
893 893
894 pci_free_consistent(he_dev->pci_dev, CONFIG_RBPL_SIZE * 894 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBPL_SIZE *
895 sizeof(struct he_rbp), he_dev->rbpl_base, 895 sizeof(struct he_rbp), he_dev->rbpl_base,
896 he_dev->rbpl_phys); 896 he_dev->rbpl_phys);
897out_destroy_rbpl_pool: 897out_destroy_rbpl_pool:
898 pci_pool_destroy(he_dev->rbpl_pool); 898 dma_pool_destroy(he_dev->rbpl_pool);
899out_free_rbpl_virt: 899out_free_rbpl_virt:
900 kfree(he_dev->rbpl_virt); 900 kfree(he_dev->rbpl_virt);
901out_free_rbpl_table: 901out_free_rbpl_table:
@@ -911,8 +911,11 @@ static int he_init_irq(struct he_dev *he_dev)
911 /* 2.9.3.5 tail offset for each interrupt queue is located after the 911 /* 2.9.3.5 tail offset for each interrupt queue is located after the
912 end of the interrupt queue */ 912 end of the interrupt queue */
913 913
914 he_dev->irq_base = pci_alloc_consistent(he_dev->pci_dev, 914 he_dev->irq_base = dma_zalloc_coherent(&he_dev->pci_dev->dev,
915 (CONFIG_IRQ_SIZE+1) * sizeof(struct he_irq), &he_dev->irq_phys); 915 (CONFIG_IRQ_SIZE + 1)
916 * sizeof(struct he_irq),
917 &he_dev->irq_phys,
918 GFP_KERNEL);
916 if (he_dev->irq_base == NULL) { 919 if (he_dev->irq_base == NULL) {
917 hprintk("failed to allocate irq\n"); 920 hprintk("failed to allocate irq\n");
918 return -ENOMEM; 921 return -ENOMEM;
@@ -1419,10 +1422,10 @@ static int he_start(struct atm_dev *dev)
1419 1422
1420 he_init_tpdrq(he_dev); 1423 he_init_tpdrq(he_dev);
1421 1424
1422 he_dev->tpd_pool = pci_pool_create("tpd", he_dev->pci_dev, 1425 he_dev->tpd_pool = dma_pool_create("tpd", &he_dev->pci_dev->dev,
1423 sizeof(struct he_tpd), TPD_ALIGNMENT, 0); 1426 sizeof(struct he_tpd), TPD_ALIGNMENT, 0);
1424 if (he_dev->tpd_pool == NULL) { 1427 if (he_dev->tpd_pool == NULL) {
1425 hprintk("unable to create tpd pci_pool\n"); 1428 hprintk("unable to create tpd dma_pool\n");
1426 return -ENOMEM; 1429 return -ENOMEM;
1427 } 1430 }
1428 1431
@@ -1459,9 +1462,9 @@ static int he_start(struct atm_dev *dev)
1459 1462
1460 /* host status page */ 1463 /* host status page */
1461 1464
1462 he_dev->hsp = pci_zalloc_consistent(he_dev->pci_dev, 1465 he_dev->hsp = dma_zalloc_coherent(&he_dev->pci_dev->dev,
1463 sizeof(struct he_hsp), 1466 sizeof(struct he_hsp),
1464 &he_dev->hsp_phys); 1467 &he_dev->hsp_phys, GFP_KERNEL);
1465 if (he_dev->hsp == NULL) { 1468 if (he_dev->hsp == NULL) {
1466 hprintk("failed to allocate host status page\n"); 1469 hprintk("failed to allocate host status page\n");
1467 return -ENOMEM; 1470 return -ENOMEM;
@@ -1558,41 +1561,41 @@ he_stop(struct he_dev *he_dev)
1558 free_irq(he_dev->irq, he_dev); 1561 free_irq(he_dev->irq, he_dev);
1559 1562
1560 if (he_dev->irq_base) 1563 if (he_dev->irq_base)
1561 pci_free_consistent(he_dev->pci_dev, (CONFIG_IRQ_SIZE+1) 1564 dma_free_coherent(&he_dev->pci_dev->dev, (CONFIG_IRQ_SIZE + 1)
1562 * sizeof(struct he_irq), he_dev->irq_base, he_dev->irq_phys); 1565 * sizeof(struct he_irq), he_dev->irq_base, he_dev->irq_phys);
1563 1566
1564 if (he_dev->hsp) 1567 if (he_dev->hsp)
1565 pci_free_consistent(he_dev->pci_dev, sizeof(struct he_hsp), 1568 dma_free_coherent(&he_dev->pci_dev->dev, sizeof(struct he_hsp),
1566 he_dev->hsp, he_dev->hsp_phys); 1569 he_dev->hsp, he_dev->hsp_phys);
1567 1570
1568 if (he_dev->rbpl_base) { 1571 if (he_dev->rbpl_base) {
1569 list_for_each_entry_safe(heb, next, &he_dev->rbpl_outstanding, entry) 1572 list_for_each_entry_safe(heb, next, &he_dev->rbpl_outstanding, entry)
1570 pci_pool_free(he_dev->rbpl_pool, heb, heb->mapping); 1573 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping);
1571 1574
1572 pci_free_consistent(he_dev->pci_dev, CONFIG_RBPL_SIZE 1575 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBPL_SIZE
1573 * sizeof(struct he_rbp), he_dev->rbpl_base, he_dev->rbpl_phys); 1576 * sizeof(struct he_rbp), he_dev->rbpl_base, he_dev->rbpl_phys);
1574 } 1577 }
1575 1578
1576 kfree(he_dev->rbpl_virt); 1579 kfree(he_dev->rbpl_virt);
1577 kfree(he_dev->rbpl_table); 1580 kfree(he_dev->rbpl_table);
1578 1581
1579 if (he_dev->rbpl_pool) 1582 if (he_dev->rbpl_pool)
1580 pci_pool_destroy(he_dev->rbpl_pool); 1583 dma_pool_destroy(he_dev->rbpl_pool);
1581 1584
1582 if (he_dev->rbrq_base) 1585 if (he_dev->rbrq_base)
1583 pci_free_consistent(he_dev->pci_dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq), 1586 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
1584 he_dev->rbrq_base, he_dev->rbrq_phys); 1587 he_dev->rbrq_base, he_dev->rbrq_phys);
1585 1588
1586 if (he_dev->tbrq_base) 1589 if (he_dev->tbrq_base)
1587 pci_free_consistent(he_dev->pci_dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), 1590 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
1588 he_dev->tbrq_base, he_dev->tbrq_phys); 1591 he_dev->tbrq_base, he_dev->tbrq_phys);
1589 1592
1590 if (he_dev->tpdrq_base) 1593 if (he_dev->tpdrq_base)
1591 pci_free_consistent(he_dev->pci_dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq), 1594 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
1592 he_dev->tpdrq_base, he_dev->tpdrq_phys); 1595 he_dev->tpdrq_base, he_dev->tpdrq_phys);
1593 1596
1594 if (he_dev->tpd_pool) 1597 if (he_dev->tpd_pool)
1595 pci_pool_destroy(he_dev->tpd_pool); 1598 dma_pool_destroy(he_dev->tpd_pool);
1596 1599
1597 if (he_dev->pci_dev) { 1600 if (he_dev->pci_dev) {
1598 pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command); 1601 pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command);
@@ -1610,7 +1613,7 @@ __alloc_tpd(struct he_dev *he_dev)
1610 struct he_tpd *tpd; 1613 struct he_tpd *tpd;
1611 dma_addr_t mapping; 1614 dma_addr_t mapping;
1612 1615
1613 tpd = pci_pool_alloc(he_dev->tpd_pool, GFP_ATOMIC|GFP_DMA, &mapping); 1616 tpd = dma_pool_alloc(he_dev->tpd_pool, GFP_ATOMIC, &mapping);
1614 if (tpd == NULL) 1617 if (tpd == NULL)
1615 return NULL; 1618 return NULL;
1616 1619
@@ -1681,7 +1684,7 @@ he_service_rbrq(struct he_dev *he_dev, int group)
1681 if (!RBRQ_HBUF_ERR(he_dev->rbrq_head)) { 1684 if (!RBRQ_HBUF_ERR(he_dev->rbrq_head)) {
1682 clear_bit(i, he_dev->rbpl_table); 1685 clear_bit(i, he_dev->rbpl_table);
1683 list_del(&heb->entry); 1686 list_del(&heb->entry);
1684 pci_pool_free(he_dev->rbpl_pool, heb, heb->mapping); 1687 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping);
1685 } 1688 }
1686 1689
1687 goto next_rbrq_entry; 1690 goto next_rbrq_entry;
@@ -1774,7 +1777,7 @@ return_host_buffers:
1774 ++pdus_assembled; 1777 ++pdus_assembled;
1775 1778
1776 list_for_each_entry_safe(heb, next, &he_vcc->buffers, entry) 1779 list_for_each_entry_safe(heb, next, &he_vcc->buffers, entry)
1777 pci_pool_free(he_dev->rbpl_pool, heb, heb->mapping); 1780 dma_pool_free(he_dev->rbpl_pool, heb, heb->mapping);
1778 INIT_LIST_HEAD(&he_vcc->buffers); 1781 INIT_LIST_HEAD(&he_vcc->buffers);
1779 he_vcc->pdu_len = 0; 1782 he_vcc->pdu_len = 0;
1780 1783
@@ -1843,10 +1846,10 @@ he_service_tbrq(struct he_dev *he_dev, int group)
1843 1846
1844 for (slot = 0; slot < TPD_MAXIOV; ++slot) { 1847 for (slot = 0; slot < TPD_MAXIOV; ++slot) {
1845 if (tpd->iovec[slot].addr) 1848 if (tpd->iovec[slot].addr)
1846 pci_unmap_single(he_dev->pci_dev, 1849 dma_unmap_single(&he_dev->pci_dev->dev,
1847 tpd->iovec[slot].addr, 1850 tpd->iovec[slot].addr,
1848 tpd->iovec[slot].len & TPD_LEN_MASK, 1851 tpd->iovec[slot].len & TPD_LEN_MASK,
1849 PCI_DMA_TODEVICE); 1852 DMA_TO_DEVICE);
1850 if (tpd->iovec[slot].len & TPD_LST) 1853 if (tpd->iovec[slot].len & TPD_LST)
1851 break; 1854 break;
1852 1855
@@ -1861,7 +1864,7 @@ he_service_tbrq(struct he_dev *he_dev, int group)
1861 1864
1862next_tbrq_entry: 1865next_tbrq_entry:
1863 if (tpd) 1866 if (tpd)
1864 pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status)); 1867 dma_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
1865 he_dev->tbrq_head = (struct he_tbrq *) 1868 he_dev->tbrq_head = (struct he_tbrq *)
1866 ((unsigned long) he_dev->tbrq_base | 1869 ((unsigned long) he_dev->tbrq_base |
1867 TBRQ_MASK(he_dev->tbrq_head + 1)); 1870 TBRQ_MASK(he_dev->tbrq_head + 1));
@@ -1905,7 +1908,7 @@ he_service_rbpl(struct he_dev *he_dev, int group)
1905 } 1908 }
1906 he_dev->rbpl_hint = i + 1; 1909 he_dev->rbpl_hint = i + 1;
1907 1910
1908 heb = pci_pool_alloc(he_dev->rbpl_pool, GFP_ATOMIC|GFP_DMA, &mapping); 1911 heb = dma_pool_alloc(he_dev->rbpl_pool, GFP_ATOMIC, &mapping);
1909 if (!heb) 1912 if (!heb)
1910 break; 1913 break;
1911 heb->mapping = mapping; 1914 heb->mapping = mapping;
@@ -2084,10 +2087,10 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
2084 */ 2087 */
2085 for (slot = 0; slot < TPD_MAXIOV; ++slot) { 2088 for (slot = 0; slot < TPD_MAXIOV; ++slot) {
2086 if (tpd->iovec[slot].addr) 2089 if (tpd->iovec[slot].addr)
2087 pci_unmap_single(he_dev->pci_dev, 2090 dma_unmap_single(&he_dev->pci_dev->dev,
2088 tpd->iovec[slot].addr, 2091 tpd->iovec[slot].addr,
2089 tpd->iovec[slot].len & TPD_LEN_MASK, 2092 tpd->iovec[slot].len & TPD_LEN_MASK,
2090 PCI_DMA_TODEVICE); 2093 DMA_TO_DEVICE);
2091 } 2094 }
2092 if (tpd->skb) { 2095 if (tpd->skb) {
2093 if (tpd->vcc->pop) 2096 if (tpd->vcc->pop)
@@ -2096,7 +2099,7 @@ __enqueue_tpd(struct he_dev *he_dev, struct he_tpd *tpd, unsigned cid)
2096 dev_kfree_skb_any(tpd->skb); 2099 dev_kfree_skb_any(tpd->skb);
2097 atomic_inc(&tpd->vcc->stats->tx_err); 2100 atomic_inc(&tpd->vcc->stats->tx_err);
2098 } 2101 }
2099 pci_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status)); 2102 dma_pool_free(he_dev->tpd_pool, tpd, TPD_ADDR(tpd->status));
2100 return; 2103 return;
2101 } 2104 }
2102 } 2105 }
@@ -2550,8 +2553,8 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
2550 } 2553 }
2551 2554
2552#ifdef USE_SCATTERGATHER 2555#ifdef USE_SCATTERGATHER
2553 tpd->iovec[slot].addr = pci_map_single(he_dev->pci_dev, skb->data, 2556 tpd->iovec[slot].addr = dma_map_single(&he_dev->pci_dev->dev, skb->data,
2554 skb_headlen(skb), PCI_DMA_TODEVICE); 2557 skb_headlen(skb), DMA_TO_DEVICE);
2555 tpd->iovec[slot].len = skb_headlen(skb); 2558 tpd->iovec[slot].len = skb_headlen(skb);
2556 ++slot; 2559 ++slot;
2557 2560
@@ -2579,9 +2582,9 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
2579 slot = 0; 2582 slot = 0;
2580 } 2583 }
2581 2584
2582 tpd->iovec[slot].addr = pci_map_single(he_dev->pci_dev, 2585 tpd->iovec[slot].addr = dma_map_single(&he_dev->pci_dev->dev,
2583 (void *) page_address(frag->page) + frag->page_offset, 2586 (void *) page_address(frag->page) + frag->page_offset,
2584 frag->size, PCI_DMA_TODEVICE); 2587 frag->size, DMA_TO_DEVICE);
2585 tpd->iovec[slot].len = frag->size; 2588 tpd->iovec[slot].len = frag->size;
2586 ++slot; 2589 ++slot;
2587 2590
@@ -2589,7 +2592,7 @@ he_send(struct atm_vcc *vcc, struct sk_buff *skb)
2589 2592
2590 tpd->iovec[slot - 1].len |= TPD_LST; 2593 tpd->iovec[slot - 1].len |= TPD_LST;
2591#else 2594#else
2592 tpd->address0 = pci_map_single(he_dev->pci_dev, skb->data, skb->len, PCI_DMA_TODEVICE); 2595 tpd->address0 = dma_map_single(&he_dev->pci_dev->dev, skb->data, skb->len, DMA_TO_DEVICE);
2593 tpd->length0 = skb->len | TPD_LST; 2596 tpd->length0 = skb->len | TPD_LST;
2594#endif 2597#endif
2595 tpd->status |= TPD_INT; 2598 tpd->status |= TPD_INT;
diff --git a/drivers/atm/he.h b/drivers/atm/he.h
index 110a27d2ecfc..f3f53674ef3f 100644
--- a/drivers/atm/he.h
+++ b/drivers/atm/he.h
@@ -281,7 +281,7 @@ struct he_dev {
281 int irq_peak; 281 int irq_peak;
282 282
283 struct tasklet_struct tasklet; 283 struct tasklet_struct tasklet;
284 struct pci_pool *tpd_pool; 284 struct dma_pool *tpd_pool;
285 struct list_head outstanding_tpds; 285 struct list_head outstanding_tpds;
286 286
287 dma_addr_t tpdrq_phys; 287 dma_addr_t tpdrq_phys;
@@ -296,7 +296,7 @@ struct he_dev {
296 struct he_buff **rbpl_virt; 296 struct he_buff **rbpl_virt;
297 unsigned long *rbpl_table; 297 unsigned long *rbpl_table;
298 unsigned long rbpl_hint; 298 unsigned long rbpl_hint;
299 struct pci_pool *rbpl_pool; 299 struct dma_pool *rbpl_pool;
300 dma_addr_t rbpl_phys; 300 dma_addr_t rbpl_phys;
301 struct he_rbp *rbpl_base, *rbpl_tail; 301 struct he_rbp *rbpl_base, *rbpl_tail;
302 struct list_head rbpl_outstanding; 302 struct list_head rbpl_outstanding;
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 2b24ed056728..074616b39f4d 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -641,7 +641,8 @@ alloc_scq(struct idt77252_dev *card, int class)
641 scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL); 641 scq = kzalloc(sizeof(struct scq_info), GFP_KERNEL);
642 if (!scq) 642 if (!scq)
643 return NULL; 643 return NULL;
644 scq->base = pci_zalloc_consistent(card->pcidev, SCQ_SIZE, &scq->paddr); 644 scq->base = dma_zalloc_coherent(&card->pcidev->dev, SCQ_SIZE,
645 &scq->paddr, GFP_KERNEL);
645 if (scq->base == NULL) { 646 if (scq->base == NULL) {
646 kfree(scq); 647 kfree(scq);
647 return NULL; 648 return NULL;
@@ -669,12 +670,12 @@ free_scq(struct idt77252_dev *card, struct scq_info *scq)
669 struct sk_buff *skb; 670 struct sk_buff *skb;
670 struct atm_vcc *vcc; 671 struct atm_vcc *vcc;
671 672
672 pci_free_consistent(card->pcidev, SCQ_SIZE, 673 dma_free_coherent(&card->pcidev->dev, SCQ_SIZE,
673 scq->base, scq->paddr); 674 scq->base, scq->paddr);
674 675
675 while ((skb = skb_dequeue(&scq->transmit))) { 676 while ((skb = skb_dequeue(&scq->transmit))) {
676 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 677 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
677 skb->len, PCI_DMA_TODEVICE); 678 skb->len, DMA_TO_DEVICE);
678 679
679 vcc = ATM_SKB(skb)->vcc; 680 vcc = ATM_SKB(skb)->vcc;
680 if (vcc->pop) 681 if (vcc->pop)
@@ -684,8 +685,8 @@ free_scq(struct idt77252_dev *card, struct scq_info *scq)
684 } 685 }
685 686
686 while ((skb = skb_dequeue(&scq->pending))) { 687 while ((skb = skb_dequeue(&scq->pending))) {
687 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 688 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
688 skb->len, PCI_DMA_TODEVICE); 689 skb->len, DMA_TO_DEVICE);
689 690
690 vcc = ATM_SKB(skb)->vcc; 691 vcc = ATM_SKB(skb)->vcc;
691 if (vcc->pop) 692 if (vcc->pop)
@@ -800,8 +801,8 @@ drain_scq(struct idt77252_dev *card, struct vc_map *vc)
800 if (skb) { 801 if (skb) {
801 TXPRINTK("%s: freeing skb at %p.\n", card->name, skb); 802 TXPRINTK("%s: freeing skb at %p.\n", card->name, skb);
802 803
803 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 804 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
804 skb->len, PCI_DMA_TODEVICE); 805 skb->len, DMA_TO_DEVICE);
805 806
806 vcc = ATM_SKB(skb)->vcc; 807 vcc = ATM_SKB(skb)->vcc;
807 808
@@ -846,8 +847,8 @@ queue_skb(struct idt77252_dev *card, struct vc_map *vc,
846 tbd = &IDT77252_PRV_TBD(skb); 847 tbd = &IDT77252_PRV_TBD(skb);
847 vcc = ATM_SKB(skb)->vcc; 848 vcc = ATM_SKB(skb)->vcc;
848 849
849 IDT77252_PRV_PADDR(skb) = pci_map_single(card->pcidev, skb->data, 850 IDT77252_PRV_PADDR(skb) = dma_map_single(&card->pcidev->dev, skb->data,
850 skb->len, PCI_DMA_TODEVICE); 851 skb->len, DMA_TO_DEVICE);
851 852
852 error = -EINVAL; 853 error = -EINVAL;
853 854
@@ -924,8 +925,8 @@ done:
924 return 0; 925 return 0;
925 926
926errout: 927errout:
927 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 928 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
928 skb->len, PCI_DMA_TODEVICE); 929 skb->len, DMA_TO_DEVICE);
929 return error; 930 return error;
930} 931}
931 932
@@ -970,8 +971,8 @@ init_rsq(struct idt77252_dev *card)
970{ 971{
971 struct rsq_entry *rsqe; 972 struct rsq_entry *rsqe;
972 973
973 card->rsq.base = pci_zalloc_consistent(card->pcidev, RSQSIZE, 974 card->rsq.base = dma_zalloc_coherent(&card->pcidev->dev, RSQSIZE,
974 &card->rsq.paddr); 975 &card->rsq.paddr, GFP_KERNEL);
975 if (card->rsq.base == NULL) { 976 if (card->rsq.base == NULL) {
976 printk("%s: can't allocate RSQ.\n", card->name); 977 printk("%s: can't allocate RSQ.\n", card->name);
977 return -1; 978 return -1;
@@ -1001,8 +1002,8 @@ init_rsq(struct idt77252_dev *card)
1001static void 1002static void
1002deinit_rsq(struct idt77252_dev *card) 1003deinit_rsq(struct idt77252_dev *card)
1003{ 1004{
1004 pci_free_consistent(card->pcidev, RSQSIZE, 1005 dma_free_coherent(&card->pcidev->dev, RSQSIZE,
1005 card->rsq.base, card->rsq.paddr); 1006 card->rsq.base, card->rsq.paddr);
1006} 1007}
1007 1008
1008static void 1009static void
@@ -1057,9 +1058,9 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
1057 1058
1058 vcc = vc->rx_vcc; 1059 vcc = vc->rx_vcc;
1059 1060
1060 pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(skb), 1061 dma_sync_single_for_cpu(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
1061 skb_end_pointer(skb) - skb->data, 1062 skb_end_pointer(skb) - skb->data,
1062 PCI_DMA_FROMDEVICE); 1063 DMA_FROM_DEVICE);
1063 1064
1064 if ((vcc->qos.aal == ATM_AAL0) || 1065 if ((vcc->qos.aal == ATM_AAL0) ||
1065 (vcc->qos.aal == ATM_AAL34)) { 1066 (vcc->qos.aal == ATM_AAL34)) {
@@ -1180,9 +1181,9 @@ dequeue_rx(struct idt77252_dev *card, struct rsq_entry *rsqe)
1180 return; 1181 return;
1181 } 1182 }
1182 1183
1183 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1184 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
1184 skb_end_pointer(skb) - skb->data, 1185 skb_end_pointer(skb) - skb->data,
1185 PCI_DMA_FROMDEVICE); 1186 DMA_FROM_DEVICE);
1186 sb_pool_remove(card, skb); 1187 sb_pool_remove(card, skb);
1187 1188
1188 skb_trim(skb, len); 1189 skb_trim(skb, len);
@@ -1254,9 +1255,9 @@ idt77252_rx_raw(struct idt77252_dev *card)
1254 head = IDT77252_PRV_PADDR(queue) + (queue->data - queue->head - 16); 1255 head = IDT77252_PRV_PADDR(queue) + (queue->data - queue->head - 16);
1255 tail = readl(SAR_REG_RAWCT); 1256 tail = readl(SAR_REG_RAWCT);
1256 1257
1257 pci_dma_sync_single_for_cpu(card->pcidev, IDT77252_PRV_PADDR(queue), 1258 dma_sync_single_for_cpu(&card->pcidev->dev, IDT77252_PRV_PADDR(queue),
1258 skb_end_offset(queue) - 16, 1259 skb_end_offset(queue) - 16,
1259 PCI_DMA_FROMDEVICE); 1260 DMA_FROM_DEVICE);
1260 1261
1261 while (head != tail) { 1262 while (head != tail) {
1262 unsigned int vpi, vci; 1263 unsigned int vpi, vci;
@@ -1348,11 +1349,11 @@ drop:
1348 if (next) { 1349 if (next) {
1349 card->raw_cell_head = next; 1350 card->raw_cell_head = next;
1350 queue = card->raw_cell_head; 1351 queue = card->raw_cell_head;
1351 pci_dma_sync_single_for_cpu(card->pcidev, 1352 dma_sync_single_for_cpu(&card->pcidev->dev,
1352 IDT77252_PRV_PADDR(queue), 1353 IDT77252_PRV_PADDR(queue),
1353 (skb_end_pointer(queue) - 1354 (skb_end_pointer(queue) -
1354 queue->data), 1355 queue->data),
1355 PCI_DMA_FROMDEVICE); 1356 DMA_FROM_DEVICE);
1356 } else { 1357 } else {
1357 card->raw_cell_head = NULL; 1358 card->raw_cell_head = NULL;
1358 printk("%s: raw cell queue overrun\n", 1359 printk("%s: raw cell queue overrun\n",
@@ -1375,8 +1376,8 @@ init_tsq(struct idt77252_dev *card)
1375{ 1376{
1376 struct tsq_entry *tsqe; 1377 struct tsq_entry *tsqe;
1377 1378
1378 card->tsq.base = pci_alloc_consistent(card->pcidev, RSQSIZE, 1379 card->tsq.base = dma_alloc_coherent(&card->pcidev->dev, RSQSIZE,
1379 &card->tsq.paddr); 1380 &card->tsq.paddr, GFP_KERNEL);
1380 if (card->tsq.base == NULL) { 1381 if (card->tsq.base == NULL) {
1381 printk("%s: can't allocate TSQ.\n", card->name); 1382 printk("%s: can't allocate TSQ.\n", card->name);
1382 return -1; 1383 return -1;
@@ -1398,8 +1399,8 @@ init_tsq(struct idt77252_dev *card)
1398static void 1399static void
1399deinit_tsq(struct idt77252_dev *card) 1400deinit_tsq(struct idt77252_dev *card)
1400{ 1401{
1401 pci_free_consistent(card->pcidev, TSQSIZE, 1402 dma_free_coherent(&card->pcidev->dev, TSQSIZE,
1402 card->tsq.base, card->tsq.paddr); 1403 card->tsq.base, card->tsq.paddr);
1403} 1404}
1404 1405
1405static void 1406static void
@@ -1861,9 +1862,9 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1861 goto outfree; 1862 goto outfree;
1862 } 1863 }
1863 1864
1864 paddr = pci_map_single(card->pcidev, skb->data, 1865 paddr = dma_map_single(&card->pcidev->dev, skb->data,
1865 skb_end_pointer(skb) - skb->data, 1866 skb_end_pointer(skb) - skb->data,
1866 PCI_DMA_FROMDEVICE); 1867 DMA_FROM_DEVICE);
1867 IDT77252_PRV_PADDR(skb) = paddr; 1868 IDT77252_PRV_PADDR(skb) = paddr;
1868 1869
1869 if (push_rx_skb(card, skb, queue)) { 1870 if (push_rx_skb(card, skb, queue)) {
@@ -1875,8 +1876,8 @@ add_rx_skb(struct idt77252_dev *card, int queue,
1875 return; 1876 return;
1876 1877
1877outunmap: 1878outunmap:
1878 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1879 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
1879 skb_end_pointer(skb) - skb->data, PCI_DMA_FROMDEVICE); 1880 skb_end_pointer(skb) - skb->data, DMA_FROM_DEVICE);
1880 1881
1881 handle = IDT77252_PRV_POOL(skb); 1882 handle = IDT77252_PRV_POOL(skb);
1882 card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL; 1883 card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL;
@@ -1892,15 +1893,15 @@ recycle_rx_skb(struct idt77252_dev *card, struct sk_buff *skb)
1892 u32 handle = IDT77252_PRV_POOL(skb); 1893 u32 handle = IDT77252_PRV_POOL(skb);
1893 int err; 1894 int err;
1894 1895
1895 pci_dma_sync_single_for_device(card->pcidev, IDT77252_PRV_PADDR(skb), 1896 dma_sync_single_for_device(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
1896 skb_end_pointer(skb) - skb->data, 1897 skb_end_pointer(skb) - skb->data,
1897 PCI_DMA_FROMDEVICE); 1898 DMA_FROM_DEVICE);
1898 1899
1899 err = push_rx_skb(card, skb, POOL_QUEUE(handle)); 1900 err = push_rx_skb(card, skb, POOL_QUEUE(handle));
1900 if (err) { 1901 if (err) {
1901 pci_unmap_single(card->pcidev, IDT77252_PRV_PADDR(skb), 1902 dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
1902 skb_end_pointer(skb) - skb->data, 1903 skb_end_pointer(skb) - skb->data,
1903 PCI_DMA_FROMDEVICE); 1904 DMA_FROM_DEVICE);
1904 sb_pool_remove(card, skb); 1905 sb_pool_remove(card, skb);
1905 dev_kfree_skb(skb); 1906 dev_kfree_skb(skb);
1906 } 1907 }
@@ -3058,11 +3059,11 @@ deinit_card(struct idt77252_dev *card)
3058 for (j = 0; j < FBQ_SIZE; j++) { 3059 for (j = 0; j < FBQ_SIZE; j++) {
3059 skb = card->sbpool[i].skb[j]; 3060 skb = card->sbpool[i].skb[j];
3060 if (skb) { 3061 if (skb) {
3061 pci_unmap_single(card->pcidev, 3062 dma_unmap_single(&card->pcidev->dev,
3062 IDT77252_PRV_PADDR(skb), 3063 IDT77252_PRV_PADDR(skb),
3063 (skb_end_pointer(skb) - 3064 (skb_end_pointer(skb) -
3064 skb->data), 3065 skb->data),
3065 PCI_DMA_FROMDEVICE); 3066 DMA_FROM_DEVICE);
3066 card->sbpool[i].skb[j] = NULL; 3067 card->sbpool[i].skb[j] = NULL;
3067 dev_kfree_skb(skb); 3068 dev_kfree_skb(skb);
3068 } 3069 }
@@ -3076,8 +3077,8 @@ deinit_card(struct idt77252_dev *card)
3076 vfree(card->vcs); 3077 vfree(card->vcs);
3077 3078
3078 if (card->raw_cell_hnd) { 3079 if (card->raw_cell_hnd) {
3079 pci_free_consistent(card->pcidev, 2 * sizeof(u32), 3080 dma_free_coherent(&card->pcidev->dev, 2 * sizeof(u32),
3080 card->raw_cell_hnd, card->raw_cell_paddr); 3081 card->raw_cell_hnd, card->raw_cell_paddr);
3081 } 3082 }
3082 3083
3083 if (card->rsq.base) { 3084 if (card->rsq.base) {
@@ -3397,9 +3398,10 @@ static int init_card(struct atm_dev *dev)
3397 writel(0, SAR_REG_GP); 3398 writel(0, SAR_REG_GP);
3398 3399
3399 /* Initialize RAW Cell Handle Register */ 3400 /* Initialize RAW Cell Handle Register */
3400 card->raw_cell_hnd = pci_zalloc_consistent(card->pcidev, 3401 card->raw_cell_hnd = dma_zalloc_coherent(&card->pcidev->dev,
3401 2 * sizeof(u32), 3402 2 * sizeof(u32),
3402 &card->raw_cell_paddr); 3403 &card->raw_cell_paddr,
3404 GFP_KERNEL);
3403 if (!card->raw_cell_hnd) { 3405 if (!card->raw_cell_hnd) {
3404 printk("%s: memory allocation failure.\n", card->name); 3406 printk("%s: memory allocation failure.\n", card->name);
3405 deinit_card(card); 3407 deinit_card(card);
@@ -3611,6 +3613,11 @@ static int idt77252_init_one(struct pci_dev *pcidev,
3611 return err; 3613 return err;
3612 } 3614 }
3613 3615
3616 if ((err = dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32)))) {
3617 printk("idt77252: can't enable DMA for PCI device at %s\n", pci_name(pcidev));
3618 return err;
3619 }
3620
3614 card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL); 3621 card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL);
3615 if (!card) { 3622 if (!card) {
3616 printk("idt77252-%d: can't allocate private data\n", index); 3623 printk("idt77252-%d: can't allocate private data\n", index);
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 4217f29a85e0..924f8e26789d 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -1185,8 +1185,8 @@ static int rx_pkt(struct atm_dev *dev)
1185 1185
1186 /* Build the DLE structure */ 1186 /* Build the DLE structure */
1187 wr_ptr = iadev->rx_dle_q.write; 1187 wr_ptr = iadev->rx_dle_q.write;
1188 wr_ptr->sys_pkt_addr = pci_map_single(iadev->pci, skb->data, 1188 wr_ptr->sys_pkt_addr = dma_map_single(&iadev->pci->dev, skb->data,
1189 len, PCI_DMA_FROMDEVICE); 1189 len, DMA_FROM_DEVICE);
1190 wr_ptr->local_pkt_addr = buf_addr; 1190 wr_ptr->local_pkt_addr = buf_addr;
1191 wr_ptr->bytes = len; /* We don't know this do we ?? */ 1191 wr_ptr->bytes = len; /* We don't know this do we ?? */
1192 wr_ptr->mode = DMA_INT_ENABLE; 1192 wr_ptr->mode = DMA_INT_ENABLE;
@@ -1306,8 +1306,8 @@ static void rx_dle_intr(struct atm_dev *dev)
1306 u_short length; 1306 u_short length;
1307 struct ia_vcc *ia_vcc; 1307 struct ia_vcc *ia_vcc;
1308 1308
1309 pci_unmap_single(iadev->pci, iadev->rx_dle_q.write->sys_pkt_addr, 1309 dma_unmap_single(&iadev->pci->dev, iadev->rx_dle_q.write->sys_pkt_addr,
1310 len, PCI_DMA_FROMDEVICE); 1310 len, DMA_FROM_DEVICE);
1311 /* no VCC related housekeeping done as yet. lets see */ 1311 /* no VCC related housekeeping done as yet. lets see */
1312 vcc = ATM_SKB(skb)->vcc; 1312 vcc = ATM_SKB(skb)->vcc;
1313 if (!vcc) { 1313 if (!vcc) {
@@ -1430,8 +1430,8 @@ static int rx_init(struct atm_dev *dev)
1430 // spin_lock_init(&iadev->rx_lock); 1430 // spin_lock_init(&iadev->rx_lock);
1431 1431
1432 /* Allocate 4k bytes - more aligned than needed (4k boundary) */ 1432 /* Allocate 4k bytes - more aligned than needed (4k boundary) */
1433 dle_addr = pci_alloc_consistent(iadev->pci, DLE_TOTAL_SIZE, 1433 dle_addr = dma_alloc_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE,
1434 &iadev->rx_dle_dma); 1434 &iadev->rx_dle_dma, GFP_KERNEL);
1435 if (!dle_addr) { 1435 if (!dle_addr) {
1436 printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); 1436 printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n");
1437 goto err_out; 1437 goto err_out;
@@ -1631,8 +1631,8 @@ static int rx_init(struct atm_dev *dev)
1631 return 0; 1631 return 0;
1632 1632
1633err_free_dle: 1633err_free_dle:
1634 pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->rx_dle_q.start, 1634 dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->rx_dle_q.start,
1635 iadev->rx_dle_dma); 1635 iadev->rx_dle_dma);
1636err_out: 1636err_out:
1637 return -ENOMEM; 1637 return -ENOMEM;
1638} 1638}
@@ -1702,8 +1702,8 @@ static void tx_dle_intr(struct atm_dev *dev)
1702 1702
1703 /* Revenge of the 2 dle (skb + trailer) used in ia_pkt_tx() */ 1703 /* Revenge of the 2 dle (skb + trailer) used in ia_pkt_tx() */
1704 if (!((dle - iadev->tx_dle_q.start)%(2*sizeof(struct dle)))) { 1704 if (!((dle - iadev->tx_dle_q.start)%(2*sizeof(struct dle)))) {
1705 pci_unmap_single(iadev->pci, dle->sys_pkt_addr, skb->len, 1705 dma_unmap_single(&iadev->pci->dev, dle->sys_pkt_addr, skb->len,
1706 PCI_DMA_TODEVICE); 1706 DMA_TO_DEVICE);
1707 } 1707 }
1708 vcc = ATM_SKB(skb)->vcc; 1708 vcc = ATM_SKB(skb)->vcc;
1709 if (!vcc) { 1709 if (!vcc) {
@@ -1917,8 +1917,8 @@ static int tx_init(struct atm_dev *dev)
1917 readw(iadev->seg_reg+SEG_MASK_REG));) 1917 readw(iadev->seg_reg+SEG_MASK_REG));)
1918 1918
1919 /* Allocate 4k (boundary aligned) bytes */ 1919 /* Allocate 4k (boundary aligned) bytes */
1920 dle_addr = pci_alloc_consistent(iadev->pci, DLE_TOTAL_SIZE, 1920 dle_addr = dma_alloc_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE,
1921 &iadev->tx_dle_dma); 1921 &iadev->tx_dle_dma, GFP_KERNEL);
1922 if (!dle_addr) { 1922 if (!dle_addr) {
1923 printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n"); 1923 printk(KERN_ERR DEV_LABEL "can't allocate DLEs\n");
1924 goto err_out; 1924 goto err_out;
@@ -1989,8 +1989,10 @@ static int tx_init(struct atm_dev *dev)
1989 goto err_free_tx_bufs; 1989 goto err_free_tx_bufs;
1990 } 1990 }
1991 iadev->tx_buf[i].cpcs = cpcs; 1991 iadev->tx_buf[i].cpcs = cpcs;
1992 iadev->tx_buf[i].dma_addr = pci_map_single(iadev->pci, 1992 iadev->tx_buf[i].dma_addr = dma_map_single(&iadev->pci->dev,
1993 cpcs, sizeof(*cpcs), PCI_DMA_TODEVICE); 1993 cpcs,
1994 sizeof(*cpcs),
1995 DMA_TO_DEVICE);
1994 } 1996 }
1995 iadev->desc_tbl = kmalloc(iadev->num_tx_desc * 1997 iadev->desc_tbl = kmalloc(iadev->num_tx_desc *
1996 sizeof(struct desc_tbl_t), GFP_KERNEL); 1998 sizeof(struct desc_tbl_t), GFP_KERNEL);
@@ -2198,14 +2200,14 @@ err_free_tx_bufs:
2198 while (--i >= 0) { 2200 while (--i >= 0) {
2199 struct cpcs_trailer_desc *desc = iadev->tx_buf + i; 2201 struct cpcs_trailer_desc *desc = iadev->tx_buf + i;
2200 2202
2201 pci_unmap_single(iadev->pci, desc->dma_addr, 2203 dma_unmap_single(&iadev->pci->dev, desc->dma_addr,
2202 sizeof(*desc->cpcs), PCI_DMA_TODEVICE); 2204 sizeof(*desc->cpcs), DMA_TO_DEVICE);
2203 kfree(desc->cpcs); 2205 kfree(desc->cpcs);
2204 } 2206 }
2205 kfree(iadev->tx_buf); 2207 kfree(iadev->tx_buf);
2206err_free_dle: 2208err_free_dle:
2207 pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->tx_dle_q.start, 2209 dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->tx_dle_q.start,
2208 iadev->tx_dle_dma); 2210 iadev->tx_dle_dma);
2209err_out: 2211err_out:
2210 return -ENOMEM; 2212 return -ENOMEM;
2211} 2213}
@@ -2476,20 +2478,20 @@ static void ia_free_tx(IADEV *iadev)
2476 for (i = 0; i < iadev->num_tx_desc; i++) { 2478 for (i = 0; i < iadev->num_tx_desc; i++) {
2477 struct cpcs_trailer_desc *desc = iadev->tx_buf + i; 2479 struct cpcs_trailer_desc *desc = iadev->tx_buf + i;
2478 2480
2479 pci_unmap_single(iadev->pci, desc->dma_addr, 2481 dma_unmap_single(&iadev->pci->dev, desc->dma_addr,
2480 sizeof(*desc->cpcs), PCI_DMA_TODEVICE); 2482 sizeof(*desc->cpcs), DMA_TO_DEVICE);
2481 kfree(desc->cpcs); 2483 kfree(desc->cpcs);
2482 } 2484 }
2483 kfree(iadev->tx_buf); 2485 kfree(iadev->tx_buf);
2484 pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->tx_dle_q.start, 2486 dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->tx_dle_q.start,
2485 iadev->tx_dle_dma); 2487 iadev->tx_dle_dma);
2486} 2488}
2487 2489
2488static void ia_free_rx(IADEV *iadev) 2490static void ia_free_rx(IADEV *iadev)
2489{ 2491{
2490 kfree(iadev->rx_open); 2492 kfree(iadev->rx_open);
2491 pci_free_consistent(iadev->pci, DLE_TOTAL_SIZE, iadev->rx_dle_q.start, 2493 dma_free_coherent(&iadev->pci->dev, DLE_TOTAL_SIZE, iadev->rx_dle_q.start,
2492 iadev->rx_dle_dma); 2494 iadev->rx_dle_dma);
2493} 2495}
2494 2496
2495static int ia_start(struct atm_dev *dev) 2497static int ia_start(struct atm_dev *dev)
@@ -3009,8 +3011,8 @@ static int ia_pkt_tx (struct atm_vcc *vcc, struct sk_buff *skb) {
3009 /* Build the DLE structure */ 3011 /* Build the DLE structure */
3010 wr_ptr = iadev->tx_dle_q.write; 3012 wr_ptr = iadev->tx_dle_q.write;
3011 memset((caddr_t)wr_ptr, 0, sizeof(*wr_ptr)); 3013 memset((caddr_t)wr_ptr, 0, sizeof(*wr_ptr));
3012 wr_ptr->sys_pkt_addr = pci_map_single(iadev->pci, skb->data, 3014 wr_ptr->sys_pkt_addr = dma_map_single(&iadev->pci->dev, skb->data,
3013 skb->len, PCI_DMA_TODEVICE); 3015 skb->len, DMA_TO_DEVICE);
3014 wr_ptr->local_pkt_addr = (buf_desc_ptr->buf_start_hi << 16) | 3016 wr_ptr->local_pkt_addr = (buf_desc_ptr->buf_start_hi << 16) |
3015 buf_desc_ptr->buf_start_lo; 3017 buf_desc_ptr->buf_start_lo;
3016 /* wr_ptr->bytes = swap_byte_order(total_len); didn't seem to affect?? */ 3018 /* wr_ptr->bytes = swap_byte_order(total_len); didn't seem to affect?? */
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index d2e9ea8d504e..ce43ae3e87b3 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -346,7 +346,8 @@ static void lanai_buf_allocate(struct lanai_buffer *buf,
346 * everything, but the way the lanai uses DMA memory would 346 * everything, but the way the lanai uses DMA memory would
347 * make that a terrific pain. This is much simpler. 347 * make that a terrific pain. This is much simpler.
348 */ 348 */
349 buf->start = pci_alloc_consistent(pci, size, &buf->dmaaddr); 349 buf->start = dma_alloc_coherent(&pci->dev,
350 size, &buf->dmaaddr, GFP_KERNEL);
350 if (buf->start != NULL) { /* Success */ 351 if (buf->start != NULL) { /* Success */
351 /* Lanai requires 256-byte alignment of DMA bufs */ 352 /* Lanai requires 256-byte alignment of DMA bufs */
352 APRINTK((buf->dmaaddr & ~0xFFFFFF00) == 0, 353 APRINTK((buf->dmaaddr & ~0xFFFFFF00) == 0,
@@ -372,8 +373,8 @@ static void lanai_buf_deallocate(struct lanai_buffer *buf,
372 struct pci_dev *pci) 373 struct pci_dev *pci)
373{ 374{
374 if (buf->start != NULL) { 375 if (buf->start != NULL) {
375 pci_free_consistent(pci, lanai_buf_size(buf), 376 dma_free_coherent(&pci->dev, lanai_buf_size(buf),
376 buf->start, buf->dmaaddr); 377 buf->start, buf->dmaaddr);
377 buf->start = buf->end = buf->ptr = NULL; 378 buf->start = buf->end = buf->ptr = NULL;
378 } 379 }
379} 380}
@@ -1944,12 +1945,7 @@ static int lanai_pci_start(struct lanai_dev *lanai)
1944 return -ENXIO; 1945 return -ENXIO;
1945 } 1946 }
1946 pci_set_master(pci); 1947 pci_set_master(pci);
1947 if (pci_set_dma_mask(pci, DMA_BIT_MASK(32)) != 0) { 1948 if (dma_set_mask_and_coherent(&pci->dev, DMA_BIT_MASK(32)) != 0) {
1948 printk(KERN_WARNING DEV_LABEL
1949 "(itf %d): No suitable DMA available.\n", lanai->number);
1950 return -EBUSY;
1951 }
1952 if (pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(32)) != 0) {
1953 printk(KERN_WARNING DEV_LABEL 1949 printk(KERN_WARNING DEV_LABEL
1954 "(itf %d): No suitable DMA available.\n", lanai->number); 1950 "(itf %d): No suitable DMA available.\n", lanai->number);
1955 return -EBUSY; 1951 return -EBUSY;
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 9988ac98b6d8..b7e1cc0a97c8 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -252,10 +252,10 @@ static void nicstar_remove_one(struct pci_dev *pcidev)
252 free_scq(card, card->scd2vc[j]->scq, card->scd2vc[j]->tx_vcc); 252 free_scq(card, card->scd2vc[j]->scq, card->scd2vc[j]->tx_vcc);
253 } 253 }
254 idr_destroy(&card->idr); 254 idr_destroy(&card->idr);
255 pci_free_consistent(card->pcidev, NS_RSQSIZE + NS_RSQ_ALIGNMENT, 255 dma_free_coherent(&card->pcidev->dev, NS_RSQSIZE + NS_RSQ_ALIGNMENT,
256 card->rsq.org, card->rsq.dma); 256 card->rsq.org, card->rsq.dma);
257 pci_free_consistent(card->pcidev, NS_TSQSIZE + NS_TSQ_ALIGNMENT, 257 dma_free_coherent(&card->pcidev->dev, NS_TSQSIZE + NS_TSQ_ALIGNMENT,
258 card->tsq.org, card->tsq.dma); 258 card->tsq.org, card->tsq.dma);
259 free_irq(card->pcidev->irq, card); 259 free_irq(card->pcidev->irq, card);
260 iounmap(card->membase); 260 iounmap(card->membase);
261 kfree(card); 261 kfree(card);
@@ -370,8 +370,7 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
370 ns_init_card_error(card, error); 370 ns_init_card_error(card, error);
371 return error; 371 return error;
372 } 372 }
373 if ((pci_set_dma_mask(pcidev, DMA_BIT_MASK(32)) != 0) || 373 if (dma_set_mask_and_coherent(&pcidev->dev, DMA_BIT_MASK(32)) != 0) {
374 (pci_set_consistent_dma_mask(pcidev, DMA_BIT_MASK(32)) != 0)) {
375 printk(KERN_WARNING 374 printk(KERN_WARNING
376 "nicstar%d: No suitable DMA available.\n", i); 375 "nicstar%d: No suitable DMA available.\n", i);
377 error = 2; 376 error = 2;
@@ -535,9 +534,9 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
535 writel(0x00000000, card->membase + VPM); 534 writel(0x00000000, card->membase + VPM);
536 535
537 /* Initialize TSQ */ 536 /* Initialize TSQ */
538 card->tsq.org = pci_alloc_consistent(card->pcidev, 537 card->tsq.org = dma_alloc_coherent(&card->pcidev->dev,
539 NS_TSQSIZE + NS_TSQ_ALIGNMENT, 538 NS_TSQSIZE + NS_TSQ_ALIGNMENT,
540 &card->tsq.dma); 539 &card->tsq.dma, GFP_KERNEL);
541 if (card->tsq.org == NULL) { 540 if (card->tsq.org == NULL) {
542 printk("nicstar%d: can't allocate TSQ.\n", i); 541 printk("nicstar%d: can't allocate TSQ.\n", i);
543 error = 10; 542 error = 10;
@@ -554,9 +553,9 @@ static int ns_init_card(int i, struct pci_dev *pcidev)
554 PRINTK("nicstar%d: TSQ base at 0x%p.\n", i, card->tsq.base); 553 PRINTK("nicstar%d: TSQ base at 0x%p.\n", i, card->tsq.base);
555 554
556 /* Initialize RSQ */ 555 /* Initialize RSQ */
557 card->rsq.org = pci_alloc_consistent(card->pcidev, 556 card->rsq.org = dma_alloc_coherent(&card->pcidev->dev,
558 NS_RSQSIZE + NS_RSQ_ALIGNMENT, 557 NS_RSQSIZE + NS_RSQ_ALIGNMENT,
559 &card->rsq.dma); 558 &card->rsq.dma, GFP_KERNEL);
560 if (card->rsq.org == NULL) { 559 if (card->rsq.org == NULL) {
561 printk("nicstar%d: can't allocate RSQ.\n", i); 560 printk("nicstar%d: can't allocate RSQ.\n", i);
562 error = 11; 561 error = 11;
@@ -874,7 +873,8 @@ static scq_info *get_scq(ns_dev *card, int size, u32 scd)
874 scq = kmalloc(sizeof(scq_info), GFP_KERNEL); 873 scq = kmalloc(sizeof(scq_info), GFP_KERNEL);
875 if (!scq) 874 if (!scq)
876 return NULL; 875 return NULL;
877 scq->org = pci_alloc_consistent(card->pcidev, 2 * size, &scq->dma); 876 scq->org = dma_alloc_coherent(&card->pcidev->dev,
877 2 * size, &scq->dma, GFP_KERNEL);
878 if (!scq->org) { 878 if (!scq->org) {
879 kfree(scq); 879 kfree(scq);
880 return NULL; 880 return NULL;
@@ -936,10 +936,10 @@ static void free_scq(ns_dev *card, scq_info *scq, struct atm_vcc *vcc)
936 } 936 }
937 } 937 }
938 kfree(scq->skb); 938 kfree(scq->skb);
939 pci_free_consistent(card->pcidev, 939 dma_free_coherent(&card->pcidev->dev,
940 2 * (scq->num_entries == VBR_SCQ_NUM_ENTRIES ? 940 2 * (scq->num_entries == VBR_SCQ_NUM_ENTRIES ?
941 VBR_SCQSIZE : CBR_SCQSIZE), 941 VBR_SCQSIZE : CBR_SCQSIZE),
942 scq->org, scq->dma); 942 scq->org, scq->dma);
943 kfree(scq); 943 kfree(scq);
944} 944}
945 945
@@ -957,11 +957,11 @@ static void push_rxbufs(ns_dev * card, struct sk_buff *skb)
957 handle2 = NULL; 957 handle2 = NULL;
958 addr2 = 0; 958 addr2 = 0;
959 handle1 = skb; 959 handle1 = skb;
960 addr1 = pci_map_single(card->pcidev, 960 addr1 = dma_map_single(&card->pcidev->dev,
961 skb->data, 961 skb->data,
962 (NS_PRV_BUFTYPE(skb) == BUF_SM 962 (NS_PRV_BUFTYPE(skb) == BUF_SM
963 ? NS_SMSKBSIZE : NS_LGSKBSIZE), 963 ? NS_SMSKBSIZE : NS_LGSKBSIZE),
964 PCI_DMA_TODEVICE); 964 DMA_TO_DEVICE);
965 NS_PRV_DMA(skb) = addr1; /* save so we can unmap later */ 965 NS_PRV_DMA(skb) = addr1; /* save so we can unmap later */
966 966
967#ifdef GENERAL_DEBUG 967#ifdef GENERAL_DEBUG
@@ -1670,8 +1670,8 @@ static int ns_send(struct atm_vcc *vcc, struct sk_buff *skb)
1670 1670
1671 ATM_SKB(skb)->vcc = vcc; 1671 ATM_SKB(skb)->vcc = vcc;
1672 1672
1673 NS_PRV_DMA(skb) = pci_map_single(card->pcidev, skb->data, 1673 NS_PRV_DMA(skb) = dma_map_single(&card->pcidev->dev, skb->data,
1674 skb->len, PCI_DMA_TODEVICE); 1674 skb->len, DMA_TO_DEVICE);
1675 1675
1676 if (vcc->qos.aal == ATM_AAL5) { 1676 if (vcc->qos.aal == ATM_AAL5) {
1677 buflen = (skb->len + 47 + 8) / 48 * 48; /* Multiple of 48 */ 1677 buflen = (skb->len + 47 + 8) / 48 * 48; /* Multiple of 48 */
@@ -1930,10 +1930,10 @@ static void drain_scq(ns_dev * card, scq_info * scq, int pos)
1930 XPRINTK("nicstar%d: freeing skb at 0x%p (index %d).\n", 1930 XPRINTK("nicstar%d: freeing skb at 0x%p (index %d).\n",
1931 card->index, skb, i); 1931 card->index, skb, i);
1932 if (skb != NULL) { 1932 if (skb != NULL) {
1933 pci_unmap_single(card->pcidev, 1933 dma_unmap_single(&card->pcidev->dev,
1934 NS_PRV_DMA(skb), 1934 NS_PRV_DMA(skb),
1935 skb->len, 1935 skb->len,
1936 PCI_DMA_TODEVICE); 1936 DMA_TO_DEVICE);
1937 vcc = ATM_SKB(skb)->vcc; 1937 vcc = ATM_SKB(skb)->vcc;
1938 if (vcc && vcc->pop != NULL) { 1938 if (vcc && vcc->pop != NULL) {
1939 vcc->pop(vcc, skb); 1939 vcc->pop(vcc, skb);
@@ -1992,16 +1992,16 @@ static void dequeue_rx(ns_dev * card, ns_rsqe * rsqe)
1992 return; 1992 return;
1993 } 1993 }
1994 idr_remove(&card->idr, id); 1994 idr_remove(&card->idr, id);
1995 pci_dma_sync_single_for_cpu(card->pcidev, 1995 dma_sync_single_for_cpu(&card->pcidev->dev,
1996 NS_PRV_DMA(skb), 1996 NS_PRV_DMA(skb),
1997 (NS_PRV_BUFTYPE(skb) == BUF_SM 1997 (NS_PRV_BUFTYPE(skb) == BUF_SM
1998 ? NS_SMSKBSIZE : NS_LGSKBSIZE), 1998 ? NS_SMSKBSIZE : NS_LGSKBSIZE),
1999 PCI_DMA_FROMDEVICE); 1999 DMA_FROM_DEVICE);
2000 pci_unmap_single(card->pcidev, 2000 dma_unmap_single(&card->pcidev->dev,
2001 NS_PRV_DMA(skb), 2001 NS_PRV_DMA(skb),
2002 (NS_PRV_BUFTYPE(skb) == BUF_SM 2002 (NS_PRV_BUFTYPE(skb) == BUF_SM
2003 ? NS_SMSKBSIZE : NS_LGSKBSIZE), 2003 ? NS_SMSKBSIZE : NS_LGSKBSIZE),
2004 PCI_DMA_FROMDEVICE); 2004 DMA_FROM_DEVICE);
2005 vpi = ns_rsqe_vpi(rsqe); 2005 vpi = ns_rsqe_vpi(rsqe);
2006 vci = ns_rsqe_vci(rsqe); 2006 vci = ns_rsqe_vci(rsqe);
2007 if (vpi >= 1UL << card->vpibits || vci >= 1UL << card->vcibits) { 2007 if (vpi >= 1UL << card->vpibits || vci >= 1UL << card->vcibits) {
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
index 21b0bc6a9c96..74e18b0a6d89 100644
--- a/drivers/atm/solos-pci.c
+++ b/drivers/atm/solos-pci.c
@@ -785,8 +785,8 @@ static void solos_bh(unsigned long card_arg)
785 skb = card->rx_skb[port]; 785 skb = card->rx_skb[port];
786 card->rx_skb[port] = NULL; 786 card->rx_skb[port] = NULL;
787 787
788 pci_unmap_single(card->dev, SKB_CB(skb)->dma_addr, 788 dma_unmap_single(&card->dev->dev, SKB_CB(skb)->dma_addr,
789 RX_DMA_SIZE, PCI_DMA_FROMDEVICE); 789 RX_DMA_SIZE, DMA_FROM_DEVICE);
790 790
791 header = (void *)skb->data; 791 header = (void *)skb->data;
792 size = le16_to_cpu(header->size); 792 size = le16_to_cpu(header->size);
@@ -872,8 +872,8 @@ static void solos_bh(unsigned long card_arg)
872 struct sk_buff *skb = alloc_skb(RX_DMA_SIZE, GFP_ATOMIC); 872 struct sk_buff *skb = alloc_skb(RX_DMA_SIZE, GFP_ATOMIC);
873 if (skb) { 873 if (skb) {
874 SKB_CB(skb)->dma_addr = 874 SKB_CB(skb)->dma_addr =
875 pci_map_single(card->dev, skb->data, 875 dma_map_single(&card->dev->dev, skb->data,
876 RX_DMA_SIZE, PCI_DMA_FROMDEVICE); 876 RX_DMA_SIZE, DMA_FROM_DEVICE);
877 iowrite32(SKB_CB(skb)->dma_addr, 877 iowrite32(SKB_CB(skb)->dma_addr,
878 card->config_regs + RX_DMA_ADDR(port)); 878 card->config_regs + RX_DMA_ADDR(port));
879 card->rx_skb[port] = skb; 879 card->rx_skb[port] = skb;
@@ -1069,8 +1069,8 @@ static uint32_t fpga_tx(struct solos_card *card)
1069 if (tx_pending & 1) { 1069 if (tx_pending & 1) {
1070 struct sk_buff *oldskb = card->tx_skb[port]; 1070 struct sk_buff *oldskb = card->tx_skb[port];
1071 if (oldskb) { 1071 if (oldskb) {
1072 pci_unmap_single(card->dev, SKB_CB(oldskb)->dma_addr, 1072 dma_unmap_single(&card->dev->dev, SKB_CB(oldskb)->dma_addr,
1073 oldskb->len, PCI_DMA_TODEVICE); 1073 oldskb->len, DMA_TO_DEVICE);
1074 card->tx_skb[port] = NULL; 1074 card->tx_skb[port] = NULL;
1075 } 1075 }
1076 spin_lock(&card->tx_queue_lock); 1076 spin_lock(&card->tx_queue_lock);
@@ -1089,8 +1089,8 @@ static uint32_t fpga_tx(struct solos_card *card)
1089 data = card->dma_bounce + (BUF_SIZE * port); 1089 data = card->dma_bounce + (BUF_SIZE * port);
1090 memcpy(data, skb->data, skb->len); 1090 memcpy(data, skb->data, skb->len);
1091 } 1091 }
1092 SKB_CB(skb)->dma_addr = pci_map_single(card->dev, data, 1092 SKB_CB(skb)->dma_addr = dma_map_single(&card->dev->dev, data,
1093 skb->len, PCI_DMA_TODEVICE); 1093 skb->len, DMA_TO_DEVICE);
1094 card->tx_skb[port] = skb; 1094 card->tx_skb[port] = skb;
1095 iowrite32(SKB_CB(skb)->dma_addr, 1095 iowrite32(SKB_CB(skb)->dma_addr,
1096 card->config_regs + TX_DMA_ADDR(port)); 1096 card->config_regs + TX_DMA_ADDR(port));
@@ -1210,7 +1210,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
1210 goto out; 1210 goto out;
1211 } 1211 }
1212 1212
1213 err = pci_set_dma_mask(dev, DMA_BIT_MASK(32)); 1213 err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
1214 if (err) { 1214 if (err) {
1215 dev_warn(&dev->dev, "Failed to set 32-bit DMA mask\n"); 1215 dev_warn(&dev->dev, "Failed to set 32-bit DMA mask\n");
1216 goto out; 1216 goto out;
@@ -1411,14 +1411,14 @@ static void atm_remove(struct solos_card *card)
1411 1411
1412 skb = card->rx_skb[i]; 1412 skb = card->rx_skb[i];
1413 if (skb) { 1413 if (skb) {
1414 pci_unmap_single(card->dev, SKB_CB(skb)->dma_addr, 1414 dma_unmap_single(&card->dev->dev, SKB_CB(skb)->dma_addr,
1415 RX_DMA_SIZE, PCI_DMA_FROMDEVICE); 1415 RX_DMA_SIZE, DMA_FROM_DEVICE);
1416 dev_kfree_skb(skb); 1416 dev_kfree_skb(skb);
1417 } 1417 }
1418 skb = card->tx_skb[i]; 1418 skb = card->tx_skb[i];
1419 if (skb) { 1419 if (skb) {
1420 pci_unmap_single(card->dev, SKB_CB(skb)->dma_addr, 1420 dma_unmap_single(&card->dev->dev, SKB_CB(skb)->dma_addr,
1421 skb->len, PCI_DMA_TODEVICE); 1421 skb->len, DMA_TO_DEVICE);
1422 dev_kfree_skb(skb); 1422 dev_kfree_skb(skb);
1423 } 1423 }
1424 while ((skb = skb_dequeue(&card->tx_queue[i]))) 1424 while ((skb = skb_dequeue(&card->tx_queue[i])))
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c
index 969c3c29000c..cecfb943762f 100644
--- a/drivers/atm/zatm.c
+++ b/drivers/atm/zatm.c
@@ -1306,19 +1306,20 @@ static int zatm_start(struct atm_dev *dev)
1306 1306
1307 if (!mbx_entries[i]) 1307 if (!mbx_entries[i])
1308 continue; 1308 continue;
1309 mbx = pci_alloc_consistent(pdev, 2*MBX_SIZE(i), &mbx_dma); 1309 mbx = dma_alloc_coherent(&pdev->dev,
1310 2 * MBX_SIZE(i), &mbx_dma, GFP_KERNEL);
1310 if (!mbx) { 1311 if (!mbx) {
1311 error = -ENOMEM; 1312 error = -ENOMEM;
1312 goto out; 1313 goto out;
1313 } 1314 }
1314 /* 1315 /*
1315 * Alignment provided by pci_alloc_consistent() isn't enough 1316 * Alignment provided by dma_alloc_coherent() isn't enough
1316 * for this device. 1317 * for this device.
1317 */ 1318 */
1318 if (((unsigned long)mbx ^ mbx_dma) & 0xffff) { 1319 if (((unsigned long)mbx ^ mbx_dma) & 0xffff) {
1319 printk(KERN_ERR DEV_LABEL "(itf %d): system " 1320 printk(KERN_ERR DEV_LABEL "(itf %d): system "
1320 "bus incompatible with driver\n", dev->number); 1321 "bus incompatible with driver\n", dev->number);
1321 pci_free_consistent(pdev, 2*MBX_SIZE(i), mbx, mbx_dma); 1322 dma_free_coherent(&pdev->dev, 2*MBX_SIZE(i), mbx, mbx_dma);
1322 error = -ENODEV; 1323 error = -ENODEV;
1323 goto out; 1324 goto out;
1324 } 1325 }
@@ -1354,9 +1355,9 @@ out_tx:
1354 kfree(zatm_dev->tx_map); 1355 kfree(zatm_dev->tx_map);
1355out: 1356out:
1356 while (i-- > 0) { 1357 while (i-- > 0) {
1357 pci_free_consistent(pdev, 2*MBX_SIZE(i), 1358 dma_free_coherent(&pdev->dev, 2 * MBX_SIZE(i),
1358 (void *)zatm_dev->mbx_start[i], 1359 (void *)zatm_dev->mbx_start[i],
1359 zatm_dev->mbx_dma[i]); 1360 zatm_dev->mbx_dma[i]);
1360 } 1361 }
1361 free_irq(zatm_dev->irq, dev); 1362 free_irq(zatm_dev->irq, dev);
1362 goto done; 1363 goto done;
@@ -1608,6 +1609,10 @@ static int zatm_init_one(struct pci_dev *pci_dev,
1608 if (ret < 0) 1609 if (ret < 0)
1609 goto out_disable; 1610 goto out_disable;
1610 1611
1612 ret = dma_set_mask_and_coherent(&pci_dev->dev, DMA_BIT_MASK(32));
1613 if (ret < 0)
1614 goto out_disable;
1615
1611 zatm_dev->pci_dev = pci_dev; 1616 zatm_dev->pci_dev = pci_dev;
1612 dev->dev_data = zatm_dev; 1617 dev->dev_data = zatm_dev;
1613 zatm_dev->copper = (int)ent->driver_data; 1618 zatm_dev->copper = (int)ent->driver_data;