[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <491AF8D1.4060106@neotion.com>
Date: Wed, 12 Nov 2008 16:40:01 +0100
From: Neil Armstrong <narmstrong@...tion.com>
To: hjk@...utronix.de
CC: gregkh@...e.de, linux-kernel@...r.kernel.org
Subject: [PATCH] uio: add ioctl callback
Add an ioctl callback for uio devices.
Signed-off-by: Neil Armstrong <narmstrong@...tion.com>
---
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index 2d2440c..38044fb 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -385,6 +385,18 @@ static unsigned int uio_poll(struct file *filep,
poll_table *wait)
return 0;
}
+static int uio_ioctl(struct inode *inode, struct file *filep,
+ unsigned int cmd, unsigned long arg)
+{
+ struct uio_listener *listener = filep->private_data;
+ struct uio_device *idev = listener->dev;
+
+ if (idev->info->ioctl)
+ return idev->info->ioctl(idev->info, cmd, arg);
+
+ return -ENOSYS;
+}
+
static ssize_t uio_read(struct file *filep, char __user *buf,
size_t count, loff_t *ppos)
{
@@ -590,6 +602,7 @@ static const struct file_operations uio_fops = {
.mmap = uio_mmap,
.poll = uio_poll,
.fasync = uio_fasync,
+ .ioctl = uio_ioctl,
};
static int uio_major_init(void)
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index cdf338d..e44e89b 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -68,6 +68,8 @@ struct uio_info {
int (*open)(struct uio_info *info, struct inode *inode);
int (*release)(struct uio_info *info, struct inode *inode);
int (*irqcontrol)(struct uio_info *info, s32 irq_on);
+ int (*ioctl)(struct uio_info *info, unsigned int cmd,
+ unsigned long arg);
};
extern int __must_check
View attachment "narmstrong.vcf" of type "text/x-vcard" (306 bytes)
Powered by blists - more mailing lists