diff options
author | Tomas Winkler <tomas.winkler@intel.com> | 2015-07-26 09:54:22 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-08-03 17:30:00 -0700 |
commit | 237092bf034a648611f61eb1f0965e9ba1b08871 (patch) | |
tree | 64dec996bf6840cd2cdfcfbd51909015b64246df /drivers/misc/mei/main.c | |
parent | 2c84c2970c1acf83827aa97ab0e6addc3d2aa960 (diff) | |
download | lwn-237092bf034a648611f61eb1f0965e9ba1b08871.tar.gz lwn-237092bf034a648611f61eb1f0965e9ba1b08871.zip |
mei: implement fasync for event notification
A process can be informed about client notification also via
SIGIO with POLL_PRI event.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/main.c')
-rw-r--r-- | drivers/misc/mei/main.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c index 17b356f26686..b2f2486b3d75 100644 --- a/drivers/misc/mei/main.c +++ b/drivers/misc/mei/main.c @@ -651,6 +651,26 @@ out: } /** + * mei_fasync - asynchronous io support + * + * @fd: file descriptor + * @file: pointer to file structure + * @band: band bitmap + * + * Return: poll mask + */ +static int mei_fasync(int fd, struct file *file, int band) +{ + + struct mei_cl *cl = file->private_data; + + if (!mei_cl_is_connected(cl)) + return POLLERR; + + return fasync_helper(fd, file, band, &cl->ev_async); +} + +/** * fw_status_show - mei device attribute show method * * @device: device pointer @@ -702,6 +722,7 @@ static const struct file_operations mei_fops = { .release = mei_release, .write = mei_write, .poll = mei_poll, + .fasync = mei_fasync, .llseek = no_llseek }; |