From db77ed2052199fcea016c5ce9f0fd62a1bcefe97 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Sat, 15 May 2021 09:33:55 +0200 Subject: [PATCH] ANDROID: GKI: restore termiox fields To keep the kernel abi stable at this point in time, restore the termiox pointer in struct tty_struct and the set_termiox() callback in struct tty_operations that were removed in eef2158b0c44 ("tty: Remove dead termiox code") Bug: 161946584 Fixes: eef2158b0c44 ("tty: Remove dead termiox code") Signed-off-by: Greg Kroah-Hartman Change-Id: Iea4739fc4725b6ebd10fc5e0367f91d938b6e364 --- include/linux/tty.h | 4 ++++ include/linux/tty_driver.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/linux/tty.h b/include/linux/tty.h index 5972f43b9d5a..94fa384a650b 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -303,6 +303,10 @@ struct tty_struct { spinlock_t flow_lock; /* Termios values are protected by the termios rwsem */ struct ktermios termios, termios_locked; + + /* termiox is estored only for ABI preservation, do not use */ + struct termiox *termiox; + char name[64]; struct pid *pgrp; /* Protected by ctrl lock */ /* diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 2f719b471d52..5d509c125171 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -277,6 +277,10 @@ struct tty_operations { int (*tiocmset)(struct tty_struct *tty, unsigned int set, unsigned int clear); int (*resize)(struct tty_struct *tty, struct winsize *ws); + + /* only for abi preservation */ + int (*set_termiox)(struct tty_struct *tty, struct termiox *tnew); + int (*get_icount)(struct tty_struct *tty, struct serial_icounter_struct *icount); int (*get_serial)(struct tty_struct *tty, struct serial_struct *p);