[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230125113418.7221-1-quic_vdadhani@quicinc.com>
Date: Wed, 25 Jan 2023 17:04:18 +0530
From: Viken Dadhaniya <quic_vdadhani@...cinc.com>
To: gregkh@...uxfoundation.org, jirislaby@...nel.org,
linux-serial@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: quic_msavaliy@...cinc.com, quic_vnivarth@...cinc.com,
quic_vtanuku@...cinc.com, quic_arandive@...cinc.com,
Viken Dadhaniya <quic_vdadhani@...cinc.com>
Subject: [PATCH V2] Serial: core: Add compat ioctl support
Current serial core driver doesn't support compat_ioctl
due to which 32-bit application is not able to send
ioctls to driver on a 64-bit platform.
Added compat_ioctl support in serial core to handle
ioctls from 32-bit applications on a 64-bit platform.
Signed-off-by: Viken Dadhaniya <quic_vdadhani@...cinc.com>
---
drivers/tty/serial/serial_core.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index b9fbbee598b8..ad4c3a5a3d29 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1601,6 +1601,12 @@ uart_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
return ret;
}
+static long
+uart_compat_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg)
+{
+ return (long)uart_ioctl(tty, cmd, arg);
+};
+
static void uart_set_ldisc(struct tty_struct *tty)
{
struct uart_state *state = tty->driver_data;
@@ -2670,6 +2676,7 @@ static const struct tty_operations uart_ops = {
.chars_in_buffer= uart_chars_in_buffer,
.flush_buffer = uart_flush_buffer,
.ioctl = uart_ioctl,
+ .compat_ioctl = uart_compat_ioctl,
.throttle = uart_throttle,
.unthrottle = uart_unthrottle,
.send_xchar = uart_send_xchar,
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation
Powered by blists - more mailing lists