4 * Copyright Linaro Limited, 2015
7 * Eric Auger <eric.auger@linaro.org>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
14 #include "qemu/osdep.h"
15 #include "hw/vfio/vfio-amd-xgbe.h"
17 static void amd_xgbe_realize(DeviceState
*dev
, Error
**errp
)
19 VFIOPlatformDevice
*vdev
= VFIO_PLATFORM_DEVICE(dev
);
20 VFIOAmdXgbeDeviceClass
*k
= VFIO_AMD_XGBE_DEVICE_GET_CLASS(dev
);
22 vdev
->compat
= g_strdup("amd,xgbe-seattle-v1a");
24 k
->parent_realize(dev
, errp
);
27 static const VMStateDescription vfio_platform_amd_xgbe_vmstate
= {
28 .name
= TYPE_VFIO_AMD_XGBE
,
32 static void vfio_amd_xgbe_class_init(ObjectClass
*klass
, void *data
)
34 DeviceClass
*dc
= DEVICE_CLASS(klass
);
35 VFIOAmdXgbeDeviceClass
*vcxc
=
36 VFIO_AMD_XGBE_DEVICE_CLASS(klass
);
37 vcxc
->parent_realize
= dc
->realize
;
38 dc
->realize
= amd_xgbe_realize
;
39 dc
->desc
= "VFIO AMD XGBE";
40 dc
->vmsd
= &vfio_platform_amd_xgbe_vmstate
;
43 static const TypeInfo vfio_amd_xgbe_dev_info
= {
44 .name
= TYPE_VFIO_AMD_XGBE
,
45 .parent
= TYPE_VFIO_PLATFORM
,
46 .instance_size
= sizeof(VFIOAmdXgbeDevice
),
47 .class_init
= vfio_amd_xgbe_class_init
,
48 .class_size
= sizeof(VFIOAmdXgbeDeviceClass
),
51 static void register_amd_xgbe_dev_type(void)
53 type_register_static(&vfio_amd_xgbe_dev_info
);
56 type_init(register_amd_xgbe_dev_type
)