From: Marco Stornelli <marco.stornelli@coritel.it>
To: narmstrong@neotion.com
Cc: Embedded Linux mailing list <linux-embedded@vger.kernel.org>
Subject: Re: [PATCH] uio: add ioctl callback
Date: Wed, 12 Nov 2008 15:33:03 +0100 [thread overview]
Message-ID: <491AE91F.1000104@coritel.it> (raw)
In-Reply-To: <491AE3F7.4050202@neotion.com>
Read the file SubmittingPatches in your kernel documentation folder
before sending a patch. In addition, check the patch with checkpatch
script. You can find the script in the script kernel folder. Send the
patch with the right destination. You can know the names (and emails) of
the maintainers in the MAINTAINER file in the kernel source.
Regards,
Marco
Neil Armstrong wrote:
> Add an ioctl callback to the UIO device class.
> This can be useful when status and data are needed after an interrupt
> occurs.
>
> Changes :
> - Add an uio_ioctl method
> - Add en ioctl entry in uio_info
>
> Neil Armstrong <narmstrong@neotion.com>
>
> Index: drivers/uio/uio.c
> ===================================================================
> --- drivers/uio/uio.c (revision 80)
> +++ drivers/uio/uio.c (working copy)
> @@ -378,6 +378,17 @@
> 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)
> {
> @@ -575,6 +586,7 @@
> .mmap = uio_mmap,
> .poll = uio_poll,
> .fasync = uio_fasync,
> + .ioctl = uio_ioctl,
> };
>
> static int uio_major_init(void)
> Index: include/linux/uio_driver.h
> ===================================================================
> --- include/linux/uio_driver.h (revision 80)
> +++ include/linux/uio_driver.h (working copy)
> @@ -68,6 +68,7 @@
> 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
>
prev parent reply other threads:[~2008-11-12 14:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-12 14:11 [PATCH] uio: add ioctl callback Neil Armstrong
2008-11-12 14:33 ` Marco Stornelli [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=491AE91F.1000104@coritel.it \
--to=marco.stornelli@coritel.it \
--cc=linux-embedded@vger.kernel.org \
--cc=narmstrong@neotion.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox