[v5,05/14] bus/vmbus: handle mapping of device resources
Checks
Commit Message
All resource values are published by HV_UIO driver as sysctl key
value pairs and they are read at a later point of the code flow
Signed-off-by: Srikanth Kaka <srikanth.k@oneconvergence.com>
Signed-off-by: Vag Singh <vag.singh@oneconvergence.com>
Signed-off-by: Anand Thulasiram <avelu@juniper.net>
---
drivers/bus/vmbus/freebsd/vmbus_bus.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
@@ -28,6 +28,24 @@
return 0;
}
+/* map the resources of a vmbus device in virtual memory */
+int
+rte_vmbus_map_device(struct rte_vmbus_device *dev)
+{
+ if (dev->uio_num < 0) {
+ VMBUS_LOG(DEBUG, "Not managed by UIO driver, skipped");
+ return 1;
+ }
+
+ return vmbus_uio_map_resource(dev);
+}
+
+void
+rte_vmbus_unmap_device(struct rte_vmbus_device *dev)
+{
+ vmbus_uio_unmap_resource(dev);
+}
+
/* Scan one vmbus entry, and fill the devices list from it. */
static int
vmbus_scan_one(const char *name, unsigned int unit_num)