CC-2174: modify CAN frame header structure to match updated struct ca… - #1851
Conversation
2cea27d to
6bdf926Compare4feb261 to
3d602a3Comparezariiii9003
commented
Sep 17, 2024
@lumagi could you take a look at this? |
lumagi
commented
Sep 18, 2024
I'll try to take a look over the next couple of days. @eldadcool do you happen to have a link to the patch set in the kernel? |
@lumagi, sure: To configure the bus using "ip link" command you require a version of iproute2 5.12 or higher: https://lore.kernel.org/netdev/20210427165946.0bbd8fc0@hermes.local/ use the command ip link set can0 down
ip link settype can cc-len8-dlc on
ip link set can0 upnote: can-utils support this only since this patch linux-can/can-utils@11edd1d @hartkopp - please review my fix as well to make sure I did not misinterpret some edge cases regarding the new structure and that this will not break the usage of the old format. |
hartkopp
commented
Sep 19, 2024
You can simply go with the latest can-utils where
I'm not sure whether I can really review the patch, as I'm not that familiar with Pythons packing concept. Many thanks, |
eldadcool
commented
Sep 19, 2024
Actually, the DLC value in python-can relate directly to the data length. and it's not even verified to be a valid message by default. So potentially this could lead to sending a message with unexpected DLC value. Note the issue with socketcan only relevant for virtual can interfaces because physical interfaces does not allow FD frames with 10 bytes of data (only <8, 8, 12, 16, 20, 24, 32, 48 and 64) but it makes virtual interfaces behave differently than physical interfeces. |
hartkopp
commented
Sep 21, 2024
Yes, this is intentional. Once the CAN frame content is given to a real CAN interface or received from them the functions
https://elixir.bootlin.com/linux/v6.11/source/include/linux/can/length.h#L290 |
eldadcool
commented
Sep 24, 2024
Cool, |
lumagi
left a comment
There was a problem hiding this comment.
It looks fine to me. I only had some nit-picky stuff.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
zariiii9003
commented
Oct 16, 2024
ping @eldadcool |
eldadcool
commented
Nov 5, 2024
Hii sorry, I was not very available last month... |
zariiii9003
commented
Nov 23, 2024
@lumagi feel free to approve and merge |
Uh oh!
There was an error while loading. Please reload this page.
This fix allow to send CLASSIC CAN frames with a DLC value larger than 8 using the socketcan interface.
In addition it allow to parse incoming socketcan messages with the updated format
#1780
@hartkopp