diff --git a/drivers/can/can_mcan.c b/drivers/can/can_mcan.c index 887f45091c9..9a7e3fdd85a 100644 --- a/drivers/can/can_mcan.c +++ b/drivers/can/can_mcan.c @@ -500,7 +500,7 @@ static void can_mcan_tc_event_handler(const struct device *dev) return; } - tx_idx = tx_event.mm.idx; + tx_idx = tx_event.mm; /* Acknowledge TX event */ err = can_mcan_write_reg(dev, CAN_MCAN_TXEFA, event_idx); @@ -817,7 +817,6 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim #endif /* !CONFIG_CAN_FD_MODE */ .efc = 1U, }; - struct can_mcan_mm mm; uint32_t put_idx; uint32_t reg; int err; @@ -894,10 +893,7 @@ int can_mcan_send(const struct device *dev, const struct can_frame *frame, k_tim k_mutex_lock(&data->tx_mtx, K_FOREVER); put_idx = FIELD_GET(CAN_MCAN_TXFQS_TFQPI, reg); - - mm.idx = put_idx; - mm.cnt = data->mm.cnt++; - tx_hdr.mm = mm; + tx_hdr.mm = put_idx; if ((frame->flags & CAN_FRAME_IDE) != 0U) { tx_hdr.ext_id = frame->id; diff --git a/drivers/can/can_mcan.h b/drivers/can/can_mcan.h index a9364580080..98ccc793347 100644 --- a/drivers/can/can_mcan.h +++ b/drivers/can/can_mcan.h @@ -607,11 +607,6 @@ struct can_mcan_rx_fifo { }; } __packed __aligned(4); -struct can_mcan_mm { - uint8_t idx: 5; - uint8_t cnt: 3; -} __packed; - struct can_mcan_tx_buffer_hdr { union { struct { @@ -632,7 +627,7 @@ struct can_mcan_tx_buffer_hdr { uint8_t fdf: 1; /* FD Format */ uint8_t res2: 1; /* Reserved */ uint8_t efc: 1; /* Event FIFO control (Store Tx events) */ - struct can_mcan_mm mm; /* Message marker */ + uint8_t mm; /* Message marker */ } __packed __aligned(4); struct can_mcan_tx_buffer { @@ -657,7 +652,7 @@ struct can_mcan_tx_event_fifo { uint8_t brs: 1; /* Bit Rate Switch */ uint8_t fdf: 1; /* FD Format */ uint8_t et: 2; /* Event type */ - struct can_mcan_mm mm; /* Message marker */ + uint8_t mm; /* Message marker */ } __packed __aligned(4); #define CAN_MCAN_FCE_DISABLE 0x0 @@ -730,7 +725,6 @@ struct can_mcan_data { uint16_t ext_filt_fd_frame; uint16_t ext_filt_rtr; uint16_t ext_filt_rtr_mask; - struct can_mcan_mm mm; bool started; #ifdef CONFIG_CAN_FD_MODE bool fd;