xref: /openbmc/qemu/include/hw/s390x/s390-ccw.h (revision 520e210c)
1 /*
2  * s390 CCW Assignment Support
3  *
4  * Copyright 2017 IBM Corp.
5  * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
6  *            Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
7  *
8  * This work is licensed under the terms of the GNU GPL, version 2 or (at
9  * your option) any later version. See the COPYING file in the top-level
10  * directory.
11  */
12 
13 #ifndef HW_S390_CCW_H
14 #define HW_S390_CCW_H
15 
16 #include "hw/s390x/ccw-device.h"
17 
18 #define TYPE_S390_CCW "s390-ccw"
19 #define S390_CCW_DEVICE(obj) \
20     OBJECT_CHECK(S390CCWDevice, (obj), TYPE_S390_CCW)
21 #define S390_CCW_DEVICE_CLASS(klass) \
22     OBJECT_CLASS_CHECK(S390CCWDeviceClass, (klass), TYPE_S390_CCW)
23 #define S390_CCW_DEVICE_GET_CLASS(obj) \
24     OBJECT_GET_CLASS(S390CCWDeviceClass, (obj), TYPE_S390_CCW)
25 
26 typedef struct S390CCWDevice {
27     CcwDevice parent_obj;
28     CssDevId hostid;
29     char *mdevid;
30 } S390CCWDevice;
31 
32 typedef struct S390CCWDeviceClass {
33     CCWDeviceClass parent_class;
34     void (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp);
35     void (*unrealize)(S390CCWDevice *dev, Error **errp);
36     IOInstEnding (*handle_request) (SubchDev *sch);
37 } S390CCWDeviceClass;
38 
39 #endif
40