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 #define S390_CCW_DEVICE(obj) \ 23 OBJECT_CHECK(S390CCWDevice, (obj), TYPE_S390_CCW) 24 #define S390_CCW_DEVICE_CLASS(klass) \ 25 OBJECT_CLASS_CHECK(S390CCWDeviceClass, (klass), TYPE_S390_CCW) 26 #define S390_CCW_DEVICE_GET_CLASS(obj) \ 27 OBJECT_GET_CLASS(S390CCWDeviceClass, (obj), TYPE_S390_CCW) 28 29 struct S390CCWDevice { 30 CcwDevice parent_obj; 31 CssDevId hostid; 32 char *mdevid; 33 int32_t bootindex; 34 }; 35 36 struct S390CCWDeviceClass { 37 CCWDeviceClass parent_class; 38 void (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp); 39 void (*unrealize)(S390CCWDevice *dev); 40 IOInstEnding (*handle_request) (SubchDev *sch); 41 int (*handle_halt) (SubchDev *sch); 42 int (*handle_clear) (SubchDev *sch); 43 IOInstEnding (*handle_store) (SubchDev *sch); 44 }; 45 46 #endif 47