xref: /openbmc/qemu/include/hw/s390x/s390-ccw.h (revision d89b64beea65f77c21a553cb54cb97b75c53dc21)
1a8eac943SDong Jia Shi /*
2a8eac943SDong Jia Shi  * s390 CCW Assignment Support
3a8eac943SDong Jia Shi  *
4a8eac943SDong Jia Shi  * Copyright 2017 IBM Corp.
5a8eac943SDong Jia Shi  * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
6a8eac943SDong Jia Shi  *            Xiao Feng Ren <renxiaof@linux.vnet.ibm.com>
7a8eac943SDong Jia Shi  *
8a8eac943SDong Jia Shi  * This work is licensed under the terms of the GNU GPL, version 2 or (at
9a8eac943SDong Jia Shi  * your option) any later version. See the COPYING file in the top-level
10a8eac943SDong Jia Shi  * directory.
11a8eac943SDong Jia Shi  */
12a8eac943SDong Jia Shi 
13a8eac943SDong Jia Shi #ifndef HW_S390_CCW_H
14a8eac943SDong Jia Shi #define HW_S390_CCW_H
15a8eac943SDong Jia Shi 
16a8eac943SDong Jia Shi #include "hw/s390x/ccw-device.h"
17db1015e9SEduardo Habkost #include "qom/object.h"
18a8eac943SDong Jia Shi 
19a8eac943SDong Jia Shi #define TYPE_S390_CCW "s390-ccw"
20db1015e9SEduardo Habkost typedef struct S390CCWDevice S390CCWDevice;
21db1015e9SEduardo Habkost typedef struct S390CCWDeviceClass S390CCWDeviceClass;
228110fa1dSEduardo Habkost DECLARE_OBJ_CHECKERS(S390CCWDevice, S390CCWDeviceClass,
238110fa1dSEduardo Habkost                      S390_CCW_DEVICE, TYPE_S390_CCW)
24a8eac943SDong Jia Shi 
25db1015e9SEduardo Habkost struct S390CCWDevice {
26a8eac943SDong Jia Shi     CcwDevice parent_obj;
27a8eac943SDong Jia Shi     CssDevId hostid;
28a8eac943SDong Jia Shi     char *mdevid;
2944445d86SJason J. Herne     int32_t bootindex;
30db1015e9SEduardo Habkost };
31a8eac943SDong Jia Shi 
32db1015e9SEduardo Habkost struct S390CCWDeviceClass {
33a8eac943SDong Jia Shi     CCWDeviceClass parent_class;
34*45f42187SCédric Le Goater     bool (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp);
35b69c3c21SMarkus Armbruster     void (*unrealize)(S390CCWDevice *dev);
3666dc50f7SHalil Pasic     IOInstEnding (*handle_request) (SubchDev *sch);
378fadea24SCornelia Huck     int (*handle_halt) (SubchDev *sch);
388fadea24SCornelia Huck     int (*handle_clear) (SubchDev *sch);
3946ea3841SFarhan Ali     IOInstEnding (*handle_store) (SubchDev *sch);
40db1015e9SEduardo Habkost };
41a8eac943SDong Jia Shi 
42a8eac943SDong Jia Shi #endif
43