From a0c841b85d88b1ff3c29d8dc66658750e53b0e8b Mon Sep 17 00:00:00 2001 From: Miroslav Ondra Date: Wed, 24 Mar 2021 13:09:34 +0100 Subject: [PATCH] Fix ioctl 0x5480 for Linux>5.0 (set uart timeout) --- modules/unipi/src/unipi_tty.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/unipi/src/unipi_tty.c b/modules/unipi/src/unipi_tty.c index 5571970..b59f664 100644 --- a/modules/unipi/src/unipi_tty.c +++ b/modules/unipi/src/unipi_tty.c @@ -940,6 +940,16 @@ static int unipi_tty_ioctl(struct tty_struct *tty, struct file *file, retval = read_cnt(ldata); up_write(&tty->termios_rwsem); return put_user(retval, (unsigned int __user *) arg); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) + case 0x5481: + case 0x5480: + if (tty->ops->ioctl != NULL) { + retval = tty->ops->ioctl(tty, cmd, arg); + if (retval != -ENOIOCTLCMD) + return retval; + } + // fall through +#endif default: return n_tty_ioctl_helper(tty, file, cmd, arg); } -- 2.34.1