aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2011-02-05 08:10:38 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-21 19:32:12 -0400
commit7ee40aadabd59b6cab60835f0ef9cdbe385df438 (patch)
tree61e8856b6c2d159f489ec0147bedb190ac951fcf
parentdae86ccbc3c185aebfc396e8e668aa3d73d748d8 (diff)
[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: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/feature-removal-schedule.txt21
-rw-r--r--drivers/media/video/v4l2-common.c1
-rw-r--r--drivers/media/video/v4l2-compat-ioctl32.c15
-rw-r--r--drivers/media/video/v4l2-ioctl.c38
-rw-r--r--drivers/staging/easycap/easycap_ioctl.c5
-rw-r--r--include/linux/videodev2.h10
6 files changed, 0 insertions, 90 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 08e0df12df37..61fb823e5a95 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -97,27 +97,6 @@ Who: Pavel Machek <pavel@ucw.cz>
97 97
98--------------------------- 98---------------------------
99 99
100What: Video4Linux: Remove obsolete ioctl's
101When: kernel 2.6.39
102Files: include/media/videodev2.h
103Why: Some ioctl's were defined wrong on 2.6.2 and 2.6.6, using the wrong
104 type of R/W arguments. They were fixed, but the old ioctl names are
105 still there, maintained to avoid breaking binary compatibility:
106 #define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
107 #define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm)
108 #define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control)
109 #define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio)
110 #define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout)
111 #define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap)
112 There's no sense on preserving those forever, as it is very doubtful
113 that someone would try to use a such old binary with a modern kernel.
114 Removing them will allow us to remove some magic done at the V4L ioctl
115 handler.
116
117Who: Mauro Carvalho Chehab <mchehab@infradead.org>
118
119---------------------------
120
121What: sys_sysctl 100What: sys_sysctl
122When: September 2010 101When: September 2010
123Option: CONFIG_SYSCTL_SYSCALL 102Option: CONFIG_SYSCTL_SYSCALL
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 810eef43c216..940b5db3463e 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -59,7 +59,6 @@
59#include <asm/pgtable.h> 59#include <asm/pgtable.h>
60#include <asm/io.h> 60#include <asm/io.h>
61#include <asm/div64.h> 61#include <asm/div64.h>
62#define __OLD_VIDIOC_ /* To allow fixing old calls*/
63#include <media/v4l2-common.h> 62#include <media/v4l2-common.h>
64#include <media/v4l2-device.h> 63#include <media/v4l2-device.h>
65#include <media/v4l2-ctrls.h> 64#include <media/v4l2-ctrls.h>
diff --git a/drivers/media/video/v4l2-compat-ioctl32.c b/drivers/media/video/v4l2-compat-ioctl32.c
index c19208a07b48..7c2694738b31 100644
--- a/drivers/media/video/v4l2-compat-ioctl32.c
+++ b/drivers/media/video/v4l2-compat-ioctl32.c
@@ -14,7 +14,6 @@
14 */ 14 */
15 15
16#include <linux/compat.h> 16#include <linux/compat.h>
17#define __OLD_VIDIOC_ /* To allow fixing old calls*/
18#include <linux/videodev2.h> 17#include <linux/videodev2.h>
19#include <linux/module.h> 18#include <linux/module.h>
20#include <media/v4l2-ioctl.h> 19#include <media/v4l2-ioctl.h>
@@ -678,9 +677,6 @@ static int put_v4l2_ext_controls32(struct v4l2_ext_controls *kp, struct v4l2_ext
678#define VIDIOC_TRY_EXT_CTRLS32 _IOWR('V', 73, struct v4l2_ext_controls32) 677#define VIDIOC_TRY_EXT_CTRLS32 _IOWR('V', 73, struct v4l2_ext_controls32)
679 678
680#define VIDIOC_OVERLAY32 _IOW ('V', 14, s32) 679#define VIDIOC_OVERLAY32 _IOW ('V', 14, s32)
681#ifdef __OLD_VIDIOC_
682#define VIDIOC_OVERLAY32_OLD _IOWR('V', 14, s32)
683#endif
684#define VIDIOC_STREAMON32 _IOW ('V', 18, s32) 680#define VIDIOC_STREAMON32 _IOW ('V', 18, s32)
685#define VIDIOC_STREAMOFF32 _IOW ('V', 19, s32) 681#define VIDIOC_STREAMOFF32 _IOW ('V', 19, s32)
686#define VIDIOC_G_INPUT32 _IOR ('V', 38, s32) 682#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 case VIDIOC_S_EXT_CTRLS32: cmd = VIDIOC_S_EXT_CTRLS; break; 716 case VIDIOC_S_EXT_CTRLS32: cmd = VIDIOC_S_EXT_CTRLS; break;
721 case VIDIOC_TRY_EXT_CTRLS32: cmd = VIDIOC_TRY_EXT_CTRLS; break; 717 case VIDIOC_TRY_EXT_CTRLS32: cmd = VIDIOC_TRY_EXT_CTRLS; break;
722 case VIDIOC_OVERLAY32: cmd = VIDIOC_OVERLAY; break; 718 case VIDIOC_OVERLAY32: cmd = VIDIOC_OVERLAY; break;
723#ifdef __OLD_VIDIOC_
724 case VIDIOC_OVERLAY32_OLD: cmd = VIDIOC_OVERLAY; break;
725#endif
726 case VIDIOC_STREAMON32: cmd = VIDIOC_STREAMON; break; 719 case VIDIOC_STREAMON32: cmd = VIDIOC_STREAMON; break;
727 case VIDIOC_STREAMOFF32: cmd = VIDIOC_STREAMOFF; break; 720 case VIDIOC_STREAMOFF32: cmd = VIDIOC_STREAMOFF; break;
728 case VIDIOC_G_INPUT32: cmd = VIDIOC_G_INPUT; break; 721 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 return ret; 849 return ret;
857 850
858 switch (cmd) { 851 switch (cmd) {
859#ifdef __OLD_VIDIOC_
860 case VIDIOC_OVERLAY32_OLD:
861 case VIDIOC_S_PARM_OLD:
862 case VIDIOC_S_CTRL_OLD:
863 case VIDIOC_G_AUDIO_OLD:
864 case VIDIOC_G_AUDOUT_OLD:
865 case VIDIOC_CROPCAP_OLD:
866#endif
867 case VIDIOC_QUERYCAP: 852 case VIDIOC_QUERYCAP:
868 case VIDIOC_RESERVED: 853 case VIDIOC_RESERVED:
869 case VIDIOC_ENUM_FMT: 854 case VIDIOC_ENUM_FMT:
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c
index 8360ed2d933a..7a720745c3fa 100644
--- a/drivers/media/video/v4l2-ioctl.c
+++ b/drivers/media/video/v4l2-ioctl.c
@@ -17,7 +17,6 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19 19
20#define __OLD_VIDIOC_ /* To allow fixing old calls */
21#include <linux/videodev2.h> 20#include <linux/videodev2.h>
22 21
23#include <media/v4l2-common.h> 22#include <media/v4l2-common.h>
@@ -297,37 +296,6 @@ EXPORT_SYMBOL(v4l_printk_ioctl);
297 296
298/* 297/*
299 * helper function -- handles userspace copying for ioctl arguments 298 * helper function -- handles userspace copying for ioctl arguments
300 */
301
302#ifdef __OLD_VIDIOC_
303static unsigned int
304video_fix_command(unsigned int cmd)
305{
306 switch (cmd) {
307 case VIDIOC_OVERLAY_OLD:
308 cmd = VIDIOC_OVERLAY;
309 break;
310 case VIDIOC_S_PARM_OLD:
311 cmd = VIDIOC_S_PARM;
312 break;
313 case VIDIOC_S_CTRL_OLD:
314 cmd = VIDIOC_S_CTRL;
315 break;
316 case VIDIOC_G_AUDIO_OLD:
317 cmd = VIDIOC_G_AUDIO;
318 break;
319 case VIDIOC_G_AUDOUT_OLD:
320 cmd = VIDIOC_G_AUDOUT;
321 break;
322 case VIDIOC_CROPCAP_OLD:
323 cmd = VIDIOC_CROPCAP;
324 break;
325 }
326 return cmd;
327}
328#endif
329
330/*
331 * Obsolete usercopy function - Should be removed soon 299 * Obsolete usercopy function - Should be removed soon
332 */ 300 */
333long 301long
@@ -342,9 +310,6 @@ video_usercopy(struct file *file, unsigned int cmd, unsigned long arg,
342 size_t ctrls_size = 0; 310 size_t ctrls_size = 0;
343 void __user *user_ptr = NULL; 311 void __user *user_ptr = NULL;
344 312
345#ifdef __OLD_VIDIOC_
346 cmd = video_fix_command(cmd);
347#endif
348 is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS || 313 is_ext_ctrl = (cmd == VIDIOC_S_EXT_CTRLS || cmd == VIDIOC_G_EXT_CTRLS ||
349 cmd == VIDIOC_TRY_EXT_CTRLS); 314 cmd == VIDIOC_TRY_EXT_CTRLS);
350 315
@@ -2379,9 +2344,6 @@ long video_ioctl2(struct file *file,
2379 void __user *user_ptr = NULL; 2344 void __user *user_ptr = NULL;
2380 void **kernel_ptr = NULL; 2345 void **kernel_ptr = NULL;
2381 2346
2382#ifdef __OLD_VIDIOC_
2383 cmd = video_fix_command(cmd);
2384#endif
2385 /* Copy arguments into temp kernel buffer */ 2347 /* Copy arguments into temp kernel buffer */
2386 if (_IOC_DIR(cmd) != _IOC_NONE) { 2348 if (_IOC_DIR(cmd) != _IOC_NONE) {
2387 if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { 2349 if (_IOC_SIZE(cmd) <= sizeof(sbuf)) {
diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c
index 447953a4e80c..7ac43da4e252 100644
--- a/drivers/staging/easycap/easycap_ioctl.c
+++ b/drivers/staging/easycap/easycap_ioctl.c
@@ -1399,11 +1399,6 @@ case VIDIOC_G_CTRL: {
1399 break; 1399 break;
1400} 1400}
1401/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ 1401/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
1402#if defined(VIDIOC_S_CTRL_OLD)
1403case VIDIOC_S_CTRL_OLD: {
1404 JOM(8, "VIDIOC_S_CTRL_OLD required at least for xawtv\n");
1405}
1406#endif /*VIDIOC_S_CTRL_OLD*/
1407case VIDIOC_S_CTRL: 1402case VIDIOC_S_CTRL:
1408 { 1403 {
1409 struct v4l2_control v4l2_control; 1404 struct v4l2_control v4l2_control;
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 5122b265dde6..a94c4d5ac340 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -1935,16 +1935,6 @@ struct v4l2_dbg_chip_ident {
1935/* Reminder: when adding new ioctls please add support for them to 1935/* Reminder: when adding new ioctls please add support for them to
1936 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1936 drivers/media/video/v4l2-compat-ioctl32.c as well! */
1937 1937
1938#ifdef __OLD_VIDIOC_
1939/* for compatibility, will go away some day */
1940#define VIDIOC_OVERLAY_OLD _IOWR('V', 14, int)
1941#define VIDIOC_S_PARM_OLD _IOW('V', 22, struct v4l2_streamparm)
1942#define VIDIOC_S_CTRL_OLD _IOW('V', 28, struct v4l2_control)
1943#define VIDIOC_G_AUDIO_OLD _IOWR('V', 33, struct v4l2_audio)
1944#define VIDIOC_G_AUDOUT_OLD _IOWR('V', 49, struct v4l2_audioout)
1945#define VIDIOC_CROPCAP_OLD _IOR('V', 58, struct v4l2_cropcap)
1946#endif
1947
1948#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */ 1938#define BASE_VIDIOC_PRIVATE 192 /* 192-255 are private */
1949 1939
1950#endif /* __LINUX_VIDEODEV2_H */ 1940#endif /* __LINUX_VIDEODEV2_H */