aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_mr.c
diff options
context:
space:
mode:
authorRalph Campbell <ralph.campbell@qlogic.com>2006-12-12 17:28:28 -0500
committerRoland Dreier <rolandd@cisco.com>2006-12-12 17:28:28 -0500
commitf2cbb660ed37294e3eeb98c045de6890079ccb01 (patch)
tree860d7fcf838dd0937d59a420f2018ee6f2f9935e /drivers/infiniband/hw/ipath/ipath_mr.c
parent9b513090a3c5e4964f9ac09016c1586988abb3d5 (diff)
IB/ipath: Implement new verbs DMA mapping functions
This patch implements the interposing DMA mapping functions to allow support for IOMMUs and remove the dependence on phys_to_virt() and bus_to_virt(). Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_mr.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_mr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_mr.c b/drivers/infiniband/hw/ipath/ipath_mr.c
index a0673c1eef71..8cc8598d6c69 100644
--- a/drivers/infiniband/hw/ipath/ipath_mr.c
+++ b/drivers/infiniband/hw/ipath/ipath_mr.c
@@ -54,6 +54,8 @@ static inline struct ipath_fmr *to_ifmr(struct ib_fmr *ibfmr)
54 * @acc: access flags 54 * @acc: access flags
55 * 55 *
56 * Returns the memory region on success, otherwise returns an errno. 56 * Returns the memory region on success, otherwise returns an errno.
57 * Note that all DMA addresses should be created via the
58 * struct ib_dma_mapping_ops functions (see ipath_dma.c).
57 */ 59 */
58struct ib_mr *ipath_get_dma_mr(struct ib_pd *pd, int acc) 60struct ib_mr *ipath_get_dma_mr(struct ib_pd *pd, int acc)
59{ 61{
@@ -149,8 +151,7 @@ struct ib_mr *ipath_reg_phys_mr(struct ib_pd *pd,
149 m = 0; 151 m = 0;
150 n = 0; 152 n = 0;
151 for (i = 0; i < num_phys_buf; i++) { 153 for (i = 0; i < num_phys_buf; i++) {
152 mr->mr.map[m]->segs[n].vaddr = 154 mr->mr.map[m]->segs[n].vaddr = (void *) buffer_list[i].addr;
153 phys_to_virt(buffer_list[i].addr);
154 mr->mr.map[m]->segs[n].length = buffer_list[i].size; 155 mr->mr.map[m]->segs[n].length = buffer_list[i].size;
155 mr->mr.length += buffer_list[i].size; 156 mr->mr.length += buffer_list[i].size;
156 n++; 157 n++;
@@ -347,7 +348,7 @@ int ipath_map_phys_fmr(struct ib_fmr *ibfmr, u64 * page_list,
347 n = 0; 348 n = 0;
348 ps = 1 << fmr->page_shift; 349 ps = 1 << fmr->page_shift;
349 for (i = 0; i < list_len; i++) { 350 for (i = 0; i < list_len; i++) {
350 fmr->mr.map[m]->segs[n].vaddr = phys_to_virt(page_list[i]); 351 fmr->mr.map[m]->segs[n].vaddr = (void *) page_list[i];
351 fmr->mr.map[m]->segs[n].length = ps; 352 fmr->mr.map[m]->segs[n].length = ps;
352 if (++n == IPATH_SEGSZ) { 353 if (++n == IPATH_SEGSZ) {
353 m++; 354 m++;