IB/rdmavt: Consolidate dma ops in rdmavt.

This patch adds dma functions to rdmavt. The source is hfi1's version of
dma.c which will be removed by a subsequent hfi1 patch.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index aa325db..d82fdda 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -69,6 +69,16 @@
 	if (!rdi)
 		return -EINVAL;
 
+	/*
+	 * Drivers have the option to override anything in the ibdev that they
+	 * want to specifically handle. VT needs to check for things it supports
+	 * and if the driver wants to handle that functionality let it. We may
+	 * come up with a better mechanism that simplifies the code at some
+	 * point.
+	 */
+	rdi->ibdev.dma_ops =
+		rdi->ibdev.dma_ops ? : &rvt_default_dma_mapping_ops;
+
 	return ib_register_device(&rdi->ibdev, rdi->port_callback);
 }
 EXPORT_SYMBOL(rvt_register_device);