summaryrefslogtreecommitdiff
path: root/util/comm-host.h
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2019-01-02 15:27:19 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-05 20:08:41 -0800
commitaed008f87c3c880edecf7608ab24eaa4bee1bc46 (patch)
treeace789e46f1a72c4da399760b72eb281424000f7 /util/comm-host.h
parentef15468753984a9d4ee71ea1c73fc7899e977802 (diff)
downloadchrome-ec-aed008f87c3c880edecf7608ab24eaa4bee1bc46.tar.gz
ectool: Don't acquire lock when dev interface is used
The /dev/cros_ec interface has a built-in mutex, thus we do not need to use /run/lock to arbitrate access since we can assume other tools (mosys, flashrom) also use the dev interface. $ generate_logs ... feedback/cbi_info ... $ cat feedback/cbi_info [0] As integer: 1 (0x1) As binary: 01 02 [1] As integer: 3 (0x3) As binary: 03 [2] As integer: 103 (0x67) As binary: 67 3a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=chromium:849399 BRANCH=none TEST=Verify 'ectool version' runs on Nami. Verify lock is acquired when '--interface=lpc' is specified. Verify debugd can run cbi_info. Change-Id: Id94317472917a974218bb137bda11fe5618a4b88 Reviewed-on: https://chromium-review.googlesource.com/1393729 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'util/comm-host.h')
-rw-r--r--util/comm-host.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/util/comm-host.h b/util/comm-host.h
index bf6921d17d..11f81b4950 100644
--- a/util/comm-host.h
+++ b/util/comm-host.h
@@ -35,13 +35,27 @@ enum comm_interface {
};
/**
- * Perform initializations needed for subsequent requests
+ * Initialize alternative interfaces
*
* @param interfaces Interfaces to try; use COMM_ALL to try all of them.
* @param device_name For DEV option, the device file to use.
* @return 0 in case of success, or error code.
*/
-int comm_init(int interfaces, const char *device_name);
+int comm_init_alt(int interfaces, const char *device_name);
+
+/**
+ * Initialize dev interface
+ *
+ * @return 0 in case of success, or error code.
+ */
+int comm_init_dev(const char *device_name);
+
+/**
+ * Initialize input & output buffers
+ *
+ * @return 0 in case of success, or error code.
+ */
+int comm_init_buffer(void);
/**
* Send a command to the EC. Returns the length of output data returned (0 if