STRUCT EC_HOST_REQUEST(9)
β¨ struct ec_host_request(9) β¨
okay so bestie, welcome to the Kernel API Manual section 9, and today's main character is struct ec_host_request β literally the version 3 request from host π
like this is the little header packet your host sends over to the EC and it has to be perfect or the EC is gonna side-eye you, no cap.
πΈ SYNOPSIS πΈ
struct ec_host_request {
uint8_t struct_version;
uint8_t checksum;
uint16_t command;
uint8_t command_version;
uint8_t reserved;
uint16_t data_len;
};
like look at her. six fields. flawless. tiny little icon β¨
π MEMBERS π
struct_versionβ bestie this should be3. that's the whole vibe. and if the EC gets a header with a version it doesn't know how to parse, it will hit you withEC_RES_INVALID_HEADERand honestly? fair. it's giving "read the room". πchecksumβ the checksum of the request and the data. the sum of all bytes including the checksum itself should total to0. yes including the checksum byte. it's self-referential and iconic like that π«Άcommandβ the command you're sending, as inEC_CMD_.... pick your fighter πcommand_versionβ the command version. that's it, that's the field π¦reservedβ unused byte in the current protocol version; set to0. it's just sitting there, minding its business, holding space for the future πdata_lenβ length of the data that follows this header. the header is the trailer, the data is the movie, iykyk π
fr fr do not get cute withstruct_versionorreserved. one is a hard3, the other is a hard0. everything else is your moment.
π SEE ALSO π
okay this is a whole group chat, are you ready, because the whole EC family showed up and they all ate:
- Kernel file
./include/linux/platform_data/cros_ec_commands.h struct ec_lpc_host_args(9)struct ec_host_response(9)struct ec_response_proto_version(9)struct ec_params_hello(9)struct ec_response_hello(9)struct ec_response_get_version(9)struct ec_params_read_test(9)struct ec_response_read_test(9)struct ec_response_get_chip_info(9)struct ec_response_board_version(9)struct ec_params_read_memmap(9)struct ec_params_get_cmd_versions(9)struct ec_params_get_cmd_versions_v1(9)struct ec_response_get_cmd_versions(9)struct ec_response_get_comms_status(9)struct ec_response_get_protocol_info(9)struct ec_response_flash_info(9)struct ec_response_flash_info_1(9)struct ec_params_flash_read(9)struct ec_params_flash_write(9)struct ec_params_flash_erase(9)struct ec_params_flash_erase_v1(9)struct ec_params_flash_protect(9)struct ec_response_flash_protect(9)struct ec_params_flash_region_info(9)struct ec_params_flash_select(9)struct ec_params_cec_write(9)struct ec_params_cec_write_v1(9)struct ec_params_cec_read(9)struct ec_response_cec_read(9)struct ec_params_cec_set(9)struct ec_params_cec_get(9)struct ec_response_cec_get(9)struct ec_response_cec_port_count(9)struct ec_params_battery_static_info(9)struct ec_response_battery_static_info(9)struct ec_params_battery_dynamic_info(9)struct ec_response_battery_dynamic_info(9)struct ec_params_charger_control(9)
like that's forty entries. FORTY. we love a thorough queen π
and that's the page, bestie!! this one lives in the Kernel file ./include/linux/platform_data, dated October 2026, and it's filed under struct ec_host_request(9). go forth and checksum responsibly π§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms