amd-xgbe.c 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * AMD XGBE VFIO device
  3. *
  4. * Copyright Linaro Limited, 2015
  5. *
  6. * Authors:
  7. * Eric Auger <eric.auger@linaro.org>
  8. *
  9. * This work is licensed under the terms of the GNU GPL, version 2. See
  10. * the COPYING file in the top-level directory.
  11. *
  12. */
  13. #include "qemu/osdep.h"
  14. #include "hw/vfio/vfio-amd-xgbe.h"
  15. #include "migration/vmstate.h"
  16. #include "qemu/module.h"
  17. #include "qemu/error-report.h"
  18. static void amd_xgbe_realize(DeviceState *dev, Error **errp)
  19. {
  20. VFIOPlatformDevice *vdev = VFIO_PLATFORM_DEVICE(dev);
  21. VFIOAmdXgbeDeviceClass *k = VFIO_AMD_XGBE_DEVICE_GET_CLASS(dev);
  22. warn_report("-device vfio-amd-xgbe is deprecated");
  23. vdev->compat = g_strdup("amd,xgbe-seattle-v1a");
  24. vdev->num_compat = 1;
  25. k->parent_realize(dev, errp);
  26. }
  27. static const VMStateDescription vfio_platform_amd_xgbe_vmstate = {
  28. .name = "vfio-amd-xgbe",
  29. .unmigratable = 1,
  30. };
  31. static void vfio_amd_xgbe_class_init(ObjectClass *klass, void *data)
  32. {
  33. DeviceClass *dc = DEVICE_CLASS(klass);
  34. VFIOAmdXgbeDeviceClass *vcxc =
  35. VFIO_AMD_XGBE_DEVICE_CLASS(klass);
  36. device_class_set_parent_realize(dc, amd_xgbe_realize,
  37. &vcxc->parent_realize);
  38. dc->desc = "VFIO AMD XGBE";
  39. dc->vmsd = &vfio_platform_amd_xgbe_vmstate;
  40. }
  41. static const TypeInfo vfio_amd_xgbe_dev_info = {
  42. .name = TYPE_VFIO_AMD_XGBE,
  43. .parent = TYPE_VFIO_PLATFORM,
  44. .instance_size = sizeof(VFIOAmdXgbeDevice),
  45. .class_init = vfio_amd_xgbe_class_init,
  46. .class_size = sizeof(VFIOAmdXgbeDeviceClass),
  47. };
  48. static void register_amd_xgbe_dev_type(void)
  49. {
  50. type_register_static(&vfio_amd_xgbe_dev_info);
  51. }
  52. type_init(register_amd_xgbe_dev_type)