/* This is a copy of dvb_usercopy. We need to do this because it isn't exported
by dvbdev
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+static int dvblb_usercopy(struct file *file,
+ unsigned int cmd, unsigned long arg,
+ int (*func)(struct file *file,
+ unsigned int cmd, void *arg))
+#else
static int dvblb_usercopy(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg,
int (*func)(struct inode *inode, struct file *file,
unsigned int cmd, void *arg))
+#endif
{
char sbuf[128];
void *mbuf = NULL;
}
/* call driver */
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD)
+#else
if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD)
+#endif
err = -EINVAL;
if (err < 0)
dvb_generic_ioctl) which is called by dvblb_ioctl for device-0. It is
used to forward ioctl commands back to the userspace application
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+static int dvblb_looped_ioctl(struct file *f,
+ unsigned int cmd, void *parg)
+#else
static int dvblb_looped_ioctl(struct inode *inode, struct file *f,
unsigned int cmd, void *parg)
+#endif
{
int ret;
struct dvb_device *dvbdev, **filemap;
return ret;
}
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+static long dvblb_ioctl(struct file *f,
+ unsigned int cmd, unsigned long arg)
+#else
static int dvblb_ioctl(struct inode *inode, struct file *f,
unsigned int cmd, unsigned long arg)
+#endif
{
void * parg = (void *)arg;
struct dvb_device *dvbdev, **filemap;
if (lbdev->forward_dev)
return dvblb_forward_ioctl(lbdev, f, cmd, arg);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ return dvblb_usercopy (f, cmd, arg,
+ dvbdev->kernel_ioctl);
+#else
return dvblb_usercopy (inode, f, cmd, arg,
dvbdev->kernel_ioctl);
+#endif
}
/* This is the userspace control device */
dprintk2("dvblb_ioctl %d%s%d fd:%d cmd:%x\n",lbdev->parent->adapter.num,
.write = dvblb_write,
.poll = dvblb_poll,
.mmap = dvblb_mmap,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ .unlocked_ioctl = dvblb_ioctl,
+#else
.ioctl = dvblb_ioctl,
+#endif
};
static struct dvb_device dvbdev_looped = {
.write = dvblb_write,
.poll = dvblb_poll,
.mmap = dvblb_mmap,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)
+ .unlocked_ioctl = dvblb_ioctl,
+#else
.ioctl = dvblb_ioctl,
+#endif
};
static struct dvb_device dvbdev_userspace = {