Commit 7ee40aad authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] v4l: removal of old, obsolete ioctls

Some ioctl's were defined wrong on 2.6.2 and 2.6.6, using the wrong
type of R/W arguments. They were fixed, but the old ioctl names are
still there, maintained to avoid breaking binary compatibility:

There's no sense on preserving those forever, as it is very doubtful
that someone would try to use a such old binary with a modern kernel.
Removing them will allow us to remove some magic done at the V4L ioctl
handler.

Note that any application compiled with a videodev2.h from 2.6.7 or later
will be using the correct ioctls.
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent dae86ccb
...@@ -97,27 +97,6 @@ Who: Pavel Machek <pavel@ucw.cz> ...@@ -97,27 +97,6 @@ Who: Pavel Machek <pavel@ucw.cz>
--------------------------- ---------------------------
What: Video4Linux: Remove obsolete ioctl's
When: kernel 2.6.39
Files: include/media/videodev2.h
Why: Some ioctl's were defined wrong on 2.6.2 and 2.6.6, using the wrong
type of R/W arguments. They were fixed, but the old ioctl names are
still there, maintained to avoid breaking binary compatibility:
#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm)
#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control)
#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio)
#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout)
#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap)
There's no sense on preserving those forever, as it is very doubtful
that someone would try to use a such old binary with a modern kernel.
Removing them will allow us to remove some magic done at the V4L ioctl
handler.
Who: Mauro Carvalho Chehab <mchehab@infradead.org>
---------------------------
What: sys_sysctl What: sys_sysctl
When: September 2010 When: September 2010
Option: CONFIG_SYSCTL_SYSCALL Option: CONFIG_SYSCTL_SYSCALL
......
...@@ -59,7 +59,6 @@ ...@@ -59,7 +59,6 @@
#include <asm/pgtable.h> #include <asm/pgtable.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/div64.h> #include <asm/div64.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls*/
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
*/ */
#include <linux/compat.h> #include <linux/compat.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls*/
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <linux/module.h> #include <linux/module.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
...@@ -678,9 +677,6 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext ...@@ -678,9 +677,6 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
#define VIDIOC_TRY_EXT_CTRLS32 _IOWR('V', 73, struct v4l2_ext_controls32) #define VIDIOC_TRY_EXT_CTRLS32 _IOWR('V', 73, struct v4l2_ext_controls32)
#define VIDIOC_OVERLAY32 _IOW ('V', 14, s32) #define VIDIOC_OVERLAY32 _IOW ('V', 14, s32)
#ifdef __OLD_VIDIOC_
#define VIDIOC_OVERLAY32_OLD _IOWR('V', 14, s32)
#endif
#define VIDIOC_STREAMON32 _IOW ('V', 18, s32) #define VIDIOC_STREAMON32 _IOW ('V', 18, s32)
#define VIDIOC_STREAMOFF32 _IOW ('V', 19, s32) #define VIDIOC_STREAMOFF32 _IOW ('V', 19, s32)
#define VIDIOC_G_INPUT32 _IOR ('V', 38, s32) #define VIDIOC_G_INPUT32 _IOR ('V', 38, s32)
...@@ -720,9 +716,6 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar ...@@ -720,9 +716,6 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
case VIDIOC_S_EXT_CTRLS32: cmd = VIDIOC_S_EXT_CTRLS; break; case VIDIOC_S_EXT_CTRLS32: cmd = VIDIOC_S_EXT_CTRLS; break;
case VIDIOC_TRY_EXT_CTRLS32: cmd = VIDIOC_TRY_EXT_CTRLS; break; case VIDIOC_TRY_EXT_CTRLS32: cmd = VIDIOC_TRY_EXT_CTRLS; break;
case VIDIOC_OVERLAY32: cmd = VIDIOC_OVERLAY; break; case VIDIOC_OVERLAY32: cmd = VIDIOC_OVERLAY; break;
#ifdef __OLD_VIDIOC_
case VIDIOC_OVERLAY32_OLD: cmd = VIDIOC_OVERLAY; break;
#endif
case VIDIOC_STREAMON32: cmd = VIDIOC_STREAMON; break; case VIDIOC_STREAMON32: cmd = VIDIOC_STREAMON; break;
case VIDIOC_STREAMOFF32: cmd = VIDIOC_STREAMOFF; break; case VIDIOC_STREAMOFF32: cmd = VIDIOC_STREAMOFF; break;
case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break; case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break;
...@@ -856,14 +849,6 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -856,14 +849,6 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
return ret; return ret;
switch (cmd) { switch (cmd) {
#ifdef __OLD_VIDIOC_
case VIDIOC_OVERLAY32_OLD:
case VIDIOC_S_PARM_OLD:
case VIDIOC_S_CTRL_OLD:
case VIDIOC_G_AUDIO_OLD:
case VIDIOC_G_AUDOUT_OLD:
case VIDIOC_CROPCAP_OLD:
#endif
case VIDIOC_QUERYCAP: case VIDIOC_QUERYCAP:
case VIDIOC_RESERVED: case VIDIOC_RESERVED:
case VIDIOC_ENUM_FMT: case VIDIOC_ENUM_FMT:
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#define __OLD_VIDIOC_ /* To allow fixing old calls */
#include <linux/videodev2.h> #include <linux/videodev2.h>
#include <media/v4l2-common.h> #include <media/v4l2-common.h>
...@@ -297,37 +296,6 @@ EXPORT_SYMBOL(v4l_printk_ioctl); ...@@ -297,37 +296,6 @@ EXPORT_SYMBOL(v4l_printk_ioctl);
/* /*
* helper function -- handles userspace copying for ioctl arguments * helper function -- handles userspace copying for ioctl arguments
*/
#ifdef __OLD_VIDIOC_
static unsigned int
video_fix_command(unsigned int cmd)
{
switch (cmd) {
case VIDIOC_OVERLAY_OLD:
cmd = VIDIOC_OVERLAY;
break;
case VIDIOC_S_PARM_OLD:
cmd = VIDIOC_S_PARM;
break;
case VIDIOC_S_CTRL_OLD:
cmd = VIDIOC_S_CTRL;
break;
case VIDIOC_G_AUDIO_OLD:
cmd = VIDIOC_G_AUDIO;
break;
case VIDIOC_G_AUDOUT_OLD:
cmd = VIDIOC_G_AUDOUT;
break;
case VIDIOC_CROPCAP_OLD:
cmd = VIDIOC_CROPCAP;
break;
}
return cmd;
}
#endif
/*
* Obsolete usercopy function - Should be removed soon * Obsolete usercopy function - Should be removed soon
*/ */
long long
...@@ -342,9 +310,6 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg, ...@@ -342,9 +310,6 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
size_t ctrls_size = 0; size_t ctrls_size = 0;
void __user *user_ptr = NULL; void __user *user_ptr = NULL;
#ifdef __OLD_VIDIOC_
cmd = video_fix_command(cmd);
#endif
is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS || is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS ||
cmd == VIDIOC_TRY_EXT_CTRLS); cmd == VIDIOC_TRY_EXT_CTRLS);
...@@ -2379,9 +2344,6 @@ long video_ioctl2(struct file *file, ...@@ -2379,9 +2344,6 @@ long video_ioctl2(struct file *file,
void __user *user_ptr = NULL; void __user *user_ptr = NULL;
void **kernel_ptr = NULL; void **kernel_ptr = NULL;
#ifdef __OLD_VIDIOC_
cmd = video_fix_command(cmd);
#endif
/* Copy arguments into temp kernel buffer */ /* Copy arguments into temp kernel buffer */
if (_IOC_DIR(cmd) != _IOC_NONE) { if (_IOC_DIR(cmd) != _IOC_NONE) {
if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
......
...@@ -1399,11 +1399,6 @@ case VIDIOC_G_CTRL: { ...@@ -1399,11 +1399,6 @@ case VIDIOC_G_CTRL: {
break; break;
} }
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#if defined(VIDIOC_S_CTRL_OLD)
case VIDIOC_S_CTRL_OLD: {
JOM(8, "VIDIOC_S_CTRL_OLD required at least for xawtv\n");
}
#endif /*VIDIOC_S_CTRL_OLD*/
case VIDIOC_S_CTRL: case VIDIOC_S_CTRL:
{ {
struct v4l2_control v4l2_control; struct v4l2_control v4l2_control;
......
...@@ -1935,16 +1935,6 @@ struct v4l2_dbg_chip_ident { ...@@ -1935,16 +1935,6 @@ struct v4l2_dbg_chip_ident {
/* Reminder: when adding new ioctls please add support for them to /* Reminder: when adding new ioctls please add support for them to
drivers/media/video/v4l2-compat-ioctl32.c as well! */ drivers/media/video/v4l2-compat-ioctl32.c as well! */
#ifdef __OLD_VIDIOC_
/* for compatibility, will go away some day */
#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm)
#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control)
#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio)
#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout)
#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap)
#endif
#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ #define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
#endif /* __LINUX_VIDEODEV2_H */ #endif /* __LINUX_VIDEODEV2_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment