| 141af1b3 | 22-Apr-2025 | Kohei Tokunaga <ktokunaga.mail@gmail.com> | hw/net/can: Fix type conflict of GLib function pointers
 On Emscripten, function pointer casts can result in runtime failures due to
 strict function signature checks. This affects the use of g_list_s
 hw/net/can: Fix type conflict of GLib function pointers
 On Emscripten, function pointer casts can result in runtime failures due to
 strict function signature checks. This affects the use of g_list_sort and
 g_slist_sort, which internally perform function pointer casts that are not
 supported by Emscripten. To avoid these issues, g_list_sort_with_data and
 g_slist_sort_with_data should be used instead, as they do not rely on
 function pointer casting.
 
 Signed-off-by: Kohei Tokunaga <ktokunaga.mail@gmail.com>
 Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
 Acked-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Message-ID: <4d47a75c5768c9a6dc5d8b3504e78837577ad70d.1745295397.git.ktokunaga.mail@gmail.com>
 Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
 show more ...  | 
| d4b668b7 | 13-Sep-2024 | Doug Brown <doug@schmorgal.com> | hw/net/can/xlnx-versal-canfd: Fix FIFO issues
 The read index should not be changed when storing a new message into the
 RX or TX FIFO. Changing it at this point will cause the reader to get
 out of sy
 hw/net/can/xlnx-versal-canfd: Fix FIFO issues
 The read index should not be changed when storing a new message into the
 RX or TX FIFO. Changing it at this point will cause the reader to get
 out of sync. The wrapping of the read index is already handled by the
 pre-write functions for the FIFO status registers anyway.
 
 Additionally, the calculation for wrapping the store index was off by
 one, which caused new messages to be written to the wrong location in
 the FIFO. This caused incorrect messages to be delivered.
 
 Signed-off-by: Doug Brown <doug@schmorgal.com>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Message-id: 20240827034927.66659-8-doug@schmorgal.com
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  | 
| 12d60ca0 | 13-Sep-2024 | Doug Brown <doug@schmorgal.com> | hw/net/can/xlnx-versal-canfd: Simplify DLC conversions
 Use QEMU's helper functions can_dlc2len() and can_len2dlc() for
 translating between the raw DLC value and the SocketCAN length value.
 This also
 hw/net/can/xlnx-versal-canfd: Simplify DLC conversions
 Use QEMU's helper functions can_dlc2len() and can_len2dlc() for
 translating between the raw DLC value and the SocketCAN length value.
 This also has the side effect of correctly handling received CAN FD
 frames with a DLC of 0-8, which was broken previously.
 
 Signed-off-by: Doug Brown <doug@schmorgal.com>
 Reviewed-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Message-id: 20240827034927.66659-7-doug@schmorgal.com
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  | 
| be243e9d | 13-Sep-2024 | Doug Brown <doug@schmorgal.com> | hw/net/can/xlnx-versal-canfd: Fix byte ordering
 The endianness of the CAN data was backwards in each group of 4 bytes.
 For example, the following data:
 
 00 11 22 33 44 55 66 77
 
 was showing up like
 hw/net/can/xlnx-versal-canfd: Fix byte ordering
 The endianness of the CAN data was backwards in each group of 4 bytes.
 For example, the following data:
 
 00 11 22 33 44 55 66 77
 
 was showing up like this:
 
 33 22 11 00 77 66 55 44
 
 Fix both the TX and RX code to put the data in the correct order.
 
 Signed-off-by: Doug Brown <doug@schmorgal.com>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
 Message-id: 20240827034927.66659-6-doug@schmorgal.com
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  | 
| 7f34aae6 | 13-Sep-2024 | Doug Brown <doug@schmorgal.com> | hw/net/can/xlnx-versal-canfd: Handle flags correctly
 Add support for QEMU_CAN_FRMF_ESI and QEMU_CAN_FRMF_BRS flags, and
 ensure frame->flags is always initialized to 0.
 
 Note that the Xilinx IP core
 hw/net/can/xlnx-versal-canfd: Handle flags correctly
 Add support for QEMU_CAN_FRMF_ESI and QEMU_CAN_FRMF_BRS flags, and
 ensure frame->flags is always initialized to 0.
 
 Note that the Xilinx IP core doesn't allow manually setting the ESI bit
 during transmits, so it's only implemented for the receive case.
 
 Signed-off-by: Doug Brown <doug@schmorgal.com>
 Reviewed-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
 Message-id: 20240827034927.66659-5-doug@schmorgal.com
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  | 
| 77dcbf16 | 13-Sep-2024 | Doug Brown <doug@schmorgal.com> | hw/net/can/xlnx-versal-canfd: Translate CAN ID registers
 Previously the emulated CAN ID register was being set to the exact same
 value stored in qemu_can_frame.can_id. This doesn't work correctly
 be
 hw/net/can/xlnx-versal-canfd: Translate CAN ID registers
 Previously the emulated CAN ID register was being set to the exact same
 value stored in qemu_can_frame.can_id. This doesn't work correctly
 because the Xilinx IP core uses a different bit arrangement than
 qemu_can_frame for all of its ID registers. Correct this problem for
 both RX and TX, including RX filtering.
 
 Signed-off-by: Doug Brown <doug@schmorgal.com>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Acked-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
 Message-id: 20240827034927.66659-4-doug@schmorgal.com
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  | 
| cd1e485f | 13-Sep-2024 | Doug Brown <doug@schmorgal.com> | hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check
 When checking the QEMU_CAN_FRMF_TYPE_FD flag, we need to ignore other
 potentially set flags. Before this change, received CAN FD frames from
 Socke
 hw/net/can/xlnx-versal-canfd: Fix CAN FD flag check
 When checking the QEMU_CAN_FRMF_TYPE_FD flag, we need to ignore other
 potentially set flags. Before this change, received CAN FD frames from
 SocketCAN weren't being recognized as CAN FD.
 
 Signed-off-by: Doug Brown <doug@schmorgal.com>
 Reviewed-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Message-id: 20240827034927.66659-3-doug@schmorgal.com
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  | 
| 8729856c | 24-Nov-2023 | Philippe Mathieu-Daudé <philmd@linaro.org> | hw/net/can/xlnx-zynqmp: Avoid underflow while popping RX FIFO
 Per https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format
 
 Message Format
 
 The same message format is used for R
 hw/net/can/xlnx-zynqmp: Avoid underflow while popping RX FIFO
 Per https://docs.xilinx.com/r/en-US/ug1085-zynq-ultrascale-trm/Message-Format
 
 Message Format
 
 The same message format is used for RXFIFO, TXFIFO, and TXHPB.
 Each message includes four words (16 bytes). Software must read
 and write all four words regardless of the actual number of data
 bytes and valid fields in the message.
 
 There is no mention in this reference manual about what the
 hardware does when not all four words are read. To fix the
 reported underflow behavior, I choose to fill the 4 frame data
 registers when the first register (ID) is accessed, which is how
 I expect hardware would do.
 
 Reported-by: Qiang Liu <cyruscyliu@gmail.com>
 Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Reviewed-by: Vikram Garhwal <vikram.garhwal@amd.com>
 Message-id: 20231124183325.95392-3-philmd@linaro.org
 Fixes: 98e5d7a2b7 ("hw/net/can: Introduce Xilinx ZynqMP CAN controller")
 Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1427
 Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
 Reviewed-by: Francisco Iglesias <francisco.iglesias@amd.com>
 Reviewed-by: Vikram Garhwal <vikram.garhwal@amd.com>
 Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
 Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
 show more ...  |