summaryrefslogtreecommitdiff
path: root/hw/opencores_eth.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/opencores_eth.c')
-rw-r--r--hw/opencores_eth.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/opencores_eth.c b/hw/opencores_eth.c
index 2496d4eba1..f9ba5eeaba 100644
--- a/hw/opencores_eth.c
+++ b/hw/opencores_eth.c
@@ -313,7 +313,7 @@ static void open_eth_int_source_write(OpenEthState *s,
static void open_eth_set_link_status(NetClientState *nc)
{
- OpenEthState *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ OpenEthState *s = qemu_get_nic_opaque(nc);
if (GET_REGBIT(s, MIICOMMAND, SCANSTAT)) {
SET_REGFIELD(s, MIISTATUS, LINKFAIL, nc->link_down);
@@ -344,7 +344,7 @@ static void open_eth_reset(void *opaque)
static int open_eth_can_receive(NetClientState *nc)
{
- OpenEthState *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ OpenEthState *s = qemu_get_nic_opaque(nc);
return GET_REGBIT(s, MODER, RXEN) &&
(s->regs[TX_BD_NUM] < 0x80) &&
@@ -354,7 +354,7 @@ static int open_eth_can_receive(NetClientState *nc)
static ssize_t open_eth_receive(NetClientState *nc,
const uint8_t *buf, size_t size)
{
- OpenEthState *s = DO_UPCAST(NICState, nc, nc)->opaque;
+ OpenEthState *s = qemu_get_nic_opaque(nc);
size_t maxfl = GET_REGFIELD(s, PACKETLEN, MAXFL);
size_t minfl = GET_REGFIELD(s, PACKETLEN, MINFL);
size_t fcsl = 4;