Skip to content

Commit 1c9c0b0

Browse files
dssengfabiobaltieri
authored andcommitted
drivers: can: can_native_linux: set max bitrate
This enables applications to call timing configuration functions, which enables more applications to work on native_sim. Signed-off-by: Dmitrii Sharshakov <[email protected]>
1 parent 1dbd552 commit 1c9c0b0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/can/can_native_linux.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,10 +478,16 @@ static int can_native_linux_init(const struct device *dev)
478478
return 0;
479479
}
480480

481+
#ifdef CONFIG_CAN_FD_MODE
482+
#define CAN_NATIVE_LINUX_MAX_BITRATE 8000000
483+
#else /* CONFIG_CAN_FD_MODE */
484+
#define CAN_NATIVE_LINUX_MAX_BITRATE 1000000
485+
#endif /* CONFIG_CAN_FD_MODE */
486+
481487
#define CAN_NATIVE_LINUX_INIT(inst) \
482488
\
483489
static const struct can_native_linux_config can_native_linux_cfg_##inst = { \
484-
.common = CAN_DT_DRIVER_CONFIG_INST_GET(inst, 0, 0), \
490+
.common = CAN_DT_DRIVER_CONFIG_INST_GET(inst, 0, CAN_NATIVE_LINUX_MAX_BITRATE), \
485491
.if_name = DT_INST_PROP(inst, host_interface), \
486492
}; \
487493
\

0 commit comments

Comments
 (0)