From f6d963b5d927e67389b40bd6618378b773ef5137 Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Thu, 1 Oct 2020 20:42:50 +0200 Subject: [PATCH] isotpsend: add support for blocking write flag With the new flag 'CAN_ISOTP_WAIT_TX_DONE' the send()/write() syscall returns when the PDU is completely passed to the CAN netdevice queue. Depending on STmin and other settings for the tx-queue-len this does not necessarily mean that the PDU has been completely sent on the CAN interface at that time. Signed-off-by: Oliver Hartkopp --- include/linux/can/isotp.h | 1 + isotpsend.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/linux/can/isotp.h b/include/linux/can/isotp.h index f074329..09935b5 100644 --- a/include/linux/can/isotp.h +++ b/include/linux/can/isotp.h @@ -136,6 +136,7 @@ struct can_isotp_ll_options { #define CAN_ISOTP_FORCE_TXSTMIN 0x080 /* ignore stmin from received FC */ #define CAN_ISOTP_FORCE_RXSTMIN 0x100 /* ignore CFs depending on rx stmin */ #define CAN_ISOTP_RX_EXT_ADDR 0x200 /* different rx extended addressing */ +#define CAN_ISOTP_WAIT_TX_DONE 0x400 /* wait for tx completion */ /* default values */ diff --git a/isotpsend.c b/isotpsend.c index c32add3..3797e95 100644 --- a/isotpsend.c +++ b/isotpsend.c @@ -71,6 +71,7 @@ void print_usage(char *prg) fprintf(stderr, " -t