Fix ioctl 0x5480 for Linux>5.0 (set uart timeout)
authorMiroslav Ondra <ondra@faster.cz>
Wed, 24 Mar 2021 12:09:34 +0000 (13:09 +0100)
committerMiroslav Ondra <ondra@faster.cz>
Wed, 24 Mar 2021 12:09:34 +0000 (13:09 +0100)
modules/unipi/src/unipi_tty.c

index 557197084c3d733f5f8fd124005939c21a378e2f..b59f664bc5b395eae057de388409ff779fb5c425 100644 (file)
@@ -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);
        }