aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma')
-rw-r--r--include/rdma/ib_umem.h4
-rw-r--r--include/rdma/ib_verbs.h33
2 files changed, 35 insertions, 2 deletions
diff --git a/include/rdma/ib_umem.h b/include/rdma/ib_umem.h
index 22298423cf0b..9ee0d2e51b16 100644
--- a/include/rdma/ib_umem.h
+++ b/include/rdma/ib_umem.h
@@ -62,7 +62,7 @@ struct ib_umem_chunk {
62#ifdef CONFIG_INFINIBAND_USER_MEM 62#ifdef CONFIG_INFINIBAND_USER_MEM
63 63
64struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr, 64struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
65 size_t size, int access); 65 size_t size, int access, int dmasync);
66void ib_umem_release(struct ib_umem *umem); 66void ib_umem_release(struct ib_umem *umem);
67int ib_umem_page_count(struct ib_umem *umem); 67int ib_umem_page_count(struct ib_umem *umem);
68 68
@@ -72,7 +72,7 @@ int ib_umem_page_count(struct ib_umem *umem);
72 72
73static inline struct ib_umem *ib_umem_get(struct ib_ucontext *context, 73static inline struct ib_umem *ib_umem_get(struct ib_ucontext *context,
74 unsigned long addr, size_t size, 74 unsigned long addr, size_t size,
75 int access) { 75 int access, int dmasync) {
76 return ERR_PTR(-EINVAL); 76 return ERR_PTR(-EINVAL);
77} 77}
78static inline void ib_umem_release(struct ib_umem *umem) { } 78static inline void ib_umem_release(struct ib_umem *umem) { }
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 2dcbecce3f61..911a661b7278 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1542,6 +1542,24 @@ static inline void ib_dma_unmap_single(struct ib_device *dev,
1542 dma_unmap_single(dev->dma_device, addr, size, direction); 1542 dma_unmap_single(dev->dma_device, addr, size, direction);
1543} 1543}
1544 1544
1545static inline u64 ib_dma_map_single_attrs(struct ib_device *dev,
1546 void *cpu_addr, size_t size,
1547 enum dma_data_direction direction,
1548 struct dma_attrs *attrs)
1549{
1550 return dma_map_single_attrs(dev->dma_device, cpu_addr, size,
1551 direction, attrs);
1552}
1553
1554static inline void ib_dma_unmap_single_attrs(struct ib_device *dev,
1555 u64 addr, size_t size,
1556 enum dma_data_direction direction,
1557 struct dma_attrs *attrs)
1558{
1559 return dma_unmap_single_attrs(dev->dma_device, addr, size,
1560 direction, attrs);
1561}
1562
1545/** 1563/**
1546 * ib_dma_map_page - Map a physical page to DMA address 1564 * ib_dma_map_page - Map a physical page to DMA address
1547 * @dev: The device for which the dma_addr is to be created 1565 * @dev: The device for which the dma_addr is to be created
@@ -1611,6 +1629,21 @@ static inline void ib_dma_unmap_sg(struct ib_device *dev,
1611 dma_unmap_sg(dev->dma_device, sg, nents, direction); 1629 dma_unmap_sg(dev->dma_device, sg, nents, direction);
1612} 1630}
1613 1631
1632static inline int ib_dma_map_sg_attrs(struct ib_device *dev,
1633 struct scatterlist *sg, int nents,
1634 enum dma_data_direction direction,
1635 struct dma_attrs *attrs)
1636{
1637 return dma_map_sg_attrs(dev->dma_device, sg, nents, direction, attrs);
1638}
1639
1640static inline void ib_dma_unmap_sg_attrs(struct ib_device *dev,
1641 struct scatterlist *sg, int nents,
1642 enum dma_data_direction direction,
1643 struct dma_attrs *attrs)
1644{
1645 dma_unmap_sg_attrs(dev->dma_device, sg, nents, direction, attrs);
1646}
1614/** 1647/**
1615 * ib_sg_dma_address - Return the DMA address from a scatter/gather entry 1648 * ib_sg_dma_address - Return the DMA address from a scatter/gather entry
1616 * @dev: The device for which the DMA addresses were created 1649 * @dev: The device for which the DMA addresses were created