aboutsummaryrefslogtreecommitdiffstats
path: root/fs/compat_ioctl.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@suse.de>2006-01-12 04:05:26 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 12:08:49 -0500
commitc6b44d10f25e5a93eca5135b686a35775c63546e (patch)
tree4cf688dae805a46e633e617d819e4d9bc6950651 /fs/compat_ioctl.c
parentcbe8dd4af2967ee1c2d54ec9d4db35cf3ecc98d3 (diff)
[PATCH] Implement ioctl emulation for the parport character device
Fixes bugzilla.kernel.org bug 2903. Cc: <tim@cyberelk.net> Cc: <andrea@suse.de> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/compat_ioctl.c')
-rw-r--r--fs/compat_ioctl.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c
index f0b7256b2f87..5dd0207ffd46 100644
--- a/fs/compat_ioctl.c
+++ b/fs/compat_ioctl.c
@@ -122,6 +122,7 @@
122#include <linux/dvb/dmx.h> 122#include <linux/dvb/dmx.h>
123#include <linux/dvb/frontend.h> 123#include <linux/dvb/frontend.h>
124#include <linux/dvb/video.h> 124#include <linux/dvb/video.h>
125#include <linux/lp.h>
125 126
126/* Aiee. Someone does not find a difference between int and long */ 127/* Aiee. Someone does not find a difference between int and long */
127#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int) 128#define EXT2_IOC32_GETFLAGS _IOR('f', 1, int)
@@ -2735,6 +2736,20 @@ static int do_ncp_setprivatedata(unsigned int fd, unsigned int cmd, unsigned lon
2735} 2736}
2736#endif 2737#endif
2737 2738
2739static int
2740lp_timeout_trans(unsigned int fd, unsigned int cmd, unsigned long arg)
2741{
2742 struct compat_timeval *tc = (struct compat_timeval *)arg;
2743 struct timeval *tn = compat_alloc_user_space(sizeof(struct timeval));
2744 struct timeval ts;
2745 if (get_user(ts.tv_sec, &tc->tv_sec) ||
2746 get_user(ts.tv_usec, &tc->tv_usec) ||
2747 put_user(ts.tv_sec, &tn->tv_sec) ||
2748 put_user(ts.tv_usec, &tn->tv_usec))
2749 return -EFAULT;
2750 return sys_ioctl(fd, cmd, (unsigned long)tn);
2751}
2752
2738#define HANDLE_IOCTL(cmd,handler) \ 2753#define HANDLE_IOCTL(cmd,handler) \
2739 { (cmd), (ioctl_trans_handler_t)(handler) }, 2754 { (cmd), (ioctl_trans_handler_t)(handler) },
2740 2755
@@ -2962,6 +2977,20 @@ HANDLE_IOCTL(DMX_GET_EVENT, do_dmx_get_event)
2962HANDLE_IOCTL(VIDEO_GET_EVENT, do_video_get_event) 2977HANDLE_IOCTL(VIDEO_GET_EVENT, do_video_get_event)
2963HANDLE_IOCTL(VIDEO_STILLPICTURE, do_video_stillpicture) 2978HANDLE_IOCTL(VIDEO_STILLPICTURE, do_video_stillpicture)
2964HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE, do_video_set_spu_palette) 2979HANDLE_IOCTL(VIDEO_SET_SPU_PALETTE, do_video_set_spu_palette)
2980
2981/* parport */
2982COMPATIBLE_IOCTL(LPTIME)
2983COMPATIBLE_IOCTL(LPCHAR)
2984COMPATIBLE_IOCTL(LPABORTOPEN)
2985COMPATIBLE_IOCTL(LPCAREFUL)
2986COMPATIBLE_IOCTL(LPWAIT)
2987COMPATIBLE_IOCTL(LPSETIRQ)
2988COMPATIBLE_IOCTL(LPGETSTATUS)
2989COMPATIBLE_IOCTL(LPGETSTATUS)
2990COMPATIBLE_IOCTL(LPRESET)
2991/*LPGETSTATS not implemented, but no kernels seem to compile it in anyways*/
2992COMPATIBLE_IOCTL(LPGETFLAGS)
2993HANDLE_IOCTL(LPSETTIMEOUT, lp_timeout_trans)
2965}; 2994};
2966 2995
2967int ioctl_table_size = ARRAY_SIZE(ioctl_start); 2996int ioctl_table_size = ARRAY_SIZE(ioctl_start);