diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-03-05 18:56:49 +0100 |
---|---|---|
committer | Jason Wang <jasowang@redhat.com> | 2020-03-31 21:14:35 +0800 |
commit | b8c4b67e3ec3918a40234e5c56221f780c7856fc (patch) | |
tree | 1ca475ca3fe280e0f857cfe1160b52753b53bd72 /hw/net/rtl8139.c | |
parent | 3317db743972f665e2753c75703538d51241350a (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/rtl8139.c')
-rw-r--r-- | hw/net/rtl8139.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index be9a0af629..70aca7ec26 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -793,23 +793,23 @@ static bool rtl8139_cp_rx_valid(RTL8139State *s) return !(s->RxRingAddrLO == 0 && s->RxRingAddrHI == 0); } -static int rtl8139_can_receive(NetClientState *nc) +static bool rtl8139_can_receive(NetClientState *nc) { RTL8139State *s = qemu_get_nic_opaque(nc); int avail; /* Receive (drop) packets if card is disabled. */ if (!s->clock_enabled) { - return 1; + return true; } if (!rtl8139_receiver_enabled(s)) { - return 1; + return true; } if (rtl8139_cp_receiver_enabled(s) && rtl8139_cp_rx_valid(s)) { /* ??? Flow control not implemented in c+ mode. This is a hack to work around slirp deficiencies anyway. */ - return 1; + return true; } avail = MOD2(s->RxBufferSize + s->RxBufPtr - s->RxBufAddr, |