xref: /qemu/include/hw/vfio/vfio-calxeda-xgmac.h (revision bfa3ab61)
1 /*
2  * VFIO calxeda xgmac device
3  *
4  * Copyright Linaro Limited, 2014
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 
14 #ifndef HW_VFIO_VFIO_CALXEDA_XGMAC_H
15 #define HW_VFIO_VFIO_CALXEDA_XGMAC_H
16 
17 #include "hw/vfio/vfio-platform.h"
18 
19 #define TYPE_VFIO_CALXEDA_XGMAC "vfio-calxeda-xgmac"
20 
21 /**
22  * This device exposes:
23  * - a single MMIO region corresponding to its register space
24  * - 3 IRQS (main and 2 power related IRQs)
25  */
26 typedef struct VFIOCalxedaXgmacDevice {
27     VFIOPlatformDevice vdev;
28 } VFIOCalxedaXgmacDevice;
29 
30 typedef struct VFIOCalxedaXgmacDeviceClass {
31     /*< private >*/
32     VFIOPlatformDeviceClass parent_class;
33     /*< public >*/
34     DeviceRealize parent_realize;
35 } VFIOCalxedaXgmacDeviceClass;
36 
37 #define VFIO_CALXEDA_XGMAC_DEVICE(obj) \
38      OBJECT_CHECK(VFIOCalxedaXgmacDevice, (obj), TYPE_VFIO_CALXEDA_XGMAC)
39 #define VFIO_CALXEDA_XGMAC_DEVICE_CLASS(klass) \
40      OBJECT_CLASS_CHECK(VFIOCalxedaXgmacDeviceClass, (klass), \
41                         TYPE_VFIO_CALXEDA_XGMAC)
42 #define VFIO_CALXEDA_XGMAC_DEVICE_GET_CLASS(obj) \
43      OBJECT_GET_CLASS(VFIOCalxedaXgmacDeviceClass, (obj), \
44                       TYPE_VFIO_CALXEDA_XGMAC)
45 
46 #endif
47