tools: kwboot: Fix initialization of tty device
authorPali Rohár <pali@kernel.org>
Mon, 25 Oct 2021 13:12:53 +0000 (15:12 +0200)
committerStefan Roese <sr@denx.de>
Wed, 3 Nov 2021 05:45:26 +0000 (06:45 +0100)
Explicitly disable 2 stop bits by clearing CSTOPB flag, disable modem
control flow by clearing CRTSCTS flag and do not send hangup after closing
device by clearing HUPCL flag.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
tools/kwboot.c

index 695d433..c55b410 100644 (file)
@@ -657,6 +657,7 @@ kwboot_open_tty(const char *path, int baudrate)
 
        cfmakeraw(&tio);
        tio.c_cflag |= CREAD | CLOCAL;
+       tio.c_cflag &= ~(CSTOPB | HUPCL | CRTSCTS);
        tio.c_cc[VMIN] = 1;
        tio.c_cc[VTIME] = 0;