summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/client.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2015-07-26 09:54:22 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-08-03 17:30:00 -0700
commit237092bf034a648611f61eb1f0965e9ba1b08871 (patch)
tree64dec996bf6840cd2cdfcfbd51909015b64246df /drivers/misc/mei/client.c
parent2c84c2970c1acf83827aa97ab0e6addc3d2aa960 (diff)
downloadlinux-237092bf034a648611f61eb1f0965e9ba1b08871.tar.bz2
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/client.c')
-rw-r--r--drivers/misc/mei/client.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index d9396838774c..db2436aee2dc 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -1351,6 +1351,33 @@ out:
}
/**
+ * mei_cl_notify - raise notification
+ *
+ * @cl: host client
+ *
+ * Locking: called under "dev->device_lock" lock
+ */
+void mei_cl_notify(struct mei_cl *cl)
+{
+ struct mei_device *dev;
+
+ if (!cl || !cl->dev)
+ return;
+
+ dev = cl->dev;
+
+ if (!cl->notify_en)
+ return;
+
+ cl_dbg(dev, cl, "notify event");
+ cl->notify_ev = true;
+ wake_up_interruptible_all(&cl->ev_wait);
+
+ if (cl->ev_async)
+ kill_fasync(&cl->ev_async, SIGIO, POLL_PRI);
+}
+
+/**
* mei_cl_notify_get - get or wait for notification event
*
* @cl: host client