]> git.baikalelectronics.ru Git - uboot.git/commit
tools: termios_linux.h: Fix tcsendbreak() implementation
authorPali Rohár <pali@kernel.org>
Wed, 6 Oct 2021 12:30:25 +0000 (14:30 +0200)
committerStefan Roese <sr@denx.de>
Thu, 21 Oct 2021 05:39:05 +0000 (07:39 +0200)
commita4748b7b15e7021ca2b1129015754b1e57cd0ef2
treed5adbdef319ad6759e2f25ffd406b188cc346aab
parent0bc26f17b1ee4640ef01833753819fd99eaffd63
tools: termios_linux.h: Fix tcsendbreak() implementation

There are two Linux ioctls which implements tcsendbreak() functionality:
TCSBRK and TCSBRKP

TCSBRK with non-zero parameter implements tcdrain() and with zero parameter
implements tcsendbreak() for duration of 0.25s.

TCSBRKP with zero parameter is same as TCSBRK and with non-zero parameter
implements tcsendbreak() for duration in deciseconds specified by
parameter. TCSBRKP does not have to be provided by older toolchain
versions.

So tcsendbreak() has to either use TCSBRK with zero parameter or TCSBRKP
with any parameter.

Fix code to use TCSBRKP and fallback to TCSBRK with 0.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/termios_linux.h