qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

hw/net/can: Make CanBusClientInfo::can_receive() return a boolean

The CanBusClientInfo::can_receive handler return whether the
device can or can not receive new frames. Make it obvious by
returning a boolean type.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
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>

authored by

Philippe Mathieu-Daudé and committed by
Jason Wang
767cc9a9 b8c4b67e

+9 -9
+1 -1
hw/net/allwinner-sun8i-emac.c
··· 395 395 cpu_physical_memory_write(phys_addr, desc, sizeof(*desc)); 396 396 } 397 397 398 - static int allwinner_sun8i_emac_can_receive(NetClientState *nc) 398 + static bool allwinner_sun8i_emac_can_receive(NetClientState *nc) 399 399 { 400 400 AwSun8iEmacState *s = qemu_get_nic_opaque(nc); 401 401 FrameDescriptor desc;
+4 -4
hw/net/can/can_sja1000.c
··· 733 733 return temp; 734 734 } 735 735 736 - int can_sja_can_receive(CanBusClientState *client) 736 + bool can_sja_can_receive(CanBusClientState *client) 737 737 { 738 738 CanSJA1000State *s = container_of(client, CanSJA1000State, bus_client); 739 739 740 740 if (s->clock & 0x80) { /* PeliCAN Mode */ 741 741 if (s->mode & 0x01) { /* reset mode. */ 742 - return 0; 742 + return false; 743 743 } 744 744 } else { /* BasicCAN mode */ 745 745 if (s->control & 0x01) { 746 - return 0; 746 + return false; 747 747 } 748 748 } 749 749 750 - return 1; /* always return 1, when operation mode */ 750 + return true; /* always return true, when operation mode */ 751 751 } 752 752 753 753 ssize_t can_sja_receive(CanBusClientState *client, const qemu_can_frame *frames,
+1 -1
hw/net/can/can_sja1000.h
··· 137 137 138 138 int can_sja_init(CanSJA1000State *s, qemu_irq irq); 139 139 140 - int can_sja_can_receive(CanBusClientState *client); 140 + bool can_sja_can_receive(CanBusClientState *client); 141 141 142 142 ssize_t can_sja_receive(CanBusClientState *client, 143 143 const qemu_can_frame *frames, size_t frames_cnt);
+1 -1
include/net/can_emu.h
··· 83 83 typedef struct CanBusState CanBusState; 84 84 85 85 typedef struct CanBusClientInfo { 86 - int (*can_receive)(CanBusClientState *); 86 + bool (*can_receive)(CanBusClientState *); 87 87 ssize_t (*receive)(CanBusClientState *, 88 88 const struct qemu_can_frame *frames, size_t frames_cnt); 89 89 } CanBusClientInfo;
+2 -2
net/can/can_socketcan.c
··· 110 110 } 111 111 } 112 112 113 - static int can_host_socketcan_can_receive(CanBusClientState *client) 113 + static bool can_host_socketcan_can_receive(CanBusClientState *client) 114 114 { 115 - return 1; 115 + return true; 116 116 } 117 117 118 118 static ssize_t can_host_socketcan_receive(CanBusClientState *client,