qemu/hw/net/can
Peter Maydell 676ea985c0 hw/net/can/ctucan_core: Handle big-endian hosts
The ctucan driver defines types for its registers which are a union
of a uint32_t with a struct with bitfields for the individual
fields within that register. This is a bad idea, because bitfields
aren't portable. The ctu_can_fd_regs.h header works around the
most glaring of the portability issues by defining the
fields in two different orders depending on the setting of the
__LITTLE_ENDIAN_BITFIELD define. However, in ctucan_core.h this
is unconditionally set to 1, which is wrong for big-endian hosts.

Set it only if HOST_WORDS_BIGENDIAN is not set. There is no need
for a "have we defined it already" guard, because the only place
that should set it is ctucan_core.h, which has the usual
double-inclusion guard.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Tested-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2020-11-11 20:34:36 +08:00
..
can_kvaser_pci.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
can_mioe3680_pci.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
can_pcm3680_pci.c Use DECLARE_*CHECKER* macros 2020-09-09 09:27:09 -04:00
can_sja1000.c hw/net/can: sja1000 ignore CAN FD frames 2020-09-30 19:11:36 +02:00
can_sja1000.h hw/net/can: Make CanBusClientInfo::can_receive() return a boolean 2020-03-31 21:14:35 +08:00
ctu_can_fd_frame.h hw/net/can/ctucafd: Add CTU CAN FD core register definitions. 2020-09-30 19:11:37 +02:00
ctu_can_fd_regs.h hw/net/can/ctucafd: Add CTU CAN FD core register definitions. 2020-09-30 19:11:37 +02:00
ctucan_core.c hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers() 2020-11-11 20:34:36 +08:00
ctucan_core.h hw/net/can/ctucan_core: Handle big-endian hosts 2020-11-11 20:34:36 +08:00
ctucan_pci.c hw/net/can: CTU CAN FD IP open hardware core emulation. 2020-09-30 19:11:37 +02:00
meson.build hw/net/can: CTU CAN FD IP open hardware core emulation. 2020-09-30 19:11:37 +02:00