#include <linux/compat.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/v4l2-subdev.h>
#include <linux/videodev2.h>
#include <media/media-device.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include <media/v4l2-device.h>
#include <media/videobuf2-v4l2.h>
#include <media/v4l2-mc.h>
#include <media/v4l2-mem2mem.h>
#include <trace/events/v4l2.h>
#define is_valid_ioctl(vfd, cmd) …
struct std_descr { … };
static const struct std_descr standards[] = …;
const char *v4l2_norm_to_name(v4l2_std_id id)
{ … }
EXPORT_SYMBOL(…);
void v4l2_video_std_frame_period(int id, struct v4l2_fract *frameperiod)
{ … }
EXPORT_SYMBOL(…);
int v4l2_video_std_construct(struct v4l2_standard *vs,
int id, const char *name)
{ … }
EXPORT_SYMBOL(…);
int v4l_video_std_enumstd(struct v4l2_standard *vs, v4l2_std_id id)
{ … }
const char *v4l2_field_names[] = …;
EXPORT_SYMBOL(…);
const char *v4l2_type_names[] = …;
EXPORT_SYMBOL(…);
static const char *v4l2_memory_names[] = …;
#define prt_names(a, arr) …
static void v4l_print_querycap(const void *arg, bool write_only)
{ … }
static void v4l_print_enuminput(const void *arg, bool write_only)
{ … }
static void v4l_print_enumoutput(const void *arg, bool write_only)
{ … }
static void v4l_print_audio(const void *arg, bool write_only)
{ … }
static void v4l_print_audioout(const void *arg, bool write_only)
{ … }
static void v4l_print_fmtdesc(const void *arg, bool write_only)
{ … }
static void v4l_print_format(const void *arg, bool write_only)
{ … }
static void v4l_print_framebuffer(const void *arg, bool write_only)
{ … }
static void v4l_print_buftype(const void *arg, bool write_only)
{ … }
static void v4l_print_modulator(const void *arg, bool write_only)
{ … }
static void v4l_print_tuner(const void *arg, bool write_only)
{ … }
static void v4l_print_frequency(const void *arg, bool write_only)
{ … }
static void v4l_print_standard(const void *arg, bool write_only)
{ … }
static void v4l_print_std(const void *arg, bool write_only)
{ … }
static void v4l_print_hw_freq_seek(const void *arg, bool write_only)
{ … }
static void v4l_print_requestbuffers(const void *arg, bool write_only)
{ … }
static void v4l_print_buffer(const void *arg, bool write_only)
{ … }
static void v4l_print_exportbuffer(const void *arg, bool write_only)
{ … }
static void v4l_print_create_buffers(const void *arg, bool write_only)
{ … }
static void v4l_print_remove_buffers(const void *arg, bool write_only)
{ … }
static void v4l_print_streamparm(const void *arg, bool write_only)
{ … }
static void v4l_print_queryctrl(const void *arg, bool write_only)
{ … }
static void v4l_print_query_ext_ctrl(const void *arg, bool write_only)
{ … }
static void v4l_print_querymenu(const void *arg, bool write_only)
{ … }
static void v4l_print_control(const void *arg, bool write_only)
{ … }
static void v4l_print_ext_controls(const void *arg, bool write_only)
{ … }
static void v4l_print_cropcap(const void *arg, bool write_only)
{ … }
static void v4l_print_crop(const void *arg, bool write_only)
{ … }
static void v4l_print_selection(const void *arg, bool write_only)
{ … }
static void v4l_print_jpegcompression(const void *arg, bool write_only)
{ … }
static void v4l_print_enc_idx(const void *arg, bool write_only)
{ … }
static void v4l_print_encoder_cmd(const void *arg, bool write_only)
{ … }
static void v4l_print_decoder_cmd(const void *arg, bool write_only)
{ … }
static void v4l_print_dbg_chip_info(const void *arg, bool write_only)
{ … }
static void v4l_print_dbg_register(const void *arg, bool write_only)
{ … }
static void v4l_print_dv_timings(const void *arg, bool write_only)
{ … }
static void v4l_print_enum_dv_timings(const void *arg, bool write_only)
{ … }
static void v4l_print_dv_timings_cap(const void *arg, bool write_only)
{ … }
static void v4l_print_frmsizeenum(const void *arg, bool write_only)
{ … }
static void v4l_print_frmivalenum(const void *arg, bool write_only)
{ … }
static void v4l_print_event(const void *arg, bool write_only)
{ … }
static void v4l_print_event_subscription(const void *arg, bool write_only)
{ … }
static void v4l_print_sliced_vbi_cap(const void *arg, bool write_only)
{ … }
static void v4l_print_freq_band(const void *arg, bool write_only)
{ … }
static void v4l_print_edid(const void *arg, bool write_only)
{ … }
static void v4l_print_u32(const void *arg, bool write_only)
{ … }
static void v4l_print_newline(const void *arg, bool write_only)
{ … }
static void v4l_print_default(const void *arg, bool write_only)
{ … }
static bool check_ext_ctrls(struct v4l2_ext_controls *c, unsigned long ioctl)
{ … }
static int check_fmt(struct file *file, enum v4l2_buf_type type)
{ … }
static void v4l_sanitize_colorspace(u32 pixelformat, u32 *colorspace,
u32 *encoding, u32 *quantization,
u32 *xfer_func)
{ … }
static void v4l_sanitize_format(struct v4l2_format *fmt)
{ … }
static int v4l_querycap(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_input(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_output(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_input(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_output(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_priority(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_priority(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_enuminput(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_enumoutput(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt)
{ … }
static int v4l_enum_fmt(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static void v4l_pix_format_touch(struct v4l2_pix_format *p)
{ … }
static int v4l_g_fmt(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_streamon(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_streamoff(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_tuner(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_tuner(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_modulator(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_modulator(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_frequency(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_frequency(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_enumstd(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_std(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_querystd(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_hw_freq_seek(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_fbuf(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_overlay(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_reqbufs(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_querybuf(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_qbuf(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_dqbuf(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_create_bufs(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_prepare_buf(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_remove_bufs(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_parm(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_parm(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_queryctrl(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_query_ext_ctrl(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_querymenu(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_ctrl(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_ctrl(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_ext_ctrls(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_ext_ctrls(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_try_ext_ctrls(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_selection(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_selection(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_crop(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_s_crop(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_cropcap(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_log_status(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_dbg_g_register(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_dbg_s_register(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_dbg_g_chip_info(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_dqevent(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_subscribe_event(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_unsubscribe_event(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_g_sliced_vbi_cap(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
static int v4l_enum_freq_bands(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{ … }
struct v4l2_ioctl_info { … };
#define INFO_FL_PRIO …
#define INFO_FL_CTRL …
#define INFO_FL_QUEUE …
#define INFO_FL_ALWAYS_COPY …
#define INFO_FL_CLEAR(v4l2_struct, field) …
#define INFO_FL_CLEAR_MASK …
#define DEFINE_V4L_STUB_FUNC(_vidioc) …
#define IOCTL_INFO(_ioctl, _func, _debug, _flags) …
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
DEFINE_V4L_STUB_FUNC(…)
static const struct v4l2_ioctl_info v4l2_ioctls[] = …;
#define V4L2_IOCTLS …
static bool v4l2_is_known_ioctl(unsigned int cmd)
{ … }
static struct mutex *v4l2_ioctl_get_lock(struct video_device *vdev,
struct v4l2_fh *vfh, unsigned int cmd,
void *arg)
{ … }
void v4l_printk_ioctl(const char *prefix, unsigned int cmd)
{ … }
EXPORT_SYMBOL(…);
static long __video_do_ioctl(struct file *file,
unsigned int cmd, void *arg)
{ … }
static int check_array_args(unsigned int cmd, void *parg, size_t *array_size,
void __user **user_ptr, void ***kernel_ptr)
{ … }
static unsigned int video_translate_cmd(unsigned int cmd)
{ … }
static int video_get_user(void __user *arg, void *parg,
unsigned int real_cmd, unsigned int cmd,
bool *always_copy)
{ … }
static int video_put_user(void __user *arg, void *parg,
unsigned int real_cmd, unsigned int cmd)
{ … }
long
video_usercopy(struct file *file, unsigned int orig_cmd, unsigned long arg,
v4l2_kioctl func)
{ … }
long video_ioctl2(struct file *file,
unsigned int cmd, unsigned long arg)
{ … }
EXPORT_SYMBOL(…);