mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
tools: kwboot: Fix initializing tty device
Retrieve current terminal settings via tcgetattr(), set to raw mode with cfmakeraw(), enable receiver via CREAD and ignore modem control lines via CLOCAL. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
99a3d02370
commit
c704e0e1df
1 changed files with 5 additions and 4 deletions
|
@ -648,11 +648,12 @@ kwboot_open_tty(const char *path, int baudrate)
|
|||
if (fd < 0)
|
||||
goto out;
|
||||
|
||||
memset(&tio, 0, sizeof(tio));
|
||||
|
||||
tio.c_iflag = 0;
|
||||
tio.c_cflag = CREAD|CLOCAL|CS8;
|
||||
rc = tcgetattr(fd, &tio);
|
||||
if (rc)
|
||||
goto out;
|
||||
|
||||
cfmakeraw(&tio);
|
||||
tio.c_cflag |= CREAD|CLOCAL;
|
||||
tio.c_cc[VMIN] = 1;
|
||||
tio.c_cc[VTIME] = 10;
|
||||
|
||||
|
|
Loading…
Reference in a new issue