summaryrefslogtreecommitdiffstats
path: root/hw/net/ftgmac100.c
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-03-05 18:56:49 +0100
committerJason Wang2020-03-31 15:14:35 +0200
commitb8c4b67e3ec3918a40234e5c56221f780c7856fc (patch)
tree1ca475ca3fe280e0f857cfe1160b52753b53bd72 /hw/net/ftgmac100.c
parenthw/net/rtl8139: Update coding style to make checkpatch.pl happy (diff)
downloadqemu-b8c4b67e3ec3918a40234e5c56221f780c7856fc.tar.gz
qemu-b8c4b67e3ec3918a40234e5c56221f780c7856fc.tar.xz
qemu-b8c4b67e3ec3918a40234e5c56221f780c7856fc.zip
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/ftgmac100.c')
-rw-r--r--hw/net/ftgmac100.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/net/ftgmac100.c b/hw/net/ftgmac100.c
index 2f92b65d4e..041ed21017 100644
--- a/hw/net/ftgmac100.c
+++ b/hw/net/ftgmac100.c
@@ -562,18 +562,18 @@ static void ftgmac100_do_tx(FTGMAC100State *s, uint32_t tx_ring,
ftgmac100_update_irq(s);
}
-static int ftgmac100_can_receive(NetClientState *nc)
+static bool ftgmac100_can_receive(NetClientState *nc)
{
FTGMAC100State *s = FTGMAC100(qemu_get_nic_opaque(nc));
FTGMAC100Desc bd;
if ((s->maccr & (FTGMAC100_MACCR_RXDMA_EN | FTGMAC100_MACCR_RXMAC_EN))
!= (FTGMAC100_MACCR_RXDMA_EN | FTGMAC100_MACCR_RXMAC_EN)) {
- return 0;
+ return false;
}
if (ftgmac100_read_bd(&bd, s->rx_descriptor)) {
- return 0;
+ return false;
}
return !(bd.des0 & FTGMAC100_RXDES0_RXPKT_RDY);
}