xref: /openbmc/linux/drivers/s390/cio/vfio_ccw_cp.h (revision 4d2804b7)
1 /*
2  * channel program interfaces
3  *
4  * Copyright IBM Corp. 2017
5  *
6  * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
7  *            Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
8  */
9 
10 #ifndef _VFIO_CCW_CP_H_
11 #define _VFIO_CCW_CP_H_
12 
13 #include <asm/cio.h>
14 #include <asm/scsw.h>
15 
16 #include "orb.h"
17 
18 /**
19  * struct channel_program - manage information for channel program
20  * @ccwchain_list: list head of ccwchains
21  * @orb: orb for the currently processed ssch request
22  * @mdev: the mediated device to perform page pinning/unpinning
23  *
24  * @ccwchain_list is the head of a ccwchain list, that contents the
25  * translated result of the guest channel program that pointed out by
26  * the iova parameter when calling cp_init.
27  */
28 struct channel_program {
29 	struct list_head ccwchain_list;
30 	union orb orb;
31 	struct device *mdev;
32 };
33 
34 extern int cp_init(struct channel_program *cp, struct device *mdev,
35 		   union orb *orb);
36 extern void cp_free(struct channel_program *cp);
37 extern int cp_prefetch(struct channel_program *cp);
38 extern union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm);
39 extern void cp_update_scsw(struct channel_program *cp, union scsw *scsw);
40 extern bool cp_iova_pinned(struct channel_program *cp, u64 iova);
41 
42 #endif
43