1
2
3
4
5
6
7
8
9
10
11
12#ifndef HW_S390X_CCW_DEVICE_H
13#define HW_S390X_CCW_DEVICE_H
14#include "qom/object.h"
15#include "hw/qdev-core.h"
16#include "hw/s390x/css.h"
17#include "hw/s390x/css-bridge.h"
18
19struct CcwDevice {
20 DeviceState parent_obj;
21 SubchDev *sch;
22
23
24 CssDevId devno;
25
26 CssDevId dev_id;
27
28 CssDevId subch_id;
29};
30typedef struct CcwDevice CcwDevice;
31
32extern const VMStateDescription vmstate_ccw_dev;
33#define VMSTATE_CCW_DEVICE(_field, _state) \
34 VMSTATE_STRUCT(_field, _state, 1, vmstate_ccw_dev, CcwDevice)
35
36struct CCWDeviceClass {
37 DeviceClass parent_class;
38 void (*unplug)(HotplugHandler *, DeviceState *, Error **);
39 void (*realize)(CcwDevice *, Error **);
40 void (*refill_ids)(CcwDevice *);
41};
42
43static inline CcwDevice *to_ccw_dev_fast(DeviceState *d)
44{
45 return container_of(d, CcwDevice, parent_obj);
46}
47
48#define TYPE_CCW_DEVICE "ccw-device"
49
50OBJECT_DECLARE_TYPE(CcwDevice, CCWDeviceClass, CCW_DEVICE)
51
52#endif
53