Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / s390 / cio / vfio_ccw_cp.h
blobba31240ce96594ef9e21c3fd1d5c731b791b6898
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * channel program interfaces
5 * Copyright IBM Corp. 2017
7 * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
8 * Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
9 */
11 #ifndef _VFIO_CCW_CP_H_
12 #define _VFIO_CCW_CP_H_
14 #include <asm/cio.h>
15 #include <asm/scsw.h>
17 #include "orb.h"
18 #include "vfio_ccw_trace.h"
21 * Max length for ccw chain.
22 * XXX: Limit to 256, need to check more?
24 #define CCWCHAIN_LEN_MAX 256
26 /**
27 * struct channel_program - manage information for channel program
28 * @ccwchain_list: list head of ccwchains
29 * @orb: orb for the currently processed ssch request
30 * @mdev: the mediated device to perform page pinning/unpinning
31 * @initialized: whether this instance is actually initialized
33 * @ccwchain_list is the head of a ccwchain list, that contents the
34 * translated result of the guest channel program that pointed out by
35 * the iova parameter when calling cp_init.
37 struct channel_program {
38 struct list_head ccwchain_list;
39 union orb orb;
40 struct device *mdev;
41 bool initialized;
42 struct ccw1 *guest_cp;
45 extern int cp_init(struct channel_program *cp, struct device *mdev,
46 union orb *orb);
47 extern void cp_free(struct channel_program *cp);
48 extern int cp_prefetch(struct channel_program *cp);
49 extern union orb *cp_get_orb(struct channel_program *cp, u32 intparm, u8 lpm);
50 extern void cp_update_scsw(struct channel_program *cp, union scsw *scsw);
51 extern bool cp_iova_pinned(struct channel_program *cp, u64 iova);
53 #endif