2002-04-10 12:36:19

by Gerd Knorr

[permalink] [raw]
Subject: [patch] 2.5.8-pre video driver fixes

Hi,

This patch adapts the v4l video drivers to the -pre1 videodev fix and
makes them compile again.

Gerd

==============================[ cut here ]==============================
# ChangeSet
# 1.586 02/04/08 10:05:09 [email protected] +8 -0
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/w9966.c
# 1.5 02/03/19 18:24:12 [email protected] +10 -5
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/saa5249.c
# 1.8 02/03/19 18:24:12 [email protected] +7 -6
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/pms.c
# 1.8 02/03/19 18:24:12 [email protected] +9 -4
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/cpia.c
# 1.15 02/03/19 18:24:12 [email protected] +9 -4
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/c-qcam.c
# 1.8 02/03/19 18:24:12 [email protected] +9 -4
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/bw-qcam.c
# 1.8 02/03/19 18:24:12 [email protected] +9 -4
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/bttv-vbi.c
# 1.2 02/03/19 18:24:12 [email protected] +9 -4
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
# drivers/media/video/bttv-driver.c
# 1.17 02/03/19 18:24:12 [email protected] +18 -8
# adapt v4l video drivers to 2.5.8-pre1 videodev fixes.
#
======================================================================
diff -Nru a/drivers/media/video/bttv-driver.c b/drivers/media/video/bttv-driver.c
--- a/drivers/media/video/bttv-driver.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/bttv-driver.c Mon Apr 8 10:18:25 2002
@@ -1650,8 +1650,8 @@
bttv_dma_free(fh->btv,buf);
}

-static int bttv_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int bttv_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv;
@@ -2432,6 +2432,12 @@
return retval;
}

+static int bttv_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, bttv_do_ioctl);
+}
+
/* start capture to a kernel bounce buffer */
static int bttv_read_capture(struct bttv_fh *fh)
{
@@ -2647,7 +2653,7 @@
owner: THIS_MODULE,
open: bttv_open,
release: bttv_release,
- ioctl: video_generic_ioctl,
+ ioctl: bttv_ioctl,
llseek: no_llseek,
read: bttv_read,
mmap: bttv_mmap,
@@ -2661,7 +2667,6 @@
VID_TYPE_CLIPPING|VID_TYPE_SCALES,
hardware: VID_HARDWARE_BT848,
fops: &bttv_fops,
- kernel_ioctl: bttv_ioctl,
minor: -1,
};

@@ -2712,8 +2717,8 @@
return 0;
}

-static int radio_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int radio_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct bttv *btv = file->private_data;

@@ -2763,12 +2768,18 @@
return 0;
}

+static int radio_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, radio_do_ioctl);
+}
+
static struct file_operations radio_fops =
{
owner: THIS_MODULE,
open: radio_open,
release: radio_release,
- ioctl: video_generic_ioctl,
+ ioctl: radio_ioctl,
llseek: no_llseek,
};

@@ -2778,7 +2789,6 @@
type: VID_TYPE_TUNER|VID_TYPE_TELETEXT,
hardware: VID_HARDWARE_BT848,
fops: &radio_fops,
- kernel_ioctl: radio_ioctl,
minor: -1,
};

diff -Nru a/drivers/media/video/bttv-vbi.c b/drivers/media/video/bttv-vbi.c
--- a/drivers/media/video/bttv-vbi.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/bttv-vbi.c Mon Apr 8 10:18:25 2002
@@ -276,8 +276,8 @@
return 0;
}

-static int vbi_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int vbi_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct bttv *btv = file->private_data;
#ifdef HAVE_V4L2
@@ -507,6 +507,12 @@
#endif
}

+static int vbi_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, vbi_do_ioctl);
+}
+
static ssize_t vbi_read(struct file *file, char *data,
size_t count, loff_t *ppos)
{
@@ -634,7 +640,7 @@
owner: THIS_MODULE,
open: vbi_open,
release: vbi_release,
- ioctl: video_generic_ioctl,
+ ioctl: vbi_ioctl,
llseek: no_llseek,
read: vbi_read,
poll: vbi_poll,
@@ -647,7 +653,6 @@
type: VID_TYPE_TUNER|VID_TYPE_TELETEXT,
hardware: VID_HARDWARE_BT848,
fops: &vbi_fops,
- kernel_ioctl: vbi_ioctl,
minor: -1,
};

