diff options
author | Oliver Hartkopp <socketcan@hartkopp.net> | 2023-12-08 17:57:29 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2024-02-12 16:55:40 +0100 |
commit | e1aa35e16399d600215470411dfb56e1d6f8e017 (patch) | |
tree | 0bb5b5b1152dd08e7693c489f3418df57f4d3e63 /net/can | |
parent | fec846fa7eddf7bb651bf88bd78c7db1410ae3b1 (diff) | |
download | linux-stable-e1aa35e16399d600215470411dfb56e1d6f8e017.tar.gz linux-stable-e1aa35e16399d600215470411dfb56e1d6f8e017.tar.bz2 linux-stable-e1aa35e16399d600215470411dfb56e1d6f8e017.zip |
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>
Diffstat (limited to 'net/can')
-rw-r--r-- | net/can/isotp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/can/isotp.c b/net/can/isotp.c index d1c6f206f429..25bac0fafc83 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -381,8 +381,9 @@ static int isotp_rcv_fc(struct isotp_sock *so, struct canfd_frame *cf, int ae) return 1; } - /* get communication parameters only from the first FC frame */ - if (so->tx.state == ISOTP_WAIT_FIRST_FC) { + /* get static/dynamic communication params from first/every FC frame */ + if (so->tx.state == ISOTP_WAIT_FIRST_FC || + so->opt.flags & CAN_ISOTP_DYN_FC_PARMS) { so->txfc.bs = cf->data[ae + 1]; so->txfc.stmin = cf->data[ae + 2]; |