![]() |
coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
|
#include <console/console.h>
#include <stdint.h>
#include <string.h>
#include "ec.h"
#include "ec_commands.h"
#include "ec_message.h"
Go to the source code of this file.
Data Structures | |
struct | ec_command_v3 |
struct | ec_response_v3 |
Functions | |
void *__weak | crosec_get_buffer (size_t size, int req) |
static void | cros_ec_dump_data (const char *name, int cmd, const uint8_t *data, int len) |
static int | cros_ec_calc_checksum (const uint8_t *data, int size) |
static int | create_proto3_request (const struct chromeec_command *cec_command, struct ec_command_v3 *cmd) |
Create a request packet for protocol version 3. More... | |
static int | prepare_proto3_response_buffer (const struct chromeec_command *cec_command, struct ec_response_v3 *resp) |
Prepare the device to receive a protocol version 3 response. More... | |
static int | handle_proto3_response (struct ec_response_v3 *resp, struct chromeec_command *cec_command) |
Handle a protocol version 3 response packet. More... | |
static int | send_command_proto3 (struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context) |
static int | crosec_command_proto_v3 (struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context) |
int | crosec_command_proto (struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context) |
|
static |
Create a request packet for protocol version 3.
cec_command | Command description. |
cmd | Packed command bit stream. |
Definition at line 72 of file crosec_proto.c.
References BIOS_ERR, ec_host_request::checksum, ec_host_request::command, ec_host_request::command_version, cros_ec_calc_checksum(), cros_ec_dump_data(), ec_command_v3::data, ec_host_request::data_len, EC_HOST_REQUEST_VERSION, EC_RES_REQUEST_TRUNCATED, ec_command_v3::header, memcpy(), printk, ec_host_request::reserved, and ec_host_request::struct_version.
Referenced by send_command_proto3().
|
static |
Definition at line 44 of file crosec_proto.c.
Referenced by create_proto3_request(), and handle_proto3_response().
Definition at line 25 of file crosec_proto.c.
References BIOS_DEBUG, name, and printk.
Referenced by create_proto3_request(), and handle_proto3_response().
int crosec_command_proto | ( | struct chromeec_command * | cec_command, |
crosec_io_t | crosec_io, | ||
void * | context | ||
) |
Definition at line 240 of file crosec_proto.c.
Referenced by google_chromeec_command().
|
static |
Definition at line 229 of file crosec_proto.c.
References send_command_proto3().
Definition at line 12 of file crosec_proto.c.
References BIOS_DEBUG, NULL, and printk.
Referenced by send_command_proto3().
|
static |
Handle a protocol version 3 response packet.
The packet must already be stored in the response buffer.
resp | Response buffer. |
cec_command | Command structure to receive valid response. |
Definition at line 139 of file crosec_proto.c.
References BIOS_ERR, cros_ec_calc_checksum(), cros_ec_dump_data(), ec_response_v3::data, ec_host_response::data_len, EC_HOST_RESPONSE_VERSION, EC_RES_INVALID_CHECKSUM, EC_RES_INVALID_RESPONSE, EC_RES_RESPONSE_TOO_BIG, ec_response_v3::header, memcpy(), printk, ec_host_response::reserved, ec_host_response::result, and ec_host_response::struct_version.
Referenced by send_command_proto3().
|
static |
Prepare the device to receive a protocol version 3 response.
cec_command | Command description. |
resp | Response buffer. |
Definition at line 113 of file crosec_proto.c.
References BIOS_ERR, EC_RES_RESPONSE_TOO_BIG, ec_response_v3::header, and printk.
Referenced by send_command_proto3().
|
static |
Definition at line 193 of file crosec_proto.c.
References BIOS_ERR, create_proto3_request(), crosec_get_buffer(), EC_RES_ERROR, handle_proto3_response(), NULL, prepare_proto3_response_buffer(), and printk.
Referenced by crosec_command_proto_v3().