card_uart_ctrl: change from bool to integer argument
This allows for control functions for e.g. baud rate or waiting time
Change-Id: Ifa8dde9dbcd27b79055aaac1a05bb040be616e05
diff --git a/ccid_host/cuart_driver_tty.c b/ccid_host/cuart_driver_tty.c
index 3695b58..10ea60f 100644
--- a/ccid_host/cuart_driver_tty.c
+++ b/ccid_host/cuart_driver_tty.c
@@ -249,7 +249,7 @@
return i;
}
-static int tty_uart_ctrl(struct card_uart *cuart, enum card_uart_ctl ctl, bool enable)
+static int tty_uart_ctrl(struct card_uart *cuart, enum card_uart_ctl ctl, int arg)
{
struct termios tio;
int rc;
@@ -263,7 +263,7 @@
}
/* We do our best here, but lots of [USB] serial drivers seem to ignore
* CREAD, see https://bugzilla.kernel.org/show_bug.cgi?id=205033 */
- if (enable)
+ if (arg)
tio.c_cflag |= CREAD;
else
tio.c_cflag &= ~CREAD;
@@ -274,8 +274,8 @@
}
break;
case CUART_CTL_RST:
- _set_rts(cuart->u.tty.ofd.fd, enable);
- if (enable)
+ _set_rts(cuart->u.tty.ofd.fd, arg ? true : false);
+ if (arg)
_flush(cuart->u.tty.ofd.fd);
break;
case CUART_CTL_POWER: