diff --git a/include/update_fw.h b/include/update_fw.h index 727a3012f5..e454f129bd 100644 --- a/include/update_fw.h +++ b/include/update_fw.h @@ -8,6 +8,7 @@ #include +#include "compile_time_macros.h" /* * This file contains structures used to facilitate EC firmware updates @@ -217,6 +218,14 @@ struct touchpad_info { } elan; } __packed; +/* + * The response message must not exceed 64 bytes. + * And our protocol has a 14 bytes header. + * So the size of `struct touchpad_info` must be less + * than or equal to 50 bytes + */ +BUILD_ASSERT(sizeof(struct touchpad_info) <= 50); + void fw_update_command_handler(void *body, size_t cmd_size, size_t *response_size);