cangw: support len8_dlc for Classical CAN frames
The can_dlc value that is passed to the kernel is not sanitized in cangw therefore we only update the help text and some comments in gw.h. In the case that the CAN interface supports len8_dlc by setting CAN_CTRLMODE_CC_LEN8_DLC the can-gw module can modify the full DLC value range (0 .. 15) for Classic CAN frames. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>pull/269/head
parent
972054446a
commit
c3d9cc2027
8
cangw.c
8
cangw.c
|
|
@ -240,7 +240,7 @@ void print_usage(char *prg)
|
|||
fprintf(stderr, " -u <uid> (user defined modification identifier)\n");
|
||||
fprintf(stderr, " -l <hops> (limit the number of frame hops / routings)\n");
|
||||
fprintf(stderr, " -f <filter> (set CAN filter)\n");
|
||||
fprintf(stderr, " -m <mod> (set Classic CAN frame modifications)\n");
|
||||
fprintf(stderr, " -m <mod> (set Classical CAN frame modifications)\n");
|
||||
fprintf(stderr, " -M <MOD> (set CAN FD frame modifications)\n");
|
||||
fprintf(stderr, " -x <from_idx>:<to_idx>:<result_idx>:<init_xor_val> (XOR checksum)\n");
|
||||
fprintf(stderr, " -c <from>:<to>:<result>:<init_val>:<xor_val>:<crctab[256]> (CRC8 cs)\n");
|
||||
|
|
@ -251,12 +251,12 @@ void print_usage(char *prg)
|
|||
fprintf(stderr, " <can_id>:<can_mask> (matches when <received_can_id> & mask == can_id & mask)\n");
|
||||
fprintf(stderr, " <can_id>~<can_mask> (matches when <received_can_id> & mask != can_id & mask)\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "<mod> is a CAN frame modification instruction consisting of\n");
|
||||
fprintf(stderr, "<mod> is a Classical CAN frame modification instruction consisting of\n");
|
||||
fprintf(stderr, "<instruction>:<can_frame-elements>:<can_id>.<can_dlc>.<can_data>\n");
|
||||
fprintf(stderr, " <instruction> is one of 'AND' 'OR' 'XOR' 'SET'\n");
|
||||
fprintf(stderr, " <can_frame-elements> is _one_ or _more_ of 'I'dentifier 'L'ength 'D'ata\n");
|
||||
fprintf(stderr, " <can_id> is an u32 value containing the CAN Identifier\n");
|
||||
fprintf(stderr, " <can_dlc> is an u8 value containing the data length code (0 .. 8)\n");
|
||||
fprintf(stderr, " <can_dlc> is an u8 value containing the data length code in hex (0 .. F)\n");
|
||||
fprintf(stderr, " <can_data> is always eight(!) u8 values containing the CAN frames data\n");
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "<MOD> is a CAN FD frame modification instruction consisting of\n");
|
||||
|
|
@ -265,7 +265,7 @@ void print_usage(char *prg)
|
|||
fprintf(stderr, " <canfd_frame-elements> is _one_ or _more_ of 'I'd 'F'lags 'L'ength 'D'ata\n");
|
||||
fprintf(stderr, " <can_id> is an u32 value containing the CAN FD Identifier\n");
|
||||
fprintf(stderr, " <flags> is an u8 value containing CAN FD flags (CANFD_BRS, CANFD_ESI)\n");
|
||||
fprintf(stderr, " <len> is an u8 value containing the data length (0 .. 64)\n");
|
||||
fprintf(stderr, " <len> is an u8 value containing the data length in hex (0 .. 40)\n");
|
||||
fprintf(stderr, " <can_data> is always 64(!) u8 values containing the CAN FD frames data\n");
|
||||
fprintf(stderr, "The max. four modifications are performed in the order AND -> OR -> XOR -> SET\n");
|
||||
fprintf(stderr, "\n");
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue