summaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/vfio_ccw_cp.h
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2017-03-31 13:01:46 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-03-31 13:01:46 +0200
commit6fb81d69d0bb455e6dbb5bd99529e2dea74b93e7 (patch)
tree50ec4711bfb152cf463616b5789f42858409c5ad /drivers/s390/cio/vfio_ccw_cp.h
parent485527ba578254bb1171b13c55394257fd63cd59 (diff)
parent1877888d0ad21858693d8a5594734b125a068638 (diff)
downloadop-kernel-dev-6fb81d69d0bb455e6dbb5bd99529e2dea74b93e7.zip
op-kernel-dev-6fb81d69d0bb455e6dbb5bd99529e2dea74b93e7.tar.gz
Merge branch 'vfio-ccw-for-martin' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/vfio-ccw into features
Pull vfio-ccw branch to add the basic channel I/O passthrough intrastructure based on vfio. The focus is on supporting dasd-eckd(cu_type/dev_type = 0x3990/0x3390) as the target device. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/vfio_ccw_cp.h')
-rw-r--r--drivers/s390/cio/vfio_ccw_cp.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/s390/cio/vfio_ccw_cp.h b/drivers/s390/cio/vfio_ccw_cp.h
new file mode 100644
index 0000000..7a1996b
--- /dev/null
+++ b/drivers/s390/cio/vfio_ccw_cp.h
@@ -0,0 +1,42 @@
+/*
+ * channel program interfaces
+ *
+ * Copyright IBM Corp. 2017
+ *
+ * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
+ * Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
+ */
+
+#ifndef _VFIO_CCW_CP_H_
+#define _VFIO_CCW_CP_H_
+
+#include <asm/cio.h>
+#include <asm/scsw.h>
+
+#include "orb.h"
+
+/**
+ * struct channel_program - manage information for channel program
+ * @ccwchain_list: list head of ccwchains
+ * @orb: orb for the currently processed ssch request
+ * @mdev: the mediated device to perform page pinning/unpinning
+ *
+ * @ccwchain_list is the head of a ccwchain list, that contents the
+ * translated result of the guest channel program that pointed out by
+ * the iova parameter when calling cp_init.
+ */
+struct channel_program {
+ struct list_head ccwchain_list;
+ union orb orb;
+ struct device *mdev;
+};
+
+extern int cp_init(struct channel_program *cp, struct device *mdev,
+ union orb *orb);
+extern void cp_free(struct channel_program *cp);
+extern int cp_prefetch(struct channel_program *cp);
+extern union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm);
+extern void cp_update_scsw(struct channel_program *cp, union scsw *scsw);
+extern bool cp_iova_pinned(struct channel_program *cp, u64 iova);
+
+#endif
OpenPOWER on IntegriCloud