summaryrefslogtreecommitdiff
path: root/util/comm-host.h
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2017-11-24 16:45:34 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-01-23 05:25:08 -0800
commitb16f759652f074ee597fc4db8c403a46eab32c50 (patch)
tree7588cc544e3f88b471100d16cc2bbd1133c66a8a /util/comm-host.h
parent96a7e9fe8120e81a40fe7fe208d17cff80f1a4b9 (diff)
downloadchrome-ec-b16f759652f074ee597fc4db8c403a46eab32c50.tar.gz
ectool: use poll interface
Test polling for MKBP events through the kernel cros_ec/pd/fp/.. driver node. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:69460856 TEST=run on Eve EVT: ectool --name=cros_fp fpmode fingerdown && \ ectool --name=cros_fp waitevent 5 10000 Change-Id: Ibdec137a3b646cf017a29afcf24ff5bbfb731198 Reviewed-on: https://chromium-review.googlesource.com/806167 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'util/comm-host.h')
-rw-r--r--util/comm-host.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/comm-host.h b/util/comm-host.h
index a30f0f4adc..bf6921d17d 100644
--- a/util/comm-host.h
+++ b/util/comm-host.h
@@ -75,4 +75,14 @@ extern int (*ec_command_proto)(int command, int version,
*/
extern int (*ec_readmem)(int offset, int bytes, void *dest);
+/**
+ * Wait for a MKBP event matching 'mask' for at most 'timeout' milliseconds.
+ * Then read the incoming event content in 'buffer' (or at most
+ * 'buf_size' bytes of it).
+ * Return the size of the event read on success, 0 in case of timeout,
+ * or a negative value in case of error.
+ */
+extern int (*ec_pollevent)(unsigned long mask, void *buffer, size_t buf_size,
+ int timeout);
+
#endif /* __UTIL_COMM_HOST_H */