aboutsummaryrefslogtreecommitdiff
path: root/hw/net/opencores_eth.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-03-05 18:56:49 +0100
committerJason Wang <jasowang@redhat.com>2020-03-31 21:14:35 +0800
commitb8c4b67e3ec3918a40234e5c56221f780c7856fc (patch)
tree1ca475ca3fe280e0f857cfe1160b52753b53bd72 /hw/net/opencores_eth.c
parent3317db743972f665e2753c75703538d51241350a (diff)
hw/net: Make NetCanReceive() return a boolean
The NetCanReceive handler return whether the device can or can not receive new packets. Make it obvious by returning a boolean type. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Jason Wang <jasowang@redhat.com>
Diffstat (limited to 'hw/net/opencores_eth.c')
-rw-r--r--hw/net/opencores_eth.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/net/opencores_eth.c b/hw/net/opencores_eth.c
index 6b338c2f29..2ba0dc8c2f 100644
--- a/hw/net/opencores_eth.c
+++ b/hw/net/opencores_eth.c
@@ -349,12 +349,11 @@ static void open_eth_reset(void *opaque)
open_eth_set_link_status(qemu_get_queue(s->nic));
}
-static int open_eth_can_receive(NetClientState *nc)
+static bool open_eth_can_receive(NetClientState *nc)
{
OpenEthState *s = qemu_get_nic_opaque(nc);
- return GET_REGBIT(s, MODER, RXEN) &&
- (s->regs[TX_BD_NUM] < 0x80);
+ return GET_REGBIT(s, MODER, RXEN) && (s->regs[TX_BD_NUM] < 0x80);
}
static ssize_t open_eth_receive(NetClientState *nc,