2 * ioctl32.c: Conversion between 32bit and 64bit native ioctls.
3 * Separated from fs stuff by Arnd Bergmann <arnd@arndb.de>
5 * Copyright (C) 1997-2000 Jakub Jelinek (jakub@redhat.com)
6 * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be)
7 * Copyright (C) 2001,2002 Andi Kleen, SuSE Labs
8 * Copyright (C) 2003 Pavel Machek (pavel@suse.cz)
9 * Copyright (C) 2005 Philippe De Muyter (phdm@macqel.be)
11 * These routines maintain argument size conversion between 32bit and 64bit
15 #include <linux/config.h>
16 #include <linux/compat.h>
17 #include <linux/videodev.h>
18 #include <linux/videodev2.h>
19 #include <linux/module.h>
20 #include <linux/smp_lock.h>
21 #include <media/v4l2-common.h>
26 struct video_tuner32 {
29 compat_ulong_t rangelow, rangehigh;
30 u32 flags; /* It is really u32 in videodev.h */
34 static int get_video_tuner32(struct video_tuner *kp, struct video_tuner32 __user *up)
36 if(!access_ok(VERIFY_READ, up, sizeof(struct video_tuner32)) ||
37 get_user(kp->tuner, &up->tuner) ||
38 copy_from_user(kp->name, up->name, 32) ||
39 get_user(kp->rangelow, &up->rangelow) ||
40 get_user(kp->rangehigh, &up->rangehigh) ||
41 get_user(kp->flags, &up->flags) ||
42 get_user(kp->mode, &up->mode) ||
43 get_user(kp->signal, &up->signal))
48 static int put_video_tuner32(struct video_tuner *kp, struct video_tuner32 __user *up)
50 if(!access_ok(VERIFY_WRITE, up, sizeof(struct video_tuner32)) ||
51 put_user(kp->tuner, &up->tuner) ||
52 copy_to_user(up->name, kp->name, 32) ||
53 put_user(kp->rangelow, &up->rangelow) ||
54 put_user(kp->rangehigh, &up->rangehigh) ||
55 put_user(kp->flags, &up->flags) ||
56 put_user(kp->mode, &up->mode) ||
57 put_user(kp->signal, &up->signal))
62 struct video_buffer32 {
64 compat_int_t height, width, depth, bytesperline;
67 static int get_video_buffer32(struct video_buffer *kp, struct video_buffer32 __user *up)
71 if (!access_ok(VERIFY_READ, up, sizeof(struct video_buffer32)) ||
72 get_user(tmp, &up->base) ||
73 get_user(kp->height, &up->height) ||
74 get_user(kp->width, &up->width) ||
75 get_user(kp->depth, &up->depth) ||
76 get_user(kp->bytesperline, &up->bytesperline))
79 /* This is actually a physical address stored
82 kp->base = (void *)(unsigned long) tmp;
87 static int put_video_buffer32(struct video_buffer *kp, struct video_buffer32 __user *up)
89 u32 tmp = (u32)((unsigned long)kp->base);
91 if(!access_ok(VERIFY_WRITE, up, sizeof(struct video_buffer32)) ||
92 put_user(tmp, &up->base) ||
93 put_user(kp->height, &up->height) ||
94 put_user(kp->width, &up->width) ||
95 put_user(kp->depth, &up->depth) ||
96 put_user(kp->bytesperline, &up->bytesperline))
101 struct video_clip32 {
102 s32 x, y, width, height; /* Its really s32 in videodev.h */
106 struct video_window32 {
107 u32 x, y, width, height, chromakey, flags;
108 compat_caddr_t clips;
109 compat_int_t clipcount;
112 static int native_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
114 int ret = -ENOIOCTLCMD;
116 if (file->f_op->unlocked_ioctl)
117 ret = file->f_op->unlocked_ioctl(file, cmd, arg);
118 else if (file->f_op->ioctl) {
120 ret = file->f_op->ioctl(file->f_dentry->d_inode, file, cmd, arg);
128 /* You get back everything except the clips... */
129 static int put_video_window32(struct video_window *kp, struct video_window32 __user *up)
131 if(!access_ok(VERIFY_WRITE, up, sizeof(struct video_window32)) ||
132 put_user(kp->x, &up->x) ||
133 put_user(kp->y, &up->y) ||
134 put_user(kp->width, &up->width) ||
135 put_user(kp->height, &up->height) ||
136 put_user(kp->chromakey, &up->chromakey) ||
137 put_user(kp->flags, &up->flags) ||
138 put_user(kp->clipcount, &up->clipcount))
152 enum v4l2_field field;
154 compat_caddr_t clips; /* actually struct v4l2_clip32 * */
156 compat_caddr_t bitmap;
159 static int get_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
161 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_window32)) ||
162 copy_from_user(&kp->w, &up->w, sizeof(up->w)) ||
163 get_user(kp->field, &up->field) ||
164 get_user(kp->chromakey, &up->chromakey) ||
165 get_user(kp->clipcount, &up->clipcount))
167 if (kp->clipcount > 2048)
170 struct v4l2_clip32 *uclips = compat_ptr(up->clips);
171 struct v4l2_clip *kclips;
172 int n = kp->clipcount;
174 kclips = compat_alloc_user_space(n * sizeof(struct v4l2_clip));
177 if (!access_ok(VERIFY_READ, &uclips->c, sizeof(uclips->c)) ||
178 copy_from_user(&kclips->c, &uclips->c, sizeof(uclips->c)))
180 kclips->next = n ? kclips + 1 : 0;
189 static int put_v4l2_window32(struct v4l2_window *kp, struct v4l2_window32 __user *up)
191 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_window32)) ||
192 copy_to_user(&up->w, &kp->w, sizeof(up->w)) ||
193 put_user(kp->field, &up->field) ||
194 put_user(kp->chromakey, &up->chromakey) ||
195 put_user(kp->clipcount, &up->clipcount))
200 static inline int get_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up)
202 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_pix_format)) ||
203 copy_from_user(kp, up, sizeof(struct v4l2_pix_format)))
208 static inline int put_v4l2_pix_format(struct v4l2_pix_format *kp, struct v4l2_pix_format __user *up)
210 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_pix_format)) ||
211 copy_to_user(up, kp, sizeof(struct v4l2_pix_format)))
216 static inline int get_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up)
218 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_vbi_format)) ||
219 copy_from_user(kp, up, sizeof(struct v4l2_vbi_format)))
224 static inline int put_v4l2_vbi_format(struct v4l2_vbi_format *kp, struct v4l2_vbi_format __user *up)
226 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_vbi_format)) ||
227 copy_to_user(up, kp, sizeof(struct v4l2_vbi_format)))
234 enum v4l2_buf_type type;
237 struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE
238 struct v4l2_window32 win; // V4L2_BUF_TYPE_VIDEO_OVERLAY
239 struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE
240 __u8 raw_data[200]; // user-defined
244 static int get_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user *up)
246 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_format32)) ||
247 get_user(kp->type, &up->type))
250 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
251 return get_v4l2_pix_format(&kp->fmt.pix, &up->fmt.pix);
252 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
253 return get_v4l2_window32(&kp->fmt.win, &up->fmt.win);
254 case V4L2_BUF_TYPE_VBI_CAPTURE:
255 return get_v4l2_vbi_format(&kp->fmt.vbi, &up->fmt.vbi);
257 printk("compat_ioctl : unexpected VIDIOC_FMT type %d\n",
263 static int put_v4l2_format32(struct v4l2_format *kp, struct v4l2_format32 __user *up)
265 if(!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_format32)) ||
266 put_user(kp->type, &up->type))
269 case V4L2_BUF_TYPE_VIDEO_CAPTURE:
270 return put_v4l2_pix_format(&kp->fmt.pix, &up->fmt.pix);
271 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
272 return put_v4l2_window32(&kp->fmt.win, &up->fmt.win);
273 case V4L2_BUF_TYPE_VBI_CAPTURE:
274 return put_v4l2_vbi_format(&kp->fmt.vbi, &up->fmt.vbi);
280 static inline int get_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up)
282 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard)) ||
283 copy_from_user(kp, up, sizeof(struct v4l2_standard)))
289 static inline int put_v4l2_standard(struct v4l2_standard *kp, struct v4l2_standard __user *up)
291 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard)) ||
292 copy_to_user(up, kp, sizeof(struct v4l2_standard)))
297 struct v4l2_standard32
300 __u32 id[2]; /* __u64 would get the alignment wrong */
302 struct v4l2_fract frameperiod; /* Frames, not fields */
307 static int get_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up)
309 /* other fields are not set by the user, nor used by the driver */
310 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_standard32)) ||
311 get_user(kp->index, &up->index))
316 static int put_v4l2_standard32(struct v4l2_standard *kp, struct v4l2_standard32 __user *up)
318 if(!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_standard32)) ||
319 put_user(kp->index, &up->index) ||
320 copy_to_user(up->id, &kp->id, sizeof(__u64)) ||
321 copy_to_user(up->name, kp->name, 24) ||
322 copy_to_user(&up->frameperiod, &kp->frameperiod, sizeof(kp->frameperiod)) ||
323 put_user(kp->framelines, &up->framelines) ||
324 copy_to_user(up->reserved, kp->reserved, 4 * sizeof(__u32)))
329 static inline int get_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up)
331 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_tuner)) ||
332 copy_from_user(kp, up, sizeof(struct v4l2_tuner)))
338 static inline int put_v4l2_tuner(struct v4l2_tuner *kp, struct v4l2_tuner __user *up)
340 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_tuner)) ||
341 copy_to_user(up, kp, sizeof(struct v4l2_tuner)))
349 enum v4l2_buf_type type;
352 enum v4l2_field field;
353 struct compat_timeval timestamp;
354 struct v4l2_timecode timecode;
357 /* memory location */
358 enum v4l2_memory memory;
361 compat_long_t userptr;
368 static int get_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user *up)
371 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_buffer32)) ||
372 get_user(kp->index, &up->index) ||
373 get_user(kp->type, &up->type) ||
374 get_user(kp->flags, &up->flags) ||
375 get_user(kp->memory, &up->memory) ||
376 get_user(kp->input, &up->input))
379 case V4L2_MEMORY_MMAP:
381 case V4L2_MEMORY_USERPTR:
383 unsigned long tmp = (unsigned long)compat_ptr(up->m.userptr);
385 if(get_user(kp->length, &up->length) ||
386 get_user(kp->m.userptr, &tmp))
390 case V4L2_MEMORY_OVERLAY:
391 if(get_user(kp->m.offset, &up->m.offset))
398 static int put_v4l2_buffer32(struct v4l2_buffer *kp, struct v4l2_buffer32 __user *up)
400 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_buffer32)) ||
401 put_user(kp->index, &up->index) ||
402 put_user(kp->type, &up->type) ||
403 put_user(kp->flags, &up->flags) ||
404 put_user(kp->memory, &up->memory) ||
405 put_user(kp->input, &up->input))
408 case V4L2_MEMORY_MMAP:
409 if (put_user(kp->length, &up->length) ||
410 put_user(kp->m.offset, &up->m.offset))
413 case V4L2_MEMORY_USERPTR:
414 if (put_user(kp->length, &up->length) ||
415 put_user(kp->m.userptr, &up->m.userptr))
418 case V4L2_MEMORY_OVERLAY:
419 if (put_user(kp->m.offset, &up->m.offset))
423 if (put_user(kp->bytesused, &up->bytesused) ||
424 put_user(kp->field, &up->field) ||
425 put_user(kp->timestamp.tv_sec, &up->timestamp.tv_sec) ||
426 put_user(kp->timestamp.tv_usec, &up->timestamp.tv_usec) ||
427 copy_to_user(&up->timecode, &kp->timecode, sizeof(struct v4l2_timecode)) ||
428 put_user(kp->sequence, &up->sequence) ||
429 put_user(kp->reserved, &up->reserved))
434 struct v4l2_framebuffer32
439 struct v4l2_pix_format fmt;
442 static int get_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_framebuffer32 __user *up)
446 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_framebuffer32)) ||
447 get_user(tmp, &up->base) ||
448 get_user(kp->capability, &up->capability) ||
449 get_user(kp->flags, &up->flags))
451 kp->base = compat_ptr(tmp);
452 get_v4l2_pix_format(&kp->fmt, &up->fmt);
456 static int put_v4l2_framebuffer32(struct v4l2_framebuffer *kp, struct v4l2_framebuffer32 __user *up)
458 u32 tmp = (u32)((unsigned long)kp->base);
460 if(!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_framebuffer32)) ||
461 put_user(tmp, &up->base) ||
462 put_user(kp->capability, &up->capability) ||
463 put_user(kp->flags, &up->flags))
465 put_v4l2_pix_format(&kp->fmt, &up->fmt);
469 static inline int get_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up)
471 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input) - 4) ||
472 copy_from_user(kp, up, sizeof(struct v4l2_input) - 4))
477 static inline int put_v4l2_input32(struct v4l2_input *kp, struct v4l2_input __user *up)
479 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input) - 4) ||
480 copy_to_user(up, kp, sizeof(struct v4l2_input) - 4))
485 static inline int get_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up)
487 if (!access_ok(VERIFY_READ, up, sizeof(struct v4l2_input)) ||
488 copy_from_user(kp, up, sizeof(struct v4l2_input)))
493 static inline int put_v4l2_input(struct v4l2_input *kp, struct v4l2_input __user *up)
495 if (!access_ok(VERIFY_WRITE, up, sizeof(struct v4l2_input)) ||
496 copy_to_user(up, kp, sizeof(struct v4l2_input)))
501 #define VIDIOCGTUNER32 _IOWR('v',4, struct video_tuner32)
502 #define VIDIOCSTUNER32 _IOW('v',5, struct video_tuner32)
503 #define VIDIOCGWIN32 _IOR('v',9, struct video_window32)
504 #define VIDIOCSWIN32 _IOW('v',10, struct video_window32)
505 #define VIDIOCGFBUF32 _IOR('v',11, struct video_buffer32)
506 #define VIDIOCSFBUF32 _IOW('v',12, struct video_buffer32)
507 #define VIDIOCGFREQ32 _IOR('v',14, u32)
508 #define VIDIOCSFREQ32 _IOW('v',15, u32)
510 /* VIDIOC_ENUMINPUT32 is VIDIOC_ENUMINPUT minus 4 bytes of padding alignement */
511 #define VIDIOC_ENUMINPUT32 VIDIOC_ENUMINPUT - _IOC(0, 0, 0, 4)
512 #define VIDIOC_G_FMT32 _IOWR ('V', 4, struct v4l2_format32)
513 #define VIDIOC_S_FMT32 _IOWR ('V', 5, struct v4l2_format32)
514 #define VIDIOC_QUERYBUF32 _IOWR ('V', 9, struct v4l2_buffer32)
515 #define VIDIOC_G_FBUF32 _IOR ('V', 10, struct v4l2_framebuffer32)
516 #define VIDIOC_S_FBUF32 _IOW ('V', 11, struct v4l2_framebuffer32)
517 /* VIDIOC_OVERLAY is now _IOW, but was _IOWR */
518 #define VIDIOC_OVERLAY32 _IOWR ('V', 14, compat_int_t)
519 #define VIDIOC_QBUF32 _IOWR ('V', 15, struct v4l2_buffer32)
520 #define VIDIOC_DQBUF32 _IOWR ('V', 17, struct v4l2_buffer32)
521 #define VIDIOC_STREAMON32 _IOW ('V', 18, compat_int_t)
522 #define VIDIOC_STREAMOFF32 _IOW ('V', 19, compat_int_t)
523 #define VIDIOC_ENUMSTD32 _IOWR ('V', 25, struct v4l2_standard32)
524 /* VIDIOC_S_CTRL is now _IOWR, but was _IOW */
525 #define VIDIOC_S_CTRL32 _IOW ('V', 28, struct v4l2_control)
526 #define VIDIOC_G_INPUT32 _IOR ('V', 38, compat_int_t)
527 #define VIDIOC_S_INPUT32 _IOWR ('V', 39, compat_int_t)
528 #define VIDIOC_TRY_FMT32 _IOWR ('V', 64, struct v4l2_format32)
531 MaxClips = (~0U-sizeof(struct video_window))/sizeof(struct video_clip)
534 static int do_set_window(struct file *file, unsigned int cmd, unsigned long arg)
536 struct video_window32 __user *up = compat_ptr(arg);
537 struct video_window __user *vw;
538 struct video_clip __user *p;
542 if (!access_ok(VERIFY_READ, up, sizeof(struct video_window32)))
545 if (get_user(nclips, &up->clipcount))
548 /* Peculiar interface... */
550 nclips = VIDEO_CLIPMAP_SIZE;
552 if (nclips > MaxClips)
555 vw = compat_alloc_user_space(sizeof(struct video_window) +
556 nclips * sizeof(struct video_clip));
558 p = nclips ? (struct video_clip __user *)(vw + 1) : NULL;
560 if (get_user(n, &up->x) || put_user(n, &vw->x) ||
561 get_user(n, &up->y) || put_user(n, &vw->y) ||
562 get_user(n, &up->width) || put_user(n, &vw->width) ||
563 get_user(n, &up->height) || put_user(n, &vw->height) ||
564 get_user(n, &up->chromakey) || put_user(n, &vw->chromakey) ||
565 get_user(n, &up->flags) || put_user(n, &vw->flags) ||
566 get_user(n, &up->clipcount) || put_user(n, &vw->clipcount) ||
567 get_user(n, &up->clips) || put_user(p, &vw->clips))
571 struct video_clip32 __user *u = compat_ptr(n);
575 for (i = 0; i < nclips; i++, u++, p++) {
577 if (!access_ok(VERIFY_READ, u, sizeof(struct video_clip32)) ||
578 !access_ok(VERIFY_WRITE, p, sizeof(struct video_clip32)) ||
579 get_user(v, &u->x) ||
580 put_user(v, &p->x) ||
581 get_user(v, &u->y) ||
582 put_user(v, &p->y) ||
583 get_user(v, &u->width) ||
584 put_user(v, &p->width) ||
585 get_user(v, &u->height) ||
586 put_user(v, &p->height) ||
587 put_user(NULL, &p->next))
592 return native_ioctl(file, VIDIOCSWIN, (unsigned long)vw);
595 static int do_video_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
598 struct video_tuner vt;
599 struct video_buffer vb;
600 struct video_window vw;
601 struct v4l2_format v2f;
602 struct v4l2_buffer v2b;
603 struct v4l2_framebuffer v2fb;
604 struct v4l2_standard v2s;
605 struct v4l2_input v2i;
606 struct v4l2_tuner v2t;
609 void __user *up = compat_ptr(arg);
610 int compatible_arg = 1;
614 /* First, convert the command. */
616 case VIDIOCGTUNER32: cmd = VIDIOCGTUNER; break;
617 case VIDIOCSTUNER32: cmd = VIDIOCSTUNER; break;
618 case VIDIOCGWIN32: cmd = VIDIOCGWIN; break;
619 case VIDIOCGFBUF32: cmd = VIDIOCGFBUF; break;
620 case VIDIOCSFBUF32: cmd = VIDIOCSFBUF; break;
621 case VIDIOCGFREQ32: cmd = VIDIOCGFREQ; break;
622 case VIDIOCSFREQ32: cmd = VIDIOCSFREQ; break;
623 case VIDIOC_G_FMT32: cmd = VIDIOC_G_FMT; break;
624 case VIDIOC_S_FMT32: cmd = VIDIOC_S_FMT; break;
625 case VIDIOC_QUERYBUF32: cmd = VIDIOC_QUERYBUF; break;
626 case VIDIOC_QBUF32: cmd = VIDIOC_QBUF; break;
627 case VIDIOC_DQBUF32: cmd = VIDIOC_DQBUF; break;
628 case VIDIOC_STREAMON32: cmd = VIDIOC_STREAMON; break;
629 case VIDIOC_STREAMOFF32: cmd = VIDIOC_STREAMOFF; break;
630 case VIDIOC_G_FBUF32: cmd = VIDIOC_G_FBUF; break;
631 case VIDIOC_S_FBUF32: cmd = VIDIOC_S_FBUF; break;
632 case VIDIOC_OVERLAY32: cmd = VIDIOC_OVERLAY; break;
633 case VIDIOC_ENUMSTD32: realcmd = VIDIOC_ENUMSTD; break;
634 case VIDIOC_ENUMINPUT32: realcmd = VIDIOC_ENUMINPUT; break;
635 case VIDIOC_S_CTRL32: cmd = VIDIOC_S_CTRL; break;
636 case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break;
637 case VIDIOC_S_INPUT32: cmd = VIDIOC_S_INPUT; break;
638 case VIDIOC_TRY_FMT32: cmd = VIDIOC_TRY_FMT; break;
644 err = get_video_tuner32(&karg.vt, up);
650 err = get_video_buffer32(&karg.vb, up);
657 case VIDIOC_STREAMON:
658 case VIDIOC_STREAMOFF:
659 err = get_user(karg.vx, (u32 __user *)up);
664 err = get_v4l2_framebuffer32(&karg.v2fb, up);
671 err = get_v4l2_format32(&karg.v2f, up);
675 case VIDIOC_QUERYBUF:
678 err = get_v4l2_buffer32(&karg.v2b, up);
683 err = get_v4l2_standard(&karg.v2s, up);
687 case VIDIOC_ENUMSTD32:
688 err = get_v4l2_standard32(&karg.v2s, up);
692 case VIDIOC_ENUMINPUT:
693 err = get_v4l2_input(&karg.v2i, up);
697 case VIDIOC_ENUMINPUT32:
698 err = get_v4l2_input32(&karg.v2i, up);
704 err = get_v4l2_tuner(&karg.v2t, up);
720 err = native_ioctl(file, realcmd, (unsigned long)up);
722 mm_segment_t old_fs = get_fs();
725 err = native_ioctl(file, realcmd, (unsigned long)&karg);
731 err = put_video_tuner32(&karg.vt, up);
735 err = put_video_window32(&karg.vw, up);
739 err = put_video_buffer32(&karg.vb, up);
743 err = put_v4l2_framebuffer32(&karg.v2fb, up);
749 err = put_v4l2_format32(&karg.v2f, up);
752 case VIDIOC_QUERYBUF:
755 err = put_v4l2_buffer32(&karg.v2b, up);
759 err = put_v4l2_standard(&karg.v2s, up);
762 case VIDIOC_ENUMSTD32:
763 err = put_v4l2_standard32(&karg.v2s, up);
768 err = put_v4l2_tuner(&karg.v2t, up);
771 case VIDIOC_ENUMINPUT:
772 err = put_v4l2_input(&karg.v2i, up);
775 case VIDIOC_ENUMINPUT32:
776 err = put_v4l2_input32(&karg.v2i, up);
781 err = put_user(((u32)karg.vx), (u32 __user *)up);
789 long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
791 int ret = -ENOIOCTLCMD;
793 if (!file->f_op->ioctl)
798 ret = do_set_window(file, cmd, arg);
807 case VIDIOC_QUERYCAP:
808 case VIDIOC_ENUM_FMT:
812 case VIDIOC_QUERYBUF32:
813 case VIDIOC_G_FBUF32:
814 case VIDIOC_S_FBUF32:
815 case VIDIOC_OVERLAY32:
818 case VIDIOC_STREAMON32:
819 case VIDIOC_STREAMOFF32:
826 case VIDIOC_ENUMSTD32:
827 case VIDIOC_ENUMINPUT:
828 case VIDIOC_ENUMINPUT32:
830 case VIDIOC_S_CTRL32:
831 case VIDIOC_QUERYCTRL:
832 case VIDIOC_G_INPUT32:
833 case VIDIOC_S_INPUT32:
834 case VIDIOC_TRY_FMT32:
835 ret = do_video_ioctl(file, cmd, arg);
838 /* Little v, the video4linux ioctls (conflict?) */
855 /* BTTV specific... */
856 case _IOW('v', BASE_VIDIOCPRIVATE+0, char [256]):
857 case _IOR('v', BASE_VIDIOCPRIVATE+1, char [256]):
858 case _IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int):
859 case _IOW('v' , BASE_VIDIOCPRIVATE+3, char [16]): /* struct bttv_pll_info */
860 case _IOR('v' , BASE_VIDIOCPRIVATE+4, int):
861 case _IOR('v' , BASE_VIDIOCPRIVATE+5, int):
862 case _IOR('v' , BASE_VIDIOCPRIVATE+6, int):
863 case _IOR('v' , BASE_VIDIOCPRIVATE+7, int):
864 ret = native_ioctl(file, cmd, (unsigned long)compat_ptr(arg));
867 v4l_print_ioctl("compat_ioctl32", cmd);
872 long v4l_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
877 EXPORT_SYMBOL_GPL(v4l_compat_ioctl32);
879 MODULE_LICENSE("GPL");