]> Git Repo - qemu.git/blame - hw/s390x/ccw-device.h
Move QOM typedefs and add missing includes
[qemu.git] / hw / s390x / ccw-device.h
CommitLineData
b804e8a6
JL
1/*
2 * Common device infrastructure for devices in the virtual css
3 *
4 * Copyright 2016 IBM Corp.
5 * Author(s): Jing Liu <[email protected]>
6 *
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
9 * directory.
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
db1015e9 18struct CcwDevice {
b804e8a6
JL
19 DeviceState parent_obj;
20 SubchDev *sch;
21 /* <cssid>.<ssid>.<device number> */
d8d98db5 22 /* The user-set busid of the virtual ccw device. */
2a78ac66 23 CssDevId devno;
d8d98db5
DJS
24 /* The actual busid of the virtual ccw device. */
25 CssDevId dev_id;
26 /* The actual busid of the virtual subchannel. */
27 CssDevId subch_id;
db1015e9
EH
28};
29typedef struct CcwDevice CcwDevice;
b804e8a6 30
517ff12c
HP
31extern const VMStateDescription vmstate_ccw_dev;
32#define VMSTATE_CCW_DEVICE(_field, _state) \
33 VMSTATE_STRUCT(_field, _state, 1, vmstate_ccw_dev, CcwDevice)
34
db1015e9 35struct CCWDeviceClass {
b804e8a6
JL
36 DeviceClass parent_class;
37 void (*unplug)(HotplugHandler *, DeviceState *, Error **);
d8d98db5
DJS
38 void (*realize)(CcwDevice *, Error **);
39 void (*refill_ids)(CcwDevice *);
db1015e9
EH
40};
41typedef struct CCWDeviceClass CCWDeviceClass;
b804e8a6
JL
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
50#define CCW_DEVICE(obj) OBJECT_CHECK(CcwDevice, (obj), TYPE_CCW_DEVICE)
51#define CCW_DEVICE_GET_CLASS(obj) \
52 OBJECT_GET_CLASS(CCWDeviceClass, (obj), TYPE_CCW_DEVICE)
53#define CCW_DEVICE_CLASS(klass) \
54 OBJECT_CLASS_CHECK(CCWDeviceClass, (klass), TYPE_CCW_DEVICE)
55
56#endif
This page took 0.197405 seconds and 4 git commands to generate.