RDMA/amso1100: Use the dma state API instead of pci equivalents
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Wed, 21 Apr 2010 22:23:10 +0000 (15:23 -0700)
committerRoland Dreier <rolandd@cisco.com>
Wed, 21 Apr 2010 22:23:10 +0000 (15:23 -0700)
The DMA API is preferred; no functional change.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/amso1100/c2.h
drivers/infiniband/hw/amso1100/c2_alloc.c
drivers/infiniband/hw/amso1100/c2_cq.c
drivers/infiniband/hw/amso1100/c2_mq.h
drivers/infiniband/hw/amso1100/c2_provider.h
drivers/infiniband/hw/amso1100/c2_rnic.c

index f7ff66f9836166fe30a8dce543d1d1fc55df8923..6ae698e68775c984992d01fffec0d4bfe1ea31a8 100644 (file)
@@ -250,7 +250,7 @@ struct c2_array {
 struct sp_chunk {
        struct sp_chunk *next;
        dma_addr_t dma_addr;
-       DECLARE_PCI_UNMAP_ADDR(mapping);
+       DEFINE_DMA_UNMAP_ADDR(mapping);
        u16 head;
        u16 shared_ptr[0];
 };
index d4f5f5d42e90e36bb417b9f613933f4c5acf0ee1..78d247ec69612ba287efde11f7583724e508408d 100644 (file)
@@ -49,7 +49,7 @@ static int c2_alloc_mqsp_chunk(struct c2_dev *c2dev, gfp_t gfp_mask,
                return -ENOMEM;
 
        new_head->dma_addr = dma_addr;
-       pci_unmap_addr_set(new_head, mapping, new_head->dma_addr);
+       dma_unmap_addr_set(new_head, mapping, new_head->dma_addr);
 
        new_head->next = NULL;
        new_head->head = 0;
@@ -81,7 +81,7 @@ void c2_free_mqsp_pool(struct c2_dev *c2dev, struct sp_chunk *root)
        while (root) {
                next = root->next;
                dma_free_coherent(&c2dev->pcidev->dev, PAGE_SIZE, root,
-                                 pci_unmap_addr(root, mapping));
+                                 dma_unmap_addr(root, mapping));
                root = next;
        }
 }
index f7b0fc23f41365242300ed5fc6b66086062f2fdb..49e0e8533f748d8dc3bc8ccec234a22b0bfc242c 100644 (file)
@@ -257,7 +257,7 @@ int c2_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags notify_flags)
 static void c2_free_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq)
 {
        dma_free_coherent(&c2dev->pcidev->dev, mq->q_size * mq->msg_size,
-                         mq->msg_pool.host, pci_unmap_addr(mq, mapping));
+                         mq->msg_pool.host, dma_unmap_addr(mq, mapping));
 }
 
 static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size,
@@ -278,7 +278,7 @@ static int c2_alloc_cq_buf(struct c2_dev *c2dev, struct c2_mq *mq, int q_size,
                       NULL,    /* peer (currently unknown) */
                       C2_MQ_HOST_TARGET);
 
-       pci_unmap_addr_set(mq, mapping, mq->host_dma);
+       dma_unmap_addr_set(mq, mapping, mq->host_dma);
 
        return 0;
 }
index acede007b94a37b12c608b0e76b9815db7d70c82..fc1b9a7cec4b35df88ccdde63c36ea14fb69928c 100644 (file)
@@ -71,7 +71,7 @@ struct c2_mq {
                u8 __iomem *adapter;
        } msg_pool;
        dma_addr_t host_dma;
-       DECLARE_PCI_UNMAP_ADDR(mapping);
+       DEFINE_DMA_UNMAP_ADDR(mapping);
        u16 hint_count;
        u16 priv;
        struct c2_mq_shared __iomem *peer;
index 1076df2ee96ae3bc0cdd1869b2a35ca4f7e35952..bf189987711f1a4da4890e07fd6f87eff1921e4a 100644 (file)
@@ -50,7 +50,7 @@
 
 struct c2_buf_list {
        void *buf;
-        DECLARE_PCI_UNMAP_ADDR(mapping)
+       DEFINE_DMA_UNMAP_ADDR(mapping);
 };
 
 
index 78c4bcc6ef608b131bfc04cf07c0da93bced375f..85cfae4cad7193c1dccb8f87362b8be0274cf179 100644 (file)
@@ -524,7 +524,7 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev)
                err = -ENOMEM;
                goto bail1;
        }
-       pci_unmap_addr_set(&c2dev->rep_vq, mapping, c2dev->rep_vq.host_dma);
+       dma_unmap_addr_set(&c2dev->rep_vq, mapping, c2dev->rep_vq.host_dma);
        pr_debug("%s rep_vq va %p dma %llx\n", __func__, q1_pages,
                 (unsigned long long) c2dev->rep_vq.host_dma);
        c2_mq_rep_init(&c2dev->rep_vq,
@@ -545,7 +545,7 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev)
                err = -ENOMEM;
                goto bail2;
        }
-       pci_unmap_addr_set(&c2dev->aeq, mapping, c2dev->aeq.host_dma);
+       dma_unmap_addr_set(&c2dev->aeq, mapping, c2dev->aeq.host_dma);
        pr_debug("%s aeq va %p dma %llx\n", __func__, q2_pages,
                 (unsigned long long) c2dev->aeq.host_dma);
        c2_mq_rep_init(&c2dev->aeq,
@@ -596,11 +596,11 @@ int __devinit c2_rnic_init(struct c2_dev *c2dev)
       bail3:
        dma_free_coherent(&c2dev->pcidev->dev,
                          c2dev->aeq.q_size * c2dev->aeq.msg_size,
-                         q2_pages, pci_unmap_addr(&c2dev->aeq, mapping));
+                         q2_pages, dma_unmap_addr(&c2dev->aeq, mapping));
       bail2:
        dma_free_coherent(&c2dev->pcidev->dev,
                          c2dev->rep_vq.q_size * c2dev->rep_vq.msg_size,
-                         q1_pages, pci_unmap_addr(&c2dev->rep_vq, mapping));
+                         q1_pages, dma_unmap_addr(&c2dev->rep_vq, mapping));
       bail1:
        c2_free_mqsp_pool(c2dev, c2dev->kern_mqsp_pool);
       bail0:
@@ -637,13 +637,13 @@ void __devexit c2_rnic_term(struct c2_dev *c2dev)
        dma_free_coherent(&c2dev->pcidev->dev,
                          c2dev->aeq.q_size * c2dev->aeq.msg_size,
                          c2dev->aeq.msg_pool.host,
-                         pci_unmap_addr(&c2dev->aeq, mapping));
+                         dma_unmap_addr(&c2dev->aeq, mapping));
 
        /* Free the verbs reply queue */
        dma_free_coherent(&c2dev->pcidev->dev,
                          c2dev->rep_vq.q_size * c2dev->rep_vq.msg_size,
                          c2dev->rep_vq.msg_pool.host,
-                         pci_unmap_addr(&c2dev->rep_vq, mapping));
+                         dma_unmap_addr(&c2dev->rep_vq, mapping));
 
        /* Free the MQ shared pointer pool */
        c2_free_mqsp_pool(c2dev, c2dev->kern_mqsp_pool);