summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRob Barnes <robbarnes@google.com>2021-09-17 09:42:53 -0600
committerCommit Bot <commit-bot@chromium.org>2021-09-20 13:17:52 +0000
commitc1ef7c696c45632503165cbabb1e37cbabfbe448 (patch)
treeb783829513b4f39cc6742aae2ae9d6c09f5a90f0 /include
parent217975bb1402f1ab76e84ebdf804884be6353924 (diff)
downloadchrome-ec-c1ef7c696c45632503165cbabb1e37cbabfbe448.tar.gz
ec_commands: Add ec_response_get_version_v1
A field (cros_fwid_rw) was added to ec_response_get_version and the version was updated to v1. Some system components that still use v0 of the version host command fail because the size of the response does not match the updated ec_response_get_version struct. Restore ec_response_get_version to match v0. Create a new ec_response_get_version_v1 structure with the added v1 fields. This allows legacy code to continue using ec_response_get_version, which matches the expected response size for the v0 command. BUG=b:188073399,b:200075921 TEST=EC console 'version' works Legacy 'ectool version' works with old an new EC firmware. New 'ectool version' works with old and new EC firmware. BRANCH=None Change-Id: I51a052a550c2460f2604da8e04fc43c36acba4d5 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3169100 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Patryk Duda <patrykd@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/ec_commands.h23
1 files changed, 21 insertions, 2 deletions
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 6e9c538e5e..95431babad 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -1149,14 +1149,33 @@ enum ec_image {
};
/**
- * struct ec_response_get_version - Response to the get version command.
+ * struct ec_response_get_version - Response to the v0 get version command.
+ * @version_string_ro: Null-terminated RO firmware version string.
+ * @version_string_rw: Null-terminated RW firmware version string.
+ * @reserved: Unused bytes; was previously RW-B firmware version string.
+ * @current_image: One of ec_image.
+ */
+struct ec_response_get_version {
+ char version_string_ro[32];
+ char version_string_rw[32];
+ char reserved[32]; /* Changed to cros_fwid_ro in version 1 */
+ uint32_t current_image;
+} __ec_align4;
+
+/**
+ * struct ec_response_get_version_v1 - Response to the v1 get version command.
+ *
+ * ec_response_get_version_v1 is a strict superset of ec_response_get_version.
+ * The v1 response changes the semantics of one field (reserved to cros_fwid_ro)
+ * and adds one additional field (cros_fwid_rw).
+ *
* @version_string_ro: Null-terminated RO firmware version string.
* @version_string_rw: Null-terminated RW firmware version string.
* @cros_fwid_ro: Null-terminated RO CrOS FWID string.
* @current_image: One of ec_image.
* @cros_fwid_rw: Null-terminated RW CrOS FWID string.
*/
-struct ec_response_get_version {
+struct ec_response_get_version_v1 {
char version_string_ro[32];
char version_string_rw[32];
char cros_fwid_ro[32]; /* Added in version 1 (Used to be reserved) */