summaryrefslogtreecommitdiffstats
path: root/include/hw/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/hw/net')
-rw-r--r--include/hw/net/allwinner-sun8i-emac.h9
-rw-r--r--include/hw/net/allwinner_emac.h9
-rw-r--r--include/hw/net/cadence_gem.h9
-rw-r--r--include/hw/net/ftgmac100.h17
-rw-r--r--include/hw/net/imx_fec.h9
-rw-r--r--include/hw/net/lance.h10
-rw-r--r--include/hw/net/lasi_82596.h10
-rw-r--r--include/hw/net/msf2-emac.h10
8 files changed, 52 insertions, 31 deletions
diff --git a/include/hw/net/allwinner-sun8i-emac.h b/include/hw/net/allwinner-sun8i-emac.h
index dd1d7b96cd..89e56b815b 100644
--- a/include/hw/net/allwinner-sun8i-emac.h
+++ b/include/hw/net/allwinner-sun8i-emac.h
@@ -30,15 +30,16 @@
*/
#define TYPE_AW_SUN8I_EMAC "allwinner-sun8i-emac"
-#define AW_SUN8I_EMAC(obj) \
- OBJECT_CHECK(AwSun8iEmacState, (obj), TYPE_AW_SUN8I_EMAC)
+typedef struct AwSun8iEmacState AwSun8iEmacState;
+DECLARE_INSTANCE_CHECKER(AwSun8iEmacState, AW_SUN8I_EMAC,
+ TYPE_AW_SUN8I_EMAC)
/** @} */
/**
* Allwinner Sun8i EMAC object instance state
*/
-typedef struct AwSun8iEmacState {
+struct AwSun8iEmacState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
@@ -100,6 +101,6 @@ typedef struct AwSun8iEmacState {
/** @} */
-} AwSun8iEmacState;
+};
#endif /* HW_NET_ALLWINNER_SUN8I_H */
diff --git a/include/hw/net/allwinner_emac.h b/include/hw/net/allwinner_emac.h
index 5013207d15..f5f5b67939 100644
--- a/include/hw/net/allwinner_emac.h
+++ b/include/hw/net/allwinner_emac.h
@@ -28,9 +28,12 @@
#include "qemu/fifo8.h"
#include "hw/net/mii.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
#define TYPE_AW_EMAC "allwinner-emac"
-#define AW_EMAC(obj) OBJECT_CHECK(AwEmacState, (obj), TYPE_AW_EMAC)
+typedef struct AwEmacState AwEmacState;
+DECLARE_INSTANCE_CHECKER(AwEmacState, AW_EMAC,
+ TYPE_AW_EMAC)
/*
* Allwinner EMAC register list
@@ -144,7 +147,7 @@ typedef struct RTL8201CPState {
uint16_t anlpar;
} RTL8201CPState;
-typedef struct AwEmacState {
+struct AwEmacState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
@@ -171,6 +174,6 @@ typedef struct AwEmacState {
Fifo8 tx_fifo[NUM_TX_FIFOS];
uint32_t tx_length[NUM_TX_FIFOS];
uint32_t tx_channel;
-} AwEmacState;
+};
#endif
diff --git a/include/hw/net/cadence_gem.h b/include/hw/net/cadence_gem.h
index 54e646ff79..dff1083738 100644
--- a/include/hw/net/cadence_gem.h
+++ b/include/hw/net/cadence_gem.h
@@ -24,9 +24,12 @@
#ifndef CADENCE_GEM_H
#define CADENCE_GEM_H
+#include "qom/object.h"
#define TYPE_CADENCE_GEM "cadence_gem"
-#define CADENCE_GEM(obj) OBJECT_CHECK(CadenceGEMState, (obj), TYPE_CADENCE_GEM)
+typedef struct CadenceGEMState CadenceGEMState;
+DECLARE_INSTANCE_CHECKER(CadenceGEMState, CADENCE_GEM,
+ TYPE_CADENCE_GEM)
#include "net/net.h"
#include "hw/sysbus.h"
@@ -43,7 +46,7 @@
#define MAX_JUMBO_FRAME_SIZE_MASK 0x3FFF
#define MAX_FRAME_SIZE MAX_JUMBO_FRAME_SIZE_MASK
-typedef struct CadenceGEMState {
+struct CadenceGEMState {
/*< private >*/
SysBusDevice parent_obj;
@@ -89,6 +92,6 @@ typedef struct CadenceGEMState {
uint32_t rx_desc[MAX_PRIORITY_QUEUES][DESC_MAX_NUM_WORDS];
bool sar_active[4];
-} CadenceGEMState;
+};
#endif
diff --git a/include/hw/net/ftgmac100.h b/include/hw/net/ftgmac100.h
index ab37e7b2b8..c6b1c11fca 100644
--- a/include/hw/net/ftgmac100.h
+++ b/include/hw/net/ftgmac100.h
@@ -9,9 +9,12 @@
#ifndef FTGMAC100_H
#define FTGMAC100_H
+#include "qom/object.h"
#define TYPE_FTGMAC100 "ftgmac100"
-#define FTGMAC100(obj) OBJECT_CHECK(FTGMAC100State, (obj), TYPE_FTGMAC100)
+typedef struct FTGMAC100State FTGMAC100State;
+DECLARE_INSTANCE_CHECKER(FTGMAC100State, FTGMAC100,
+ TYPE_FTGMAC100)
#include "hw/sysbus.h"
#include "net/net.h"
@@ -21,7 +24,7 @@
*/
#define FTGMAC100_MAX_FRAME_SIZE 9220
-typedef struct FTGMAC100State {
+struct FTGMAC100State {
/*< private >*/
SysBusDevice parent_obj;
@@ -64,15 +67,17 @@ typedef struct FTGMAC100State {
bool aspeed;
uint32_t txdes0_edotr;
uint32_t rxdes0_edorr;
-} FTGMAC100State;
+};
#define TYPE_ASPEED_MII "aspeed-mmi"
-#define ASPEED_MII(obj) OBJECT_CHECK(AspeedMiiState, (obj), TYPE_ASPEED_MII)
+typedef struct AspeedMiiState AspeedMiiState;
+DECLARE_INSTANCE_CHECKER(AspeedMiiState, ASPEED_MII,
+ TYPE_ASPEED_MII)
/*
* AST2600 MII controller
*/
-typedef struct AspeedMiiState {
+struct AspeedMiiState {
/*< private >*/
SysBusDevice parent_obj;
@@ -81,6 +86,6 @@ typedef struct AspeedMiiState {
MemoryRegion iomem;
uint32_t phycr;
uint32_t phydata;
-} AspeedMiiState;
+};
#endif
diff --git a/include/hw/net/imx_fec.h b/include/hw/net/imx_fec.h
index 9f03034b89..ffdbc304b6 100644
--- a/include/hw/net/imx_fec.h
+++ b/include/hw/net/imx_fec.h
@@ -23,9 +23,12 @@
#ifndef IMX_FEC_H
#define IMX_FEC_H
+#include "qom/object.h"
#define TYPE_IMX_FEC "imx.fec"
-#define IMX_FEC(obj) OBJECT_CHECK(IMXFECState, (obj), TYPE_IMX_FEC)
+typedef struct IMXFECState IMXFECState;
+DECLARE_INSTANCE_CHECKER(IMXFECState, IMX_FEC,
+ TYPE_IMX_FEC)
#define TYPE_IMX_ENET "imx.enet"
@@ -247,7 +250,7 @@ typedef struct {
#define FSL_IMX25_FEC_SIZE 0x4000
-typedef struct IMXFECState {
+struct IMXFECState {
/*< private >*/
SysBusDevice parent_obj;
@@ -274,6 +277,6 @@ typedef struct IMXFECState {
/* Buffer used to assemble a Tx frame */
uint8_t frame[ENET_MAX_FRAME_SIZE];
-} IMXFECState;
+};
#endif
diff --git a/include/hw/net/lance.h b/include/hw/net/lance.h
index 0357f5f65c..f645d6af67 100644
--- a/include/hw/net/lance.h
+++ b/include/hw/net/lance.h
@@ -32,15 +32,17 @@
#include "net/net.h"
#include "hw/net/pcnet.h"
#include "hw/sysbus.h"
+#include "qom/object.h"
#define TYPE_LANCE "lance"
-#define SYSBUS_PCNET(obj) \
- OBJECT_CHECK(SysBusPCNetState, (obj), TYPE_LANCE)
+typedef struct SysBusPCNetState SysBusPCNetState;
+DECLARE_INSTANCE_CHECKER(SysBusPCNetState, SYSBUS_PCNET,
+ TYPE_LANCE)
-typedef struct {
+struct SysBusPCNetState {
SysBusDevice parent_obj;
PCNetState state;
-} SysBusPCNetState;
+};
#endif
diff --git a/include/hw/net/lasi_82596.h b/include/hw/net/lasi_82596.h
index e76ef8308e..7b62b04833 100644
--- a/include/hw/net/lasi_82596.h
+++ b/include/hw/net/lasi_82596.h
@@ -10,18 +10,20 @@
#include "net/net.h"
#include "hw/net/i82596.h"
+#include "qom/object.h"
#define TYPE_LASI_82596 "lasi_82596"
-#define SYSBUS_I82596(obj) \
- OBJECT_CHECK(SysBusI82596State, (obj), TYPE_LASI_82596)
+typedef struct SysBusI82596State SysBusI82596State;
+DECLARE_INSTANCE_CHECKER(SysBusI82596State, SYSBUS_I82596,
+ TYPE_LASI_82596)
-typedef struct {
+struct SysBusI82596State {
SysBusDevice parent_obj;
I82596State state;
uint16_t last_val;
int val_index:1;
-} SysBusI82596State;
+};
SysBusI82596State *lasi_82596_init(MemoryRegion *addr_space,
hwaddr hpa, qemu_irq irq);
diff --git a/include/hw/net/msf2-emac.h b/include/hw/net/msf2-emac.h
index 37966d3a81..68194d798c 100644
--- a/include/hw/net/msf2-emac.h
+++ b/include/hw/net/msf2-emac.h
@@ -26,15 +26,17 @@
#include "exec/memory.h"
#include "net/net.h"
#include "net/eth.h"
+#include "qom/object.h"
#define TYPE_MSS_EMAC "msf2-emac"
-#define MSS_EMAC(obj) \
- OBJECT_CHECK(MSF2EmacState, (obj), TYPE_MSS_EMAC)
+typedef struct MSF2EmacState MSF2EmacState;
+DECLARE_INSTANCE_CHECKER(MSF2EmacState, MSS_EMAC,
+ TYPE_MSS_EMAC)
#define R_MAX (0x1a0 / 4)
#define PHY_MAX_REGS 32
-typedef struct MSF2EmacState {
+struct MSF2EmacState {
SysBusDevice parent;
MemoryRegion mmio;
@@ -50,4 +52,4 @@ typedef struct MSF2EmacState {
uint16_t phy_regs[PHY_MAX_REGS];
uint32_t regs[R_MAX];
-} MSF2EmacState;
+};