diff options
Diffstat (limited to 'drivers/atm/nicstar.c')
-rw-r--r-- | drivers/atm/nicstar.c | 60 |
1 files changed, 30 insertions, 30 deletions
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) { |