History

can: gw: support modification of Classical CAN DLCs

Add support for data length code modifications for Classical CAN. The netlink configuration interface always allowed to pass any value that fits into a byte, therefore only the modification process had to be extended to handle the raw DLC represenation of Classical CAN frames. When a DLC value from 0 .. F is provided for Classical CAN frame modifications the 'len' value is modified as-is with the exception that potentially existing 9 .. F DLC values in the len8_dlc element are moved to the 'len' element for the modification operation by mod_retrieve_ccdlc(). After the modification the Classical CAN frame DLC information is brought back into the correct format by mod_store_ccdlc() which is filling 'len' and 'len8_dlc' accordingly.

Oliver Hartkopp committed 5 years ago

Commit 94c23091 parent 396b3ce2 files · +72 −10Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/can/gw.h+2−2
@@ -98,8 +98,8 @@ enum { · 97 unmodified lines
98 98
99/* CAN frame elements that are affected by curr. 3 CAN frame modifications */99/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
100#define CGW_MOD_ID 0x01100#define CGW_MOD_ID 0x01
101#define CGW_MOD_DLC 0x02 /* contains the data length in bytes */101#define CGW_MOD_DLC 0x02 /* Classical CAN data length code */
102#define CGW_MOD_LEN CGW_MOD_DLC /* CAN FD length representation */102#define CGW_MOD_LEN CGW_MOD_DLC /* CAN FD (plain) data length */
103#define CGW_MOD_DATA 0x04103#define CGW_MOD_DATA 0x04
104#define CGW_MOD_FLAGS 0x08 /* CAN FD flags */104#define CGW_MOD_FLAGS 0x08 /* CAN FD flags */
105 105