* [PATCH] Bluetooth: hci_ldisc: Add support for compat_ioctl handling
@ 2016-01-22 13:35 Marcel Holtmann
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2016-01-22 13:35 UTC (permalink / raw)
To: linux-bluetooth
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/hci_ldisc.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 73202624133b..56619c7ec41d 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -731,6 +731,24 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
return err;
}
+#ifdef CONFIG_COMPAT
+static long hci_uart_tty_compat_ioctl(struct tty_struct *tty, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ switch (cmd) {
+ case HCIUARTSETPROTO:
+ case HCIUARTGETPROTO:
+ case HCIUARTGETDEVICE:
+ case HCIUARTSETFLAGS:
+ case HCIUARTGETFLAGS:
+ return hci_uart_tty_ioctl(tty, file, cmd,
+ (unsigned long)compat_ptr(arg));
+ }
+
+ return -ENOIOCTLCMD;
+}
+#endif
+
/*
* We don't provide read/write/poll interface for user space.
*/
@@ -769,6 +787,9 @@ static int __init hci_uart_init(void)
hci_uart_ldisc.read = hci_uart_tty_read;
hci_uart_ldisc.write = hci_uart_tty_write;
hci_uart_ldisc.ioctl = hci_uart_tty_ioctl;
+#ifdef CONFIG_COMPAT
+ hci_uart_ldisc.compat_ioctl = hci_uart_tty_compat_ioctl;
+#endif
hci_uart_ldisc.poll = hci_uart_tty_poll;
hci_uart_ldisc.receive_buf = hci_uart_tty_receive;
hci_uart_ldisc.write_wakeup = hci_uart_tty_wakeup;
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Bluetooth: hci_ldisc: Add support for compat_ioctl handling
@ 2016-01-22 13:35 Marcel Holtmann
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2016-01-22 13:35 UTC (permalink / raw)
To: linux-bluetooth
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/hci_ldisc.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 73202624133b..56619c7ec41d 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -731,6 +731,24 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
return err;
}
+#ifdef CONFIG_COMPAT
+static long hci_uart_tty_compat_ioctl(struct tty_struct *tty, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ switch (cmd) {
+ case HCIUARTSETPROTO:
+ case HCIUARTGETPROTO:
+ case HCIUARTGETDEVICE:
+ case HCIUARTSETFLAGS:
+ case HCIUARTGETFLAGS:
+ return hci_uart_tty_ioctl(tty, file, cmd,
+ (unsigned long)compat_ptr(arg));
+ }
+
+ return -ENOIOCTLCMD;
+}
+#endif
+
/*
* We don't provide read/write/poll interface for user space.
*/
@@ -769,6 +787,9 @@ static int __init hci_uart_init(void)
hci_uart_ldisc.read = hci_uart_tty_read;
hci_uart_ldisc.write = hci_uart_tty_write;
hci_uart_ldisc.ioctl = hci_uart_tty_ioctl;
+#ifdef CONFIG_COMPAT
+ hci_uart_ldisc.compat_ioctl = hci_uart_tty_compat_ioctl;
+#endif
hci_uart_ldisc.poll = hci_uart_tty_poll;
hci_uart_ldisc.receive_buf = hci_uart_tty_receive;
hci_uart_ldisc.write_wakeup = hci_uart_tty_wakeup;
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Bluetooth: hci_ldisc: Add support for compat_ioctl handling
@ 2016-01-22 13:36 Marcel Holtmann
0 siblings, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2016-01-22 13:36 UTC (permalink / raw)
To: linux-bluetooth
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
---
drivers/bluetooth/hci_ldisc.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 73202624133b..56619c7ec41d 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -731,6 +731,24 @@ static int hci_uart_tty_ioctl(struct tty_struct *tty, struct file *file,
return err;
}
+#ifdef CONFIG_COMPAT
+static long hci_uart_tty_compat_ioctl(struct tty_struct *tty, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ switch (cmd) {
+ case HCIUARTSETPROTO:
+ case HCIUARTGETPROTO:
+ case HCIUARTGETDEVICE:
+ case HCIUARTSETFLAGS:
+ case HCIUARTGETFLAGS:
+ return hci_uart_tty_ioctl(tty, file, cmd,
+ (unsigned long)compat_ptr(arg));
+ }
+
+ return -ENOIOCTLCMD;
+}
+#endif
+
/*
* We don't provide read/write/poll interface for user space.
*/
@@ -769,6 +787,9 @@ static int __init hci_uart_init(void)
hci_uart_ldisc.read = hci_uart_tty_read;
hci_uart_ldisc.write = hci_uart_tty_write;
hci_uart_ldisc.ioctl = hci_uart_tty_ioctl;
+#ifdef CONFIG_COMPAT
+ hci_uart_ldisc.compat_ioctl = hci_uart_tty_compat_ioctl;
+#endif
hci_uart_ldisc.poll = hci_uart_tty_poll;
hci_uart_ldisc.receive_buf = hci_uart_tty_receive;
hci_uart_ldisc.write_wakeup = hci_uart_tty_wakeup;
--
2.5.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-01-22 13:36 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-22 13:36 [PATCH] Bluetooth: hci_ldisc: Add support for compat_ioctl handling Marcel Holtmann
-- strict thread matches above, loose matches on Subject: below --
2016-01-22 13:35 Marcel Holtmann
2016-01-22 13:35 Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).