Commit 62007626ac for qemu.org
commit 62007626ac2d755b859bda231ca0ce8879a13636
Author: Bernhard Beschow <shentey@gmail.com>
Date: Mon Jul 27 10:28:47 2026 +0100
hw/net/can/flexcan: Remove RX SMB raw view
Use the existing `rx_smb0` message buffer view for register masks instead
of the raw register array. Since all accesses now use the structured view,
remove the redundant `rx_smb0_raw` union member.
Signed-off-by: Bernhard Beschow <shentey@gmail.com>
Tested-by: Pavel Pisa <pisa@fel.cvut.cz>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Message-id: 20260723070059.6332-10-shentey@gmail.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
diff --git a/hw/net/can/flexcan.c b/hw/net/can/flexcan.c
index 205d0d6413..a8bad83cb8 100644
--- a/hw/net/can/flexcan.c
+++ b/hw/net/can/flexcan.c
@@ -106,7 +106,11 @@ static const FlexcanRegs flexcan_regs_write_mask = {
.gfwr_mx6 = 0xFFFFFFFF,
._reserved6 = {0},
._reserved8 = {0},
- .rx_smb0_raw = {0, 0, 0, 0},
+ .rx_smb0 = {
+ .can_ctrl = 0,
+ .can_id = 0,
+ .data = { 0, 0 },
+ },
.rx_smb1 = {0, 0, 0, 0},
};
static const FlexcanRegs flexcan_regs_reset_mask = {
@@ -145,7 +149,11 @@ static const FlexcanRegs flexcan_regs_reset_mask = {
.gfwr_mx6 = 0,
._reserved6 = {0},
._reserved8 = {0},
- .rx_smb0_raw = {0, 0, 0, 0},
+ .rx_smb0 = {
+ .can_ctrl = 0,
+ .can_id = 0,
+ .data = { 0, 0 },
+ },
.rx_smb1 = {0, 0, 0, 0},
};
diff --git a/include/hw/net/flexcan.h b/include/hw/net/flexcan.h
index 9affdff837..eee70bad42 100644
--- a/include/hw/net/flexcan.h
+++ b/include/hw/net/flexcan.h
@@ -81,10 +81,7 @@ typedef struct FlexcanRegs {
uint32_t _rx14mask; /* 0xAA8 */
uint32_t _rx15mask; /* 0xAAC */
uint32_t tx_smb[4]; /* 0xAB0 */
- union { /* 0xAC0, used for SMB emulation */
- uint32_t rx_smb0_raw[4];
- FlexcanRegsMessageBuffer rx_smb0;
- };
+ FlexcanRegsMessageBuffer rx_smb0; /* 0xAC0, used for SMB emulation */
uint32_t rx_smb1[4]; /* 0xAD0 */
uint32_t mecr; /* 0xAE0 */
uint32_t erriar; /* 0xAE4 */