diff options
-rw-r--r-- | drivers/tty/tty_io.c | 2 | ||||
-rw-r--r-- | drivers/tty/tty_ioctl.c | 17 | ||||
-rw-r--r-- | include/linux/tty.h | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 150e4f747c7d..4ca4bcd28ff7 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -2717,6 +2717,8 @@ static long tty_compat_ioctl(struct file *file, unsigned int cmd, | |||
2717 | ld = tty_ldisc_ref_wait(tty); | 2717 | ld = tty_ldisc_ref_wait(tty); |
2718 | if (ld->ops->compat_ioctl) | 2718 | if (ld->ops->compat_ioctl) |
2719 | retval = ld->ops->compat_ioctl(tty, file, cmd, arg); | 2719 | retval = ld->ops->compat_ioctl(tty, file, cmd, arg); |
2720 | else | ||
2721 | retval = n_tty_compat_ioctl_helper(tty, file, cmd, arg); | ||
2720 | tty_ldisc_deref(ld); | 2722 | tty_ldisc_deref(ld); |
2721 | 2723 | ||
2722 | return retval; | 2724 | return retval; |
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c index 53f2442c6099..9314d93c1a20 100644 --- a/drivers/tty/tty_ioctl.c +++ b/drivers/tty/tty_ioctl.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
20 | #include <linux/bitops.h> | 20 | #include <linux/bitops.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/compat.h> | ||
22 | 23 | ||
23 | #include <asm/io.h> | 24 | #include <asm/io.h> |
24 | #include <asm/uaccess.h> | 25 | #include <asm/uaccess.h> |
@@ -1179,3 +1180,19 @@ int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, | |||
1179 | } | 1180 | } |
1180 | } | 1181 | } |
1181 | EXPORT_SYMBOL(n_tty_ioctl_helper); | 1182 | EXPORT_SYMBOL(n_tty_ioctl_helper); |
1183 | |||
1184 | #ifdef CONFIG_COMPAT | ||
1185 | long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file, | ||
1186 | unsigned int cmd, unsigned long arg) | ||
1187 | { | ||
1188 | switch (cmd) { | ||
1189 | case TIOCGLCKTRMIOS: | ||
1190 | case TIOCSLCKTRMIOS: | ||
1191 | return tty_mode_ioctl(tty, file, cmd, (unsigned long) compat_ptr(arg)); | ||
1192 | default: | ||
1193 | return -ENOIOCTLCMD; | ||
1194 | } | ||
1195 | } | ||
1196 | EXPORT_SYMBOL(n_tty_compat_ioctl_helper); | ||
1197 | #endif | ||
1198 | |||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 0ad68889fc1a..64c12a3e65f0 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -579,6 +579,8 @@ extern int __init tty_init(void); | |||
579 | /* tty_ioctl.c */ | 579 | /* tty_ioctl.c */ |
580 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, | 580 | extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, |
581 | unsigned int cmd, unsigned long arg); | 581 | unsigned int cmd, unsigned long arg); |
582 | extern long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file, | ||
583 | unsigned int cmd, unsigned long arg); | ||
582 | 584 | ||
583 | /* serial.c */ | 585 | /* serial.c */ |
584 | 586 | ||