-
Notifications
You must be signed in to change notification settings - Fork 8.3k
drivers: can: CANBUS driver for native_posix board #37124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
pllee4-weston
wants to merge
4
commits into
zephyrproject-rtos:main
from
westonrobot:patch-upstream-main-can_native_posix
Closed
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
713cc0b
drivers: can: Add support for native_posix board
jukkar 2d0cb8b
samples: net: sockets: can: Add native_posix board support
jukkar cdcc8be
rebase: rebased jukkar:canbus-driver-for-native_posix to tag zephyr-v…
rdu-weston b1cf9c6
drivers: can: replace canbus_np_context with socket_can_context
pllee4-weston File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # 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 | ||
|
|
||
| if CAN_NATIVE_POSIX | ||
|
|
||
| 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_ENABLED | ||
| bool "CANBUS interface 1" | ||
| default y | ||
| 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_ENABLED | ||
| default "vcan0" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. DeviceTree can likely be used for that |
||
| 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_ENABLED | ||
| default "SOCKET_CAN_1" | ||
| help | ||
| Name of the network device driver for SocketCAN. | ||
|
|
||
| ## Interface 2 | ||
| config CAN_NATIVE_POSIX_INTERFACE_2_ENABLED | ||
| bool "CANBUS interface 2" | ||
| default n | ||
| depends on CAN_NATIVE_POSIX | ||
| help | ||
| This option enables the CANBUS network interface for Native POSIX board. | ||
|
|
||
| if CAN_NATIVE_POSIX_INTERFACE_2_ENABLED | ||
|
|
||
| config CAN_NATIVE_POSIX_INTERFACE_2_NAME | ||
| string "CANBUS interface 2 name on Linux side" | ||
| depends on CAN_NATIVE_POSIX_INTERFACE_2_ENABLED | ||
| default "vcan1" | ||
| help | ||
| This option sets the CANBUS network interface 2 name in host system. | ||
|
|
||
| config CAN_NATIVE_POSIX_INTERFACE_2_SOCKETCAN_NAME | ||
| string "Network device name" | ||
| depends on CAN_NATIVE_POSIX_INTERFACE_2_ENABLED | ||
| default "SOCKET_CAN_2" | ||
| help | ||
| Name of the network device driver for SocketCAN. | ||
|
|
||
| endif #CAN_NATIVE_POSIX_INTERFACE_2_ENABLED | ||
|
|
||
| endif #CAN_NATIVE_POSIX | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick comment: socket CAN is only available on Linux, so I think a name other than "native_posix" should be used. The build should only be available on Linux hosts actually (maybe
CMAKE_HOST_SYSTEM_NAMEcan be useful here?)