diff -Nru a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
--- a/drivers/media/video/bw-qcam.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/bw-qcam.c Mon Apr 8 10:18:25 2002
@@ -694,8 +694,8 @@
* Video4linux interfacing
*/

-static int qcam_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int qcam_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct video_device *dev = video_devdata(file);
struct qcam_device *qcam=(struct qcam_device *)dev;
@@ -854,6 +854,12 @@
return 0;
}

+static int qcam_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, qcam_do_ioctl);
+}
+
static int qcam_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
@@ -882,7 +888,7 @@
owner: THIS_MODULE,
open: video_exclusive_open,
release: video_exclusive_release,
- ioctl: video_generic_ioctl,
+ ioctl: qcam_ioctl,
read: qcam_read,
llseek: no_llseek,
};
@@ -893,7 +899,6 @@
type: VID_TYPE_CAPTURE,
hardware: VID_HARDWARE_QCAM_BW,
fops: &qcam_fops,
- kernel_ioctl: qcam_ioctl,
};

#define MAX_CAMS 4
diff -Nru a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c
--- a/drivers/media/video/c-qcam.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/c-qcam.c Mon Apr 8 10:18:25 2002
@@ -496,8 +496,8 @@
* Video4linux interfacing
*/

-static int qcam_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int qcam_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct video_device *dev = video_devdata(file);
struct qcam_device *qcam=(struct qcam_device *)dev;
@@ -662,6 +662,12 @@
return 0;
}

+static int qcam_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, qcam_do_ioctl);
+}
+
static int qcam_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
@@ -683,7 +689,7 @@
owner: THIS_MODULE,
open: video_exclusive_open,
release: video_exclusive_release,
- ioctl: video_generic_ioctl,
+ ioctl: qcam_ioctl,
read: qcam_read,
llseek: no_llseek,
};
@@ -695,7 +701,6 @@
type: VID_TYPE_CAPTURE,
hardware: VID_HARDWARE_QCAM_C,
fops: &qcam_fops,
- kernel_ioctl: qcam_ioctl,
};

/* Initialize the QuickCam driver control structure. */
diff -Nru a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
--- a/drivers/media/video/cpia.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/cpia.c Mon Apr 8 10:18:25 2002
@@ -2572,8 +2572,8 @@
return cam->decompressed_frame.count;
}

-static int cpia_ioctl(struct inode *inode, struct file *file,
- unsigned int ioctlnr, void *arg)
+static int cpia_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int ioctlnr, void *arg)
{
struct video_device *dev = file->private_data;
struct cam_data *cam = dev->priv;
@@ -2874,6 +2874,12 @@
return retval;
}

+static int cpia_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, cpia_do_ioctl);
+}
+
/* FIXME */
static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
{
@@ -2933,7 +2939,7 @@
release: cpia_close,
read: cpia_read,
mmap: cpia_mmap,
- ioctl: video_generic_ioctl,
+ ioctl: cpia_ioctl,
llseek: no_llseek,
};

@@ -2943,7 +2949,6 @@
type: VID_TYPE_CAPTURE,
hardware: VID_HARDWARE_CPIA, /* FIXME */
fops: &cpia_fops,
- kernel_ioctl: cpia_ioctl,
};

/* initialise cam_data structure */
diff -Nru a/drivers/media/video/pms.c b/drivers/media/video/pms.c
--- a/drivers/media/video/pms.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/pms.c Mon Apr 8 10:18:25 2002
@@ -672,8 +672,8 @@
* Video4linux interfacing
*/

-static int pms_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int pms_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct video_device *dev = video_devdata(file);
struct pms_device *pd=(struct pms_device *)dev;
@@ -855,6 +855,12 @@
return 0;
}

+static int pms_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, pms_do_ioctl);
+}
+
static int pms_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
@@ -872,7 +878,7 @@
owner: THIS_MODULE,
open: video_exclusive_open,
release: video_exclusive_release,
- ioctl: video_generic_ioctl,
+ ioctl: pms_ioctl,
read: pms_read,
llseek: no_llseek,
};
@@ -884,7 +890,6 @@
type: VID_TYPE_CAPTURE,
hardware: VID_HARDWARE_PMS,
fops: &pms_fops,
- kernel_ioctl: pms_ioctl,
};

