summaryrefslogtreecommitdiff
path: root/util/comm-dev.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-06-27 14:42:39 -0700
committerChromeBot <chrome-bot@google.com>2013-07-01 16:14:15 -0700
commit2730daa5679bc0d2a048a60055a7dc89d060076e (patch)
tree8b8326fb10cf694ab551d955bd8c1bcb8ecff1cc /util/comm-dev.c
parent267dbb74d28e4d5d13e892488563ab439398513d (diff)
downloadchrome-ec-2730daa5679bc0d2a048a60055a7dc89d060076e.tar.gz
Comm interface now provides max I/O sizes and preallocated buffers
The maximum packet / param size differs depending on interface and protocol version. Commands can now ask the comm interface what the limits are, and can use preallocated buffers to avoid needless malloc/free. BUG=chrome-os-partner:20571 BRANCH=none TEST=the following all work on link burn_my_ec ectool version ectool chargedump ectool console ectool i2cxfer 5 0x41 2 Change-Id: Ib847994da3f79721e7fb4e347231b9147a3f485f Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/60275
Diffstat (limited to 'util/comm-dev.c')
-rw-r--r--util/comm-dev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/comm-dev.c b/util/comm-dev.c
index 4dae913a82..6dac13fde3 100644
--- a/util/comm-dev.c
+++ b/util/comm-dev.c
@@ -85,5 +85,11 @@ int comm_init_dev(void)
if (ec_readmem_dev(EC_MEMMAP_ID, 2, version) == 2)
ec_readmem = ec_readmem_dev;
+ /*
+ * TODO: need a way to get this from the driver and EC. For now,
+ * pick a magic lowest common denominator value.
+ */
+ ec_max_outsize = EC_HOST_PARAM_SIZE - 8;
+
return 0;
}