From bbb16b872bf30d87db84dc6a993b9a4fc98274e7 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 23 Dec 2022 11:41:04 +0100 Subject: [PATCH 1/2] tty/module.c: adapt signature of ->set_termios method to v6.1 Upstream changed ->set_termios to take a const struct ktermios in commit a8c11c1520347 (tty: Make ->set_termios() old ktermios const). --- tty/module.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tty/module.c b/tty/module.c index 9b5b1d6c..a0673b2b 100644 --- a/tty/module.c +++ b/tty/module.c @@ -657,8 +657,13 @@ static int ec_tty_ioctl(struct tty_struct *tty, /*****************************************************************************/ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +static void ec_tty_set_termios(struct tty_struct *tty, + const struct ktermios *old_termios) +#else static void ec_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) +#endif { ec_tty_t *t = (ec_tty_t *) tty->driver_data; int ret; From d39b4a59ecf843ebcf5fece04009d1f48d276c5f Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 23 Dec 2022 12:03:07 +0100 Subject: [PATCH 2/2] tty/module.c: include proper header for INIT_C_CC definition In upstream commit c9874d3ffeaf (termios: start unifying non-UAPI parts of asm/termios.h), the INIT_C_CC definition was moved to a new header, termios_internal.h. So we must include that header to get that macro, but conditionally, since the header does not exist in older kernels. --- tty/module.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tty/module.c b/tty/module.c index a0673b2b..551deb0c 100644 --- a/tty/module.c +++ b/tty/module.c @@ -45,6 +45,10 @@ #include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +#include +#endif + #include "../master/globals.h" #include "../include/ectty.h"