mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
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>
This commit is contained in:
parent
b8c4b67e3e
commit
767cc9a9c1
5 changed files with 9 additions and 9 deletions
|
@ -733,21 +733,21 @@ uint64_t can_sja_mem_read(CanSJA1000State *s, hwaddr addr, unsigned size)
|
|||
return temp;
|
||||
}
|
||||
|
||||
int can_sja_can_receive(CanBusClientState *client)
|
||||
bool can_sja_can_receive(CanBusClientState *client)
|
||||
{
|
||||
CanSJA1000State *s = container_of(client, CanSJA1000State, bus_client);
|
||||
|
||||
if (s->clock & 0x80) { /* PeliCAN Mode */
|
||||
if (s->mode & 0x01) { /* reset mode. */
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
} else { /* BasicCAN mode */
|
||||
if (s->control & 0x01) {
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return 1; /* always return 1, when operation mode */
|
||||
return true; /* always return true, when operation mode */
|
||||
}
|
||||
|
||||
ssize_t can_sja_receive(CanBusClientState *client, const qemu_can_frame *frames,
|
||||
|
|
|
@ -137,7 +137,7 @@ void can_sja_disconnect(CanSJA1000State *s);
|
|||
|
||||
int can_sja_init(CanSJA1000State *s, qemu_irq irq);
|
||||
|
||||
int can_sja_can_receive(CanBusClientState *client);
|
||||
bool can_sja_can_receive(CanBusClientState *client);
|
||||
|
||||
ssize_t can_sja_receive(CanBusClientState *client,
|
||||
const qemu_can_frame *frames, size_t frames_cnt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue