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" 17*db1015e9SEduardo Habkost #include "qom/object.h" 18a8eac943SDong Jia Shi 19a8eac943SDong Jia Shi #define TYPE_S390_CCW "s390-ccw" 20*db1015e9SEduardo Habkost typedef struct S390CCWDevice S390CCWDevice; 21*db1015e9SEduardo Habkost typedef struct S390CCWDeviceClass S390CCWDeviceClass; 22a8eac943SDong Jia Shi #define S390_CCW_DEVICE(obj) \ 23a8eac943SDong Jia Shi OBJECT_CHECK(S390CCWDevice, (obj), TYPE_S390_CCW) 24a8eac943SDong Jia Shi #define S390_CCW_DEVICE_CLASS(klass) \ 25a8eac943SDong Jia Shi OBJECT_CLASS_CHECK(S390CCWDeviceClass, (klass), TYPE_S390_CCW) 26a8eac943SDong Jia Shi #define S390_CCW_DEVICE_GET_CLASS(obj) \ 27a8eac943SDong Jia Shi OBJECT_GET_CLASS(S390CCWDeviceClass, (obj), TYPE_S390_CCW) 28a8eac943SDong Jia Shi 29*db1015e9SEduardo Habkost struct S390CCWDevice { 30a8eac943SDong Jia Shi CcwDevice parent_obj; 31a8eac943SDong Jia Shi CssDevId hostid; 32a8eac943SDong Jia Shi char *mdevid; 3344445d86SJason J. Herne int32_t bootindex; 34*db1015e9SEduardo Habkost }; 35a8eac943SDong Jia Shi 36*db1015e9SEduardo Habkost struct S390CCWDeviceClass { 37a8eac943SDong Jia Shi CCWDeviceClass parent_class; 38a8eac943SDong Jia Shi void (*realize)(S390CCWDevice *dev, char *sysfsdev, Error **errp); 39b69c3c21SMarkus Armbruster void (*unrealize)(S390CCWDevice *dev); 4066dc50f7SHalil Pasic IOInstEnding (*handle_request) (SubchDev *sch); 418fadea24SCornelia Huck int (*handle_halt) (SubchDev *sch); 428fadea24SCornelia Huck int (*handle_clear) (SubchDev *sch); 4346ea3841SFarhan Ali IOInstEnding (*handle_store) (SubchDev *sch); 44*db1015e9SEduardo Habkost }; 45a8eac943SDong Jia Shi 46a8eac943SDong Jia Shi #endif 47