Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions drivers/can/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ zephyr_sources_ifdef(CONFIG_CAN_MCUX_FLEXCAN can_mcux_flexcan.c)
zephyr_sources_ifdef(CONFIG_USERSPACE can_handlers.c)
zephyr_sources_ifdef(CONFIG_CAN_SHELL can_shell.c)
zephyr_sources_ifdef(CONFIG_CAN_NET can_net.c)

if(CONFIG_CAN_NATIVE_POSIX)
zephyr_library()
zephyr_library_include_directories(${ZEPHYR_BASE}/subsys/net/l2)
zephyr_library_compile_definitions(NO_POSIX_CHEATS)
zephyr_library_compile_definitions(_DEFAULT_SOURCE)
zephyr_library_sources(
can_native_posix.c
can_native_posix_adapt.c
)
endif()
1 change: 1 addition & 0 deletions drivers/can/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,6 @@ source "drivers/can/Kconfig.mcux"
source "drivers/can/Kconfig.mcp2515"
source "drivers/can/Kconfig.loopback"
source "drivers/can/Kconfig.net"
source "drivers/can/Kconfig.native_posix"

endif # CAN
64 changes: 64 additions & 0 deletions drivers/can/Kconfig.native_posix
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Kconfig.native_posix - native_posix CAN configuration options

#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#

config CAN_NATIVE_POSIX
bool "native_posix CAN Driver"
depends on ARCH_POSIX && NETWORKING
help
Enable native_posix CAN driver

config CAN_MAX_FILTER
int "Maximum number of concurrent active filters"
depends on CAN_NATIVE_POSIX
default 32
range 1 56
help
Defines the array size of the callback/msgq pointers.
Must be at least the size of concurrent reads.

## Interface 1
config CAN_NATIVE_POSIX_INTERFACE_1
bool "CANBUS interface 1"
depends on CAN_NATIVE_POSIX
help
This option enables the CANBUS network interface for Native POSIX board.

config CAN_NATIVE_POSIX_INTERFACE_1_NAME
string "CANBUS interface 1 name on Linux side"
depends on CAN_NATIVE_POSIX_INTERFACE_1
default "vcan0"
help
This option sets the CANBUS network interface 1 name in host system.

config CAN_NATIVE_POSIX_INTERFACE_1_SOCKETCAN_NAME
string "Network device name"
depends on CAN_NATIVE_POSIX_INTERFACE_1
default "SOCKET_CAN_1"
help
Name of the network device driver for SocketCAN.

## Interface 2
config CAN_NATIVE_POSIX_INTERFACE_2
bool "CANBUS interface 2"
depends on CAN_NATIVE_POSIX
help
This option enables the CANBUS network interface for Native POSIX board.

config CAN_NATIVE_POSIX_INTERFACE_2_NAME
string "CANBUS interface 2 name on Linux side"
depends on CAN_NATIVE_POSIX_INTERFACE_2
default "vcan1"
help
This option sets the CANBUS network interface 1 name in host system.

config CAN_NATIVE_POSIX_INTERFACE_2_SOCKETCAN_NAME
string "Network device name"
depends on CAN_NATIVE_POSIX_INTERFACE_2
default "SOCKET_CAN_2"
help
Name of the network device driver for SocketCAN.
Loading