diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2020-11-19 09:49:21 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-11-20 12:05:14 +0100 |
commit | 94c23097f991cd4568388564b3d2816b0b83f924 (patch) | |
tree | c206200379d41453f89e3d1293d7d87f6bddf324 /include/uapi | |
parent | 396b3cedc9cf54bf6266a89150136d72af7fcb1e (diff) | |
download | linux-94c23097f991cd4568388564b3d2816b0b83f924.tar.bz2 |
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.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/r/20201119084921.2621-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/linux/can/gw.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/uapi/linux/can/gw.h b/include/uapi/linux/can/gw.h index c2190bbe21d8..e4f0957554f3 100644 --- a/include/uapi/linux/can/gw.h +++ b/include/uapi/linux/can/gw.h @@ -98,8 +98,8 @@ enum { /* CAN frame elements that are affected by curr. 3 CAN frame modifications */ #define CGW_MOD_ID 0x01 -#define CGW_MOD_DLC 0x02 /* contains the data length in bytes */ -#define CGW_MOD_LEN CGW_MOD_DLC /* CAN FD length representation */ +#define CGW_MOD_DLC 0x02 /* Classical CAN data length code */ +#define CGW_MOD_LEN CGW_MOD_DLC /* CAN FD (plain) data length */ #define CGW_MOD_DATA 0x04 #define CGW_MOD_FLAGS 0x08 /* CAN FD flags */ |