Skip to content
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

DRAFT Kernel mod wrapper acf-can - Do not merge #61

Draft
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

SebastianSchildt
Copy link
Collaborator

Not ready to merge. But we need to talk....

This extends the acfcan examples with one that wraps the functionality into virtual can interfaces in Linux, much like vcan does.

It still is reusing the main Open1722 code (not as a "lib" obviously). The issue is, that certain standard C headers are not available in kernel space, instead replacements are offered (e.g. for <string.h> or <errno.h> .

In this PR currently I sort of suggest two ways to deal with this. Both are based on having a define
LINUX_KERNEL1722 that is only set when building the module.

This can then either be used directly wherever needed, see e.g. https://github.com/boschglobal/Open1722/blob/7c7e6dcb5bae5a1cc3671deabaf187950f6338c0/src/avtp/Utils.c#L30-L34

or as I did for the stdint case, split in a seperate file like here https://github.com/boschglobal/Open1722/blob/fun/acfcan-kernelmod-wrapper/include/avtp/IntTypes.h and see usage here
https://github.com/boschglobal/Open1722/blob/7c7e6dcb5bae5a1cc3671deabaf187950f6338c0/include/avtp/acf/Can.h#L39

Generally to make sure it not "breaks" as I guess most development is done on the user space lib, whe should probably add a GH action that would build the module. Might need some live-sed patching during build due to the license issue mentioned in the Readme

@SebastianSchildt
Copy link
Collaborator Author

Ah I should also have said somehting about the 1722 aspects of this :D So well if you are lucky it sends a "sort-of" good acf-can frame when you send a non-fd packet on the vritual can. So some legwork still to do, Currently more like a scaffolding showing how to integrate the existing 1722 code into the kernel mod example... No receive path yet

@nayakned
Copy link
Collaborator

nayakned commented Jan 6, 2025

I could get the path from CAN->Ethernet running on my setup. However, I had to go through the hassle of signing the kernel module. Somehow my VM did not accept unsigned kernel module despite all the settings.

@SebastianSchildt
Copy link
Collaborator Author

Ethernet to CAN impl still pending. I developed on ubuntu 24 on x64 and arm64. Signing never came up as an issue that environment (wasn’t even aware kernel mods actally CAN be signed :)

SebastianSchildt and others added 13 commits January 9, 2025 12:46
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Naresh Nayak <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
@SebastianSchildt SebastianSchildt force-pushed the fun/acfcan-kernelmod-wrapper branch from 22231c5 to 3d038f5 Compare January 9, 2025 12:49
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Signed-off-by: Sebastian Schildt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants