diff options
author | Vic Yang <victoryang@chromium.org> | 2014-12-25 17:18:23 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-06 02:33:04 +0000 |
commit | c3adc315b3ba724bccafe7c97e2c1b8ab6120cf9 (patch) | |
tree | 1a7735730e1cc248fea742daef48c061e78c8652 /common/host_command.c | |
parent | 6fec4e4a69729cc715ceddaf9e8c6fad4ddacc80 (diff) | |
download | chrome-ec-c3adc315b3ba724bccafe7c97e2c1b8ab6120cf9.tar.gz |
Support command versioning of new host command range
We've extended host command range from 8-bit to 16-bit. Extend
EC_CMD_GET_CMD_VERSIONS so that the host may query supported command
versions of the new host commands.
BRANCH=All
BUG=chrome-os-partner:26577
TEST=Extend 'usbpd' to version 1. Test that we can check its version.
TEST=Run 'ectool gpioget' with new ectool and old EC.
TEST=Run 'ectool gpioget' with old ectool and new EC.
Change-Id: I1651aaf21ac2604aea101244b5e53713ead8c1af
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/237622
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'common/host_command.c')
-rw-r--r-- | common/host_command.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/common/host_command.c b/common/host_command.c index a036c184e6..51d1a9cf97 100644 --- a/common/host_command.c +++ b/common/host_command.c @@ -505,9 +505,12 @@ DECLARE_HOST_COMMAND(EC_CMD_READ_MEMMAP, static int host_command_get_cmd_versions(struct host_cmd_handler_args *args) { const struct ec_params_get_cmd_versions *p = args->params; + const struct ec_params_get_cmd_versions_v1 *p_v1 = args->params; struct ec_response_get_cmd_versions *r = args->response; - const struct host_command *cmd = find_host_command(p->cmd); + const struct host_command *cmd = + (args->version == 1) ? find_host_command(p_v1->cmd) : + find_host_command(p->cmd); if (!cmd) return EC_RES_INVALID_PARAM; @@ -520,7 +523,7 @@ static int host_command_get_cmd_versions(struct host_cmd_handler_args *args) } DECLARE_HOST_COMMAND(EC_CMD_GET_CMD_VERSIONS, host_command_get_cmd_versions, - EC_VER_MASK(0)); + EC_VER_MASK(0) | EC_VER_MASK(1)); /** * Print debug output for the host command request, before it's processed. |