Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

can: isotp: support dynamic flow control parameters

The ISO15765-2 standard supports to take the PDUs communication parameters
blocksize (BS) and Separation Time minimum (STmin) either from the first
received flow control (FC) "static" or from every received FC "dynamic".

Add a new CAN_ISOTP_DYN_FC_PARMS flag to support dynamic FC parameters.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Link: https://lore.kernel.org/all/20231208165729.3011-1-socketcan@hartkopp.net
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

authored by

Oliver Hartkopp and committed by
Marc Kleine-Budde
e1aa35e1 fec846fa

+4 -2
+1
include/uapi/linux/can/isotp.h
··· 137 137 #define CAN_ISOTP_WAIT_TX_DONE 0x0400 /* wait for tx completion */ 138 138 #define CAN_ISOTP_SF_BROADCAST 0x0800 /* 1-to-N functional addressing */ 139 139 #define CAN_ISOTP_CF_BROADCAST 0x1000 /* 1-to-N transmission w/o FC */ 140 + #define CAN_ISOTP_DYN_FC_PARMS 0x2000 /* dynamic FC parameters BS/STmin */ 140 141 141 142 /* protocol machine default values */ 142 143
+3 -2
net/can/isotp.c
··· 381 381 return 1; 382 382 } 383 383 384 - /* get communication parameters only from the first FC frame */ 385 - if (so->tx.state == ISOTP_WAIT_FIRST_FC) { 384 + /* get static/dynamic communication params from first/every FC frame */ 385 + if (so->tx.state == ISOTP_WAIT_FIRST_FC || 386 + so->opt.flags & CAN_ISOTP_DYN_FC_PARMS) { 386 387 so->txfc.bs = cf->data[ae + 1]; 387 388 so->txfc.stmin = cf->data[ae + 2]; 388 389