xref: /openbmc/qemu/include/hw/s390x/s390-ccw.h (revision b14df228)
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 #include "qom/object.h"
18 
19 #define TYPE_S390_CCW "s390-ccw"
20 typedef struct S390CCWDevice S390CCWDevice;
21 typedef struct S390CCWDeviceClass S390CCWDeviceClass;
22 DECLARE_OBJ_CHECKERS(S390CCWDevice, S390CCWDeviceClass,
23                      S390_CCW_DEVICE, TYPE_S390_CCW)
24 
25 struct S390CCWDevice {
26     CcwDevice parent_obj;
27     CssDevId hostid;
28     char *mdevid;
29     int32_t bootindex;
30 };
31 
32 struct S390CCWDeviceClass {
33     CCWDeviceClass parent_class;
34     void (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp);
35     void (*unrealize)(S390CCWDevice *dev);
36     IOInstEnding (*handle_request) (SubchDev *sch);
37     int (*handle_halt) (SubchDev *sch);
38     int (*handle_clear) (SubchDev *sch);
39     IOInstEnding (*handle_store) (SubchDev *sch);
40 };
41 
42 #endif
43