struct pms_device pms_device;
diff -Nru a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
--- a/drivers/media/video/saa5249.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/saa5249.c Mon Apr 8 10:18:25 2002
@@ -341,9 +341,12 @@
* Standard character-device-driver functions
*/

-static int do_saa5249_ioctl(struct saa5249_device *t, unsigned int cmd, void *arg)
+static int do_saa5249_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
static int virtual_mode = FALSE;
+ struct video_device *vd = video_devdata(file);
+ struct saa5249_device *t=vd->priv;

switch(cmd)
{
@@ -591,16 +594,15 @@
*/

static int saa5249_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+ unsigned int cmd, unsigned long arg)
{
struct video_device *vd = video_devdata(file);
struct saa5249_device *t=vd->priv;
int err;

down(&t->lock);
- err = do_saa5249_ioctl(t, cmd, arg);
+ err = video_usercopy(inode,file,cmd,arg,do_saa5249_ioctl);
up(&t->lock);
-
return err;
}

@@ -679,7 +681,7 @@
owner: THIS_MODULE,
open: saa5249_open,
release: saa5249_release,
- ioctl: video_generic_ioctl,
+ ioctl: saa5249_ioctl,
llseek: no_llseek,
};

@@ -690,7 +692,6 @@
type: VID_TYPE_TELETEXT, /*| VID_TYPE_TUNER ?? */
hardware: VID_HARDWARE_SAA5249,
fops: &saa_fops,
- kernel_ioctl: saa5249_ioctl,
};

MODULE_LICENSE("GPL");
diff -Nru a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
--- a/drivers/media/video/w9966.c Mon Apr 8 10:18:25 2002
+++ b/drivers/media/video/w9966.c Mon Apr 8 10:18:25 2002
@@ -174,7 +174,7 @@
static int w9966_i2c_rbyte(struct w9966_dev* cam);

static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg);
+ unsigned int cmd, unsigned long arg);
static int w9966_v4l_read(struct file *file, char *buf,
size_t count, loff_t *ppos);

@@ -182,7 +182,7 @@
owner: THIS_MODULE,
open: video_exclusive_open,
release: video_exclusive_release,
- ioctl: video_generic_ioctl,
+ ioctl: w9966_v4l_ioctl,
read: w9966_v4l_read,
llseek: no_llseek,
};
@@ -192,7 +192,6 @@
type: VID_TYPE_CAPTURE | VID_TYPE_SCALES,
hardware: VID_HARDWARE_W9966,
fops: &w9966_fops,
- kernel_ioctl: w9966_v4l_ioctl,
};

/*
@@ -700,8 +699,8 @@
* Video4linux interfacing
*/

-static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, void *arg)
+static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, void *arg)
{
struct video_device *vdev = video_devdata(file);
struct w9966_dev *cam = (struct w9966_dev*)vdev->priv;
@@ -851,6 +850,12 @@
return -ENOIOCTLCMD;
}
return 0;
+}
+
+static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
+ unsigned int cmd, unsigned long arg)
+{
+ return video_usercopy(inode, file, cmd, arg, w9966_v4l_do_ioctl);
}

// Capture data
======================================================================
This BitKeeper patch contains the following changesets:
1.586
## Wrapped with gzip_uu ##


begin 664 bkpatch4871
M'XL(`%%2L3P``]V:6V_;-A3'GZU/0:`OO<0V[Q<7+KHUNP0;L*)#WP8$E$0E
M0N++9,5I-^V[CZ1L67(<1U;KP:L=F``E'OYYQ!_/(95GX./"9*/>3:8_F=O@
M&?AYMLA'O?!S;A;FTV"67=FZ#[.9K1O>S[*;87@SQ`,V3-)/_64:FUE@K[_7
M>70-EB9;C'IH0*J:_//<C'H??OCIXZ_??0B"\1B\N];3*_.[R<%X'.2S;*EO
MX\5;G5_?SJ:#/-/3Q<3D>A#-)D5U:X$AQ/;+D""0\0)Q2$41H1@A39&)(::2
MTT#?S"=O_TKGKO%`WVVWIY!#0CGF!554XN`<H`&3'$`\A'0()4!P!-D(JE<0
MCR`$I4/>UAP!7DG0A\'WX.OJ?A=$0,=ZGH,EO07>IR#.4N=-VQ.PSA[(_CPS
MJ+P6FR6PSC>+0?`+H(HQ'KS?N#7H'_@)`JAA\.:),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