long
v4l_compat_translate_ioctl(struct file		*file,
			   int			cmd,
			   void			*arg,
			   v4l2_kioctl          drv)
{
	long err;

	switch (cmd) {
	case VIDIOCGCAP:	/* capability */
		err = v4l1_compat_get_capabilities(arg, file, drv);
		break;
	case VIDIOCGFBUF: /*  get frame buffer  */
		err = v4l1_compat_get_frame_buffer(arg, file, drv);
		break;
	case VIDIOCSFBUF: /*  set frame buffer  */
		err = v4l1_compat_set_frame_buffer(arg, file, drv);
		break;
	case VIDIOCGWIN: /*  get window or capture dimensions  */
		err = v4l1_compat_get_win_cap_dimensions(arg, file, drv);
		break;
	case VIDIOCSWIN: /*  set window and/or capture dimensions  */
		err = v4l1_compat_set_win_cap_dimensions(arg, file, drv);
		break;
	case VIDIOCCAPTURE: /*  turn on/off preview  */
		err = v4l1_compat_turn_preview_on_off(arg, file, drv);
		break;
	case VIDIOCGCHAN: /*  get input information  */
		err = v4l1_compat_get_input_info(arg, file, drv);
		break;
	case VIDIOCSCHAN: /*  set input  */
		err = v4l1_compat_set_input(arg, file, drv);
		break;
	case VIDIOCGPICT: /*  get tone controls & partial capture format  */
		err = v4l1_compat_get_picture(arg, file, drv);
		break;
	case VIDIOCSPICT: /*  set tone controls & partial capture format  */
		err = v4l1_compat_set_picture(arg, file, drv);
		break;
	case VIDIOCGTUNER: /*  get tuner information  */
		err = v4l1_compat_get_tuner(arg, file, drv);
		break;
	case VIDIOCSTUNER: /*  select a tuner input  */
		err = v4l1_compat_select_tuner(arg, file, drv);
		break;
	case VIDIOCGFREQ: /*  get frequency  */
		err = v4l1_compat_get_frequency(arg, file, drv);
		break;
	case VIDIOCSFREQ: /*  set frequency  */
		err = v4l1_compat_set_frequency(arg, file, drv);
		break;
	case VIDIOCGAUDIO: /*  get audio properties/controls  */
		err = v4l1_compat_get_audio(arg, file, drv);
		break;
	case VIDIOCSAUDIO: /*  set audio controls  */
		err = v4l1_compat_set_audio(arg, file, drv);
		break;
	case VIDIOCMCAPTURE: /*  capture a frame  */
		err = v4l1_compat_capture_frame(arg, file, drv);
		break;
	case VIDIOCSYNC: /*  wait for a frame  */
		err = v4l1_compat_sync(arg, file, drv);
		break;
	case VIDIOCGVBIFMT: /* query VBI data capture format */
		err = v4l1_compat_get_vbi_format(arg, file, drv);
		break;
	case VIDIOCSVBIFMT:
		err = v4l1_compat_set_vbi_format(arg, file, drv);
		break;
	default:
		err = -ENOIOCTLCMD;
		break;
	}

	return err;
}
Example #2
0
long
v4l_compat_translate_ioctl(struct file		*file,
			   int			cmd,
			   void			*arg,
			   v4l2_kioctl          drv)
{
	long err;

	switch (cmd) {
	case VIDIOCGCAP:	
		err = v4l1_compat_get_capabilities(arg, file, drv);
		break;
	case VIDIOCGFBUF: 
		err = v4l1_compat_get_frame_buffer(arg, file, drv);
		break;
	case VIDIOCSFBUF: 
		err = v4l1_compat_set_frame_buffer(arg, file, drv);
		break;
	case VIDIOCGWIN: 
		err = v4l1_compat_get_win_cap_dimensions(arg, file, drv);
		break;
	case VIDIOCSWIN: 
		err = v4l1_compat_set_win_cap_dimensions(arg, file, drv);
		break;
	case VIDIOCCAPTURE: 
		err = v4l1_compat_turn_preview_on_off(arg, file, drv);
		break;
	case VIDIOCGCHAN: 
		err = v4l1_compat_get_input_info(arg, file, drv);
		break;
	case VIDIOCSCHAN: 
		err = v4l1_compat_set_input(arg, file, drv);
		break;
	case VIDIOCGPICT: 
		err = v4l1_compat_get_picture(arg, file, drv);
		break;
	case VIDIOCSPICT: 
		err = v4l1_compat_set_picture(arg, file, drv);
		break;
	case VIDIOCGTUNER: 
		err = v4l1_compat_get_tuner(arg, file, drv);
		break;
	case VIDIOCSTUNER: 
		err = v4l1_compat_select_tuner(arg, file, drv);
		break;
	case VIDIOCGFREQ: 
		err = v4l1_compat_get_frequency(arg, file, drv);
		break;
	case VIDIOCSFREQ: 
		err = v4l1_compat_set_frequency(arg, file, drv);
		break;
	case VIDIOCGAUDIO: 
		err = v4l1_compat_get_audio(arg, file, drv);
		break;
	case VIDIOCSAUDIO: 
		err = v4l1_compat_set_audio(arg, file, drv);
		break;
	case VIDIOCMCAPTURE: 
		err = v4l1_compat_capture_frame(arg, file, drv);
		break;
	case VIDIOCSYNC: 
		err = v4l1_compat_sync(arg, file, drv);
		break;
	case VIDIOCGVBIFMT: 
		err = v4l1_compat_get_vbi_format(arg, file, drv);
		break;
	case VIDIOCSVBIFMT:
		err = v4l1_compat_set_vbi_format(arg, file, drv);
		break;
	default:
		err = -ENOIOCTLCMD;
		break;
	}

	return err;
}