STRUCT EC_HOST_REQUEST(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 be 3. 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 with EC_RES_INVALID_HEADER and 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 to 0. yes including the checksum byte. it's self-referential and iconic like that 🫢
  • command β€” the command you're sending, as in EC_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 to 0. 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 with struct_version or reserved. one is a hard 3, the other is a hard 0. 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