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@ucw.cz)
9 * Copyright (C) 2005 Philippe De Muyter (phdm@macqel.be)
10 * Copyright (C) 2008 Hans Verkuil <hverkuil@xs4all.nl>
12 * These routines maintain argument size conversion between 32bit and 64bit
16 #include <linux/compat.h>
17 #define __OLD_VIDIOC_ /* To allow fixing old calls*/
18 #include <linux/videodev2.h>
19 #include <linux/module.h>
20 #include <media/v4l2-ioctl.h>
24 static long native_ioctl(struct file
*file
, unsigned int cmd
, unsigned long arg
)
26 long ret
= -ENOIOCTLCMD
;
28 if (file
->f_op
->unlocked_ioctl
)
29 ret
= file
->f_op
->unlocked_ioctl(file
, cmd
, arg
);
40 struct v4l2_window32
{
42 enum v4l2_field field
;
44 compat_caddr_t clips
; /* actually struct v4l2_clip32 * */
46 compat_caddr_t bitmap
;
49 static int get_v4l2_window32(struct v4l2_window
*kp
, struct v4l2_window32 __user
*up
)
51 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_window32
)) ||
52 copy_from_user(&kp
->w
, &up
->w
, sizeof(up
->w
)) ||
53 get_user(kp
->field
, &up
->field
) ||
54 get_user(kp
->chromakey
, &up
->chromakey
) ||
55 get_user(kp
->clipcount
, &up
->clipcount
))
57 if (kp
->clipcount
> 2048)
60 struct v4l2_clip32 __user
*uclips
;
61 struct v4l2_clip __user
*kclips
;
62 int n
= kp
->clipcount
;
65 if (get_user(p
, &up
->clips
))
67 uclips
= compat_ptr(p
);
68 kclips
= compat_alloc_user_space(n
* sizeof(struct v4l2_clip
));
71 if (copy_in_user(&kclips
->c
, &uclips
->c
, sizeof(uclips
->c
)))
73 if (put_user(n
? kclips
+ 1 : NULL
, &kclips
->next
))
83 static int put_v4l2_window32(struct v4l2_window
*kp
, struct v4l2_window32 __user
*up
)
85 if (copy_to_user(&up
->w
, &kp
->w
, sizeof(kp
->w
)) ||
86 put_user(kp
->field
, &up
->field
) ||
87 put_user(kp
->chromakey
, &up
->chromakey
) ||
88 put_user(kp
->clipcount
, &up
->clipcount
))
93 static inline int get_v4l2_pix_format(struct v4l2_pix_format
*kp
, struct v4l2_pix_format __user
*up
)
95 if (copy_from_user(kp
, up
, sizeof(struct v4l2_pix_format
)))
100 static inline int put_v4l2_pix_format(struct v4l2_pix_format
*kp
, struct v4l2_pix_format __user
*up
)
102 if (copy_to_user(up
, kp
, sizeof(struct v4l2_pix_format
)))
107 static inline int get_v4l2_vbi_format(struct v4l2_vbi_format
*kp
, struct v4l2_vbi_format __user
*up
)
109 if (copy_from_user(kp
, up
, sizeof(struct v4l2_vbi_format
)))
114 static inline int put_v4l2_vbi_format(struct v4l2_vbi_format
*kp
, struct v4l2_vbi_format __user
*up
)
116 if (copy_to_user(up
, kp
, sizeof(struct v4l2_vbi_format
)))
121 static inline int get_v4l2_sliced_vbi_format(struct v4l2_sliced_vbi_format
*kp
, struct v4l2_sliced_vbi_format __user
*up
)
123 if (copy_from_user(kp
, up
, sizeof(struct v4l2_sliced_vbi_format
)))
128 static inline int put_v4l2_sliced_vbi_format(struct v4l2_sliced_vbi_format
*kp
, struct v4l2_sliced_vbi_format __user
*up
)
130 if (copy_to_user(up
, kp
, sizeof(struct v4l2_sliced_vbi_format
)))
135 struct v4l2_format32
{
136 enum v4l2_buf_type type
;
138 struct v4l2_pix_format pix
;
139 struct v4l2_window32 win
;
140 struct v4l2_vbi_format vbi
;
141 struct v4l2_sliced_vbi_format sliced
;
142 __u8 raw_data
[200]; /* user-defined */
146 static int get_v4l2_format32(struct v4l2_format
*kp
, struct v4l2_format32 __user
*up
)
148 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_format32
)) ||
149 get_user(kp
->type
, &up
->type
))
152 case V4L2_BUF_TYPE_VIDEO_CAPTURE
:
153 case V4L2_BUF_TYPE_VIDEO_OUTPUT
:
154 return get_v4l2_pix_format(&kp
->fmt
.pix
, &up
->fmt
.pix
);
155 case V4L2_BUF_TYPE_VIDEO_OVERLAY
:
156 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
:
157 return get_v4l2_window32(&kp
->fmt
.win
, &up
->fmt
.win
);
158 case V4L2_BUF_TYPE_VBI_CAPTURE
:
159 case V4L2_BUF_TYPE_VBI_OUTPUT
:
160 return get_v4l2_vbi_format(&kp
->fmt
.vbi
, &up
->fmt
.vbi
);
161 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
:
162 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
:
163 return get_v4l2_sliced_vbi_format(&kp
->fmt
.sliced
, &up
->fmt
.sliced
);
164 case V4L2_BUF_TYPE_PRIVATE
:
165 if (copy_from_user(kp
, up
, sizeof(kp
->fmt
.raw_data
)))
169 printk(KERN_INFO
"compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
175 static int put_v4l2_format32(struct v4l2_format
*kp
, struct v4l2_format32 __user
*up
)
177 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct v4l2_format32
)) ||
178 put_user(kp
->type
, &up
->type
))
181 case V4L2_BUF_TYPE_VIDEO_CAPTURE
:
182 case V4L2_BUF_TYPE_VIDEO_OUTPUT
:
183 return put_v4l2_pix_format(&kp
->fmt
.pix
, &up
->fmt
.pix
);
184 case V4L2_BUF_TYPE_VIDEO_OVERLAY
:
185 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY
:
186 return put_v4l2_window32(&kp
->fmt
.win
, &up
->fmt
.win
);
187 case V4L2_BUF_TYPE_VBI_CAPTURE
:
188 case V4L2_BUF_TYPE_VBI_OUTPUT
:
189 return put_v4l2_vbi_format(&kp
->fmt
.vbi
, &up
->fmt
.vbi
);
190 case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE
:
191 case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT
:
192 return put_v4l2_sliced_vbi_format(&kp
->fmt
.sliced
, &up
->fmt
.sliced
);
193 case V4L2_BUF_TYPE_PRIVATE
:
194 if (copy_to_user(up
, kp
, sizeof(up
->fmt
.raw_data
)))
198 printk(KERN_INFO
"compat_ioctl32: unexpected VIDIOC_FMT type %d\n",
204 struct v4l2_standard32
{
206 __u32 id
[2]; /* __u64 would get the alignment wrong */
208 struct v4l2_fract frameperiod
; /* Frames, not fields */
213 static int get_v4l2_standard32(struct v4l2_standard
*kp
, struct v4l2_standard32 __user
*up
)
215 /* other fields are not set by the user, nor used by the driver */
216 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_standard32
)) ||
217 get_user(kp
->index
, &up
->index
))
222 static int put_v4l2_standard32(struct v4l2_standard
*kp
, struct v4l2_standard32 __user
*up
)
224 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct v4l2_standard32
)) ||
225 put_user(kp
->index
, &up
->index
) ||
226 copy_to_user(up
->id
, &kp
->id
, sizeof(__u64
)) ||
227 copy_to_user(up
->name
, kp
->name
, 24) ||
228 copy_to_user(&up
->frameperiod
, &kp
->frameperiod
, sizeof(kp
->frameperiod
)) ||
229 put_user(kp
->framelines
, &up
->framelines
) ||
230 copy_to_user(up
->reserved
, kp
->reserved
, 4 * sizeof(__u32
)))
235 struct v4l2_buffer32
{
237 enum v4l2_buf_type type
;
240 enum v4l2_field field
;
241 struct compat_timeval timestamp
;
242 struct v4l2_timecode timecode
;
245 /* memory location */
246 enum v4l2_memory memory
;
249 compat_long_t userptr
;
256 static int get_v4l2_buffer32(struct v4l2_buffer
*kp
, struct v4l2_buffer32 __user
*up
)
259 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_buffer32
)) ||
260 get_user(kp
->index
, &up
->index
) ||
261 get_user(kp
->type
, &up
->type
) ||
262 get_user(kp
->flags
, &up
->flags
) ||
263 get_user(kp
->memory
, &up
->memory
) ||
264 get_user(kp
->input
, &up
->input
))
266 switch (kp
->memory
) {
267 case V4L2_MEMORY_MMAP
:
268 if (get_user(kp
->length
, &up
->length
) ||
269 get_user(kp
->m
.offset
, &up
->m
.offset
))
272 case V4L2_MEMORY_USERPTR
:
276 if (get_user(kp
->length
, &up
->length
) ||
277 get_user(tmp
, &up
->m
.userptr
))
280 kp
->m
.userptr
= (unsigned long)compat_ptr(tmp
);
283 case V4L2_MEMORY_OVERLAY
:
284 if (get_user(kp
->m
.offset
, &up
->m
.offset
))
291 static int put_v4l2_buffer32(struct v4l2_buffer
*kp
, struct v4l2_buffer32 __user
*up
)
293 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct v4l2_buffer32
)) ||
294 put_user(kp
->index
, &up
->index
) ||
295 put_user(kp
->type
, &up
->type
) ||
296 put_user(kp
->flags
, &up
->flags
) ||
297 put_user(kp
->memory
, &up
->memory
) ||
298 put_user(kp
->input
, &up
->input
))
300 switch (kp
->memory
) {
301 case V4L2_MEMORY_MMAP
:
302 if (put_user(kp
->length
, &up
->length
) ||
303 put_user(kp
->m
.offset
, &up
->m
.offset
))
306 case V4L2_MEMORY_USERPTR
:
307 if (put_user(kp
->length
, &up
->length
) ||
308 put_user(kp
->m
.userptr
, &up
->m
.userptr
))
311 case V4L2_MEMORY_OVERLAY
:
312 if (put_user(kp
->m
.offset
, &up
->m
.offset
))
316 if (put_user(kp
->bytesused
, &up
->bytesused
) ||
317 put_user(kp
->field
, &up
->field
) ||
318 put_user(kp
->timestamp
.tv_sec
, &up
->timestamp
.tv_sec
) ||
319 put_user(kp
->timestamp
.tv_usec
, &up
->timestamp
.tv_usec
) ||
320 copy_to_user(&up
->timecode
, &kp
->timecode
, sizeof(struct v4l2_timecode
)) ||
321 put_user(kp
->sequence
, &up
->sequence
) ||
322 put_user(kp
->reserved
, &up
->reserved
))
327 struct v4l2_framebuffer32
{
331 struct v4l2_pix_format fmt
;
334 static int get_v4l2_framebuffer32(struct v4l2_framebuffer
*kp
, struct v4l2_framebuffer32 __user
*up
)
338 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_framebuffer32
)) ||
339 get_user(tmp
, &up
->base
) ||
340 get_user(kp
->capability
, &up
->capability
) ||
341 get_user(kp
->flags
, &up
->flags
))
343 kp
->base
= compat_ptr(tmp
);
344 get_v4l2_pix_format(&kp
->fmt
, &up
->fmt
);
348 static int put_v4l2_framebuffer32(struct v4l2_framebuffer
*kp
, struct v4l2_framebuffer32 __user
*up
)
350 u32 tmp
= (u32
)((unsigned long)kp
->base
);
352 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct v4l2_framebuffer32
)) ||
353 put_user(tmp
, &up
->base
) ||
354 put_user(kp
->capability
, &up
->capability
) ||
355 put_user(kp
->flags
, &up
->flags
))
357 put_v4l2_pix_format(&kp
->fmt
, &up
->fmt
);
361 struct v4l2_input32
{
362 __u32 index
; /* Which input */
363 __u8 name
[32]; /* Label */
364 __u32 type
; /* Type of input */
365 __u32 audioset
; /* Associated audios (bitfield) */
366 __u32 tuner
; /* Associated tuner */
370 } __attribute__ ((packed
));
372 /* The 64-bit v4l2_input struct has extra padding at the end of the struct.
373 Otherwise it is identical to the 32-bit version. */
374 static inline int get_v4l2_input32(struct v4l2_input
*kp
, struct v4l2_input32 __user
*up
)
376 if (copy_from_user(kp
, up
, sizeof(struct v4l2_input32
)))
381 static inline int put_v4l2_input32(struct v4l2_input
*kp
, struct v4l2_input32 __user
*up
)
383 if (copy_to_user(up
, kp
, sizeof(struct v4l2_input32
)))
388 struct v4l2_ext_controls32
{
393 compat_caddr_t controls
; /* actually struct v4l2_ext_control32 * */
396 struct v4l2_ext_control32
{
403 compat_caddr_t string
; /* actually char * */
405 } __attribute__ ((packed
));
407 /* The following function really belong in v4l2-common, but that causes
408 a circular dependency between modules. We need to think about this, but
409 for now this will do. */
411 /* Return non-zero if this control is a pointer type. Currently only
412 type STRING is a pointer type. */
413 static inline int ctrl_is_pointer(u32 id
)
416 case V4L2_CID_RDS_TX_PS_NAME
:
417 case V4L2_CID_RDS_TX_RADIO_TEXT
:
424 static int get_v4l2_ext_controls32(struct v4l2_ext_controls
*kp
, struct v4l2_ext_controls32 __user
*up
)
426 struct v4l2_ext_control32 __user
*ucontrols
;
427 struct v4l2_ext_control __user
*kcontrols
;
431 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_ext_controls32
)) ||
432 get_user(kp
->ctrl_class
, &up
->ctrl_class
) ||
433 get_user(kp
->count
, &up
->count
) ||
434 get_user(kp
->error_idx
, &up
->error_idx
) ||
435 copy_from_user(kp
->reserved
, up
->reserved
, sizeof(kp
->reserved
)))
442 if (get_user(p
, &up
->controls
))
444 ucontrols
= compat_ptr(p
);
445 if (!access_ok(VERIFY_READ
, ucontrols
, n
* sizeof(struct v4l2_ext_control
)))
447 kcontrols
= compat_alloc_user_space(n
* sizeof(struct v4l2_ext_control
));
448 kp
->controls
= kcontrols
;
450 if (copy_in_user(kcontrols
, ucontrols
, sizeof(*kcontrols
)))
452 if (ctrl_is_pointer(kcontrols
->id
)) {
455 if (get_user(p
, &ucontrols
->string
))
458 if (put_user(s
, &kcontrols
->string
))
467 static int put_v4l2_ext_controls32(struct v4l2_ext_controls
*kp
, struct v4l2_ext_controls32 __user
*up
)
469 struct v4l2_ext_control32 __user
*ucontrols
;
470 struct v4l2_ext_control __user
*kcontrols
= kp
->controls
;
474 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct v4l2_ext_controls32
)) ||
475 put_user(kp
->ctrl_class
, &up
->ctrl_class
) ||
476 put_user(kp
->count
, &up
->count
) ||
477 put_user(kp
->error_idx
, &up
->error_idx
) ||
478 copy_to_user(up
->reserved
, kp
->reserved
, sizeof(up
->reserved
)))
483 if (get_user(p
, &up
->controls
))
485 ucontrols
= compat_ptr(p
);
486 if (!access_ok(VERIFY_WRITE
, ucontrols
, n
* sizeof(struct v4l2_ext_control
)))
490 unsigned size
= sizeof(*ucontrols
);
492 /* Do not modify the pointer when copying a pointer control.
493 The contents of the pointer was changed, not the pointer
495 if (ctrl_is_pointer(kcontrols
->id
))
496 size
-= sizeof(ucontrols
->value64
);
497 if (copy_in_user(ucontrols
, kcontrols
, size
))
505 #define VIDIOC_G_FMT32 _IOWR('V', 4, struct v4l2_format32)
506 #define VIDIOC_S_FMT32 _IOWR('V', 5, struct v4l2_format32)
507 #define VIDIOC_QUERYBUF32 _IOWR('V', 9, struct v4l2_buffer32)
508 #define VIDIOC_G_FBUF32 _IOR ('V', 10, struct v4l2_framebuffer32)
509 #define VIDIOC_S_FBUF32 _IOW ('V', 11, struct v4l2_framebuffer32)
510 #define VIDIOC_QBUF32 _IOWR('V', 15, struct v4l2_buffer32)
511 #define VIDIOC_DQBUF32 _IOWR('V', 17, struct v4l2_buffer32)
512 #define VIDIOC_ENUMSTD32 _IOWR('V', 25, struct v4l2_standard32)
513 #define VIDIOC_ENUMINPUT32 _IOWR('V', 26, struct v4l2_input32)
514 #define VIDIOC_TRY_FMT32 _IOWR('V', 64, struct v4l2_format32)
515 #define VIDIOC_G_EXT_CTRLS32 _IOWR('V', 71, struct v4l2_ext_controls32)
516 #define VIDIOC_S_EXT_CTRLS32 _IOWR('V', 72, struct v4l2_ext_controls32)
517 #define VIDIOC_TRY_EXT_CTRLS32 _IOWR('V', 73, struct v4l2_ext_controls32)
519 #define VIDIOC_OVERLAY32 _IOW ('V', 14, s32)
521 #define VIDIOC_OVERLAY32_OLD _IOWR('V', 14, s32)
523 #define VIDIOC_STREAMON32 _IOW ('V', 18, s32)
524 #define VIDIOC_STREAMOFF32 _IOW ('V', 19, s32)
525 #define VIDIOC_G_INPUT32 _IOR ('V', 38, s32)
526 #define VIDIOC_S_INPUT32 _IOWR('V', 39, s32)
527 #define VIDIOC_G_OUTPUT32 _IOR ('V', 46, s32)
528 #define VIDIOC_S_OUTPUT32 _IOWR('V', 47, s32)
530 static long do_video_ioctl(struct file
*file
, unsigned int cmd
, unsigned long arg
)
533 struct v4l2_format v2f
;
534 struct v4l2_buffer v2b
;
535 struct v4l2_framebuffer v2fb
;
536 struct v4l2_input v2i
;
537 struct v4l2_standard v2s
;
538 struct v4l2_ext_controls v2ecs
;
542 void __user
*up
= compat_ptr(arg
);
543 int compatible_arg
= 1;
546 /* First, convert the command. */
548 case VIDIOC_G_FMT32
: cmd
= VIDIOC_G_FMT
; break;
549 case VIDIOC_S_FMT32
: cmd
= VIDIOC_S_FMT
; break;
550 case VIDIOC_QUERYBUF32
: cmd
= VIDIOC_QUERYBUF
; break;
551 case VIDIOC_G_FBUF32
: cmd
= VIDIOC_G_FBUF
; break;
552 case VIDIOC_S_FBUF32
: cmd
= VIDIOC_S_FBUF
; break;
553 case VIDIOC_QBUF32
: cmd
= VIDIOC_QBUF
; break;
554 case VIDIOC_DQBUF32
: cmd
= VIDIOC_DQBUF
; break;
555 case VIDIOC_ENUMSTD32
: cmd
= VIDIOC_ENUMSTD
; break;
556 case VIDIOC_ENUMINPUT32
: cmd
= VIDIOC_ENUMINPUT
; break;
557 case VIDIOC_TRY_FMT32
: cmd
= VIDIOC_TRY_FMT
; break;
558 case VIDIOC_G_EXT_CTRLS32
: cmd
= VIDIOC_G_EXT_CTRLS
; break;
559 case VIDIOC_S_EXT_CTRLS32
: cmd
= VIDIOC_S_EXT_CTRLS
; break;
560 case VIDIOC_TRY_EXT_CTRLS32
: cmd
= VIDIOC_TRY_EXT_CTRLS
; break;
561 case VIDIOC_OVERLAY32
: cmd
= VIDIOC_OVERLAY
; break;
563 case VIDIOC_OVERLAY32_OLD
: cmd
= VIDIOC_OVERLAY
; break;
565 case VIDIOC_STREAMON32
: cmd
= VIDIOC_STREAMON
; break;
566 case VIDIOC_STREAMOFF32
: cmd
= VIDIOC_STREAMOFF
; break;
567 case VIDIOC_G_INPUT32
: cmd
= VIDIOC_G_INPUT
; break;
568 case VIDIOC_S_INPUT32
: cmd
= VIDIOC_S_INPUT
; break;
569 case VIDIOC_G_OUTPUT32
: cmd
= VIDIOC_G_OUTPUT
; break;
570 case VIDIOC_S_OUTPUT32
: cmd
= VIDIOC_S_OUTPUT
; break;
575 case VIDIOC_STREAMON
:
576 case VIDIOC_STREAMOFF
:
578 case VIDIOC_S_OUTPUT
:
579 err
= get_user(karg
.vi
, (s32 __user
*)up
);
584 case VIDIOC_G_OUTPUT
:
591 err
= get_v4l2_format32(&karg
.v2f
, up
);
595 case VIDIOC_QUERYBUF
:
598 err
= get_v4l2_buffer32(&karg
.v2b
, up
);
603 err
= get_v4l2_framebuffer32(&karg
.v2fb
, up
);
612 err
= get_v4l2_standard32(&karg
.v2s
, up
);
616 case VIDIOC_ENUMINPUT
:
617 err
= get_v4l2_input32(&karg
.v2i
, up
);
621 case VIDIOC_G_EXT_CTRLS
:
622 case VIDIOC_S_EXT_CTRLS
:
623 case VIDIOC_TRY_EXT_CTRLS
:
624 err
= get_v4l2_ext_controls32(&karg
.v2ecs
, up
);
632 err
= native_ioctl(file
, cmd
, (unsigned long)up
);
634 mm_segment_t old_fs
= get_fs();
637 err
= native_ioctl(file
, cmd
, (unsigned long)&karg
);
641 /* Special case: even after an error we need to put the
642 results back for these ioctls since the error_idx will
643 contain information on which control failed. */
645 case VIDIOC_G_EXT_CTRLS
:
646 case VIDIOC_S_EXT_CTRLS
:
647 case VIDIOC_TRY_EXT_CTRLS
:
648 if (put_v4l2_ext_controls32(&karg
.v2ecs
, up
))
657 case VIDIOC_S_OUTPUT
:
659 case VIDIOC_G_OUTPUT
:
660 err
= put_user(((s32
)karg
.vi
), (s32 __user
*)up
);
664 err
= put_v4l2_framebuffer32(&karg
.v2fb
, up
);
670 err
= put_v4l2_format32(&karg
.v2f
, up
);
673 case VIDIOC_QUERYBUF
:
676 err
= put_v4l2_buffer32(&karg
.v2b
, up
);
680 err
= put_v4l2_standard32(&karg
.v2s
, up
);
683 case VIDIOC_ENUMINPUT
:
684 err
= put_v4l2_input32(&karg
.v2i
, up
);
690 long v4l2_compat_ioctl32(struct file
*file
, unsigned int cmd
, unsigned long arg
)
692 long ret
= -ENOIOCTLCMD
;
694 if (!file
->f_op
->unlocked_ioctl
)
699 case VIDIOC_OVERLAY32_OLD
:
700 case VIDIOC_S_PARM_OLD
:
701 case VIDIOC_S_CTRL_OLD
:
702 case VIDIOC_G_AUDIO_OLD
:
703 case VIDIOC_G_AUDOUT_OLD
:
704 case VIDIOC_CROPCAP_OLD
:
706 case VIDIOC_QUERYCAP
:
707 case VIDIOC_RESERVED
:
708 case VIDIOC_ENUM_FMT
:
712 case VIDIOC_QUERYBUF32
:
713 case VIDIOC_G_FBUF32
:
714 case VIDIOC_S_FBUF32
:
715 case VIDIOC_OVERLAY32
:
718 case VIDIOC_STREAMON32
:
719 case VIDIOC_STREAMOFF32
:
724 case VIDIOC_ENUMSTD32
:
725 case VIDIOC_ENUMINPUT32
:
732 case VIDIOC_QUERYCTRL
:
733 case VIDIOC_QUERYMENU
:
734 case VIDIOC_G_INPUT32
:
735 case VIDIOC_S_INPUT32
:
736 case VIDIOC_G_OUTPUT32
:
737 case VIDIOC_S_OUTPUT32
:
738 case VIDIOC_ENUMOUTPUT
:
739 case VIDIOC_G_AUDOUT
:
740 case VIDIOC_S_AUDOUT
:
741 case VIDIOC_G_MODULATOR
:
742 case VIDIOC_S_MODULATOR
:
743 case VIDIOC_S_FREQUENCY
:
744 case VIDIOC_G_FREQUENCY
:
748 case VIDIOC_G_JPEGCOMP
:
749 case VIDIOC_S_JPEGCOMP
:
750 case VIDIOC_QUERYSTD
:
751 case VIDIOC_TRY_FMT32
:
752 case VIDIOC_ENUMAUDIO
:
753 case VIDIOC_ENUMAUDOUT
:
754 case VIDIOC_G_PRIORITY
:
755 case VIDIOC_S_PRIORITY
:
756 case VIDIOC_G_SLICED_VBI_CAP
:
757 case VIDIOC_LOG_STATUS
:
758 case VIDIOC_G_EXT_CTRLS32
:
759 case VIDIOC_S_EXT_CTRLS32
:
760 case VIDIOC_TRY_EXT_CTRLS32
:
761 case VIDIOC_ENUM_FRAMESIZES
:
762 case VIDIOC_ENUM_FRAMEINTERVALS
:
763 case VIDIOC_G_ENC_INDEX
:
764 case VIDIOC_ENCODER_CMD
:
765 case VIDIOC_TRY_ENCODER_CMD
:
766 case VIDIOC_DBG_S_REGISTER
:
767 case VIDIOC_DBG_G_REGISTER
:
768 case VIDIOC_DBG_G_CHIP_IDENT
:
769 case VIDIOC_S_HW_FREQ_SEEK
:
770 case VIDIOC_ENUM_DV_PRESETS
:
771 case VIDIOC_S_DV_PRESET
:
772 case VIDIOC_G_DV_PRESET
:
773 case VIDIOC_QUERY_DV_PRESET
:
774 case VIDIOC_S_DV_TIMINGS
:
775 case VIDIOC_G_DV_TIMINGS
:
777 case VIDIOC_SUBSCRIBE_EVENT
:
778 case VIDIOC_UNSUBSCRIBE_EVENT
:
779 ret
= do_video_ioctl(file
, cmd
, arg
);
783 printk(KERN_WARNING
"compat_ioctl32: "
784 "unknown ioctl '%c', dir=%d, #%d (0x%08x)\n",
785 _IOC_TYPE(cmd
), _IOC_DIR(cmd
), _IOC_NR(cmd
), cmd
);
790 EXPORT_SYMBOL_GPL(v4l2_compat_ioctl32
);
793 MODULE_LICENSE("GPL");