33 for (i = 0; i < len; i++)
48 for (i = csum = 0; i < size; i++)
76 int out_bytes =
cec_command->cmd_size_in +
sizeof(*rq);
79 if (out_bytes >
sizeof(*cmd)) {
98 (
const uint8_t*)cmd, out_bytes));
120 if (in_bytes >
sizeof(*resp)) {
168 in_bytes =
sizeof(*rs) + rs->
data_len;
196 int out_bytes, in_bytes;
218 rv = crosec_io(out_bytes, in_bytes, context);
221 __func__, rv >= 0 ? rv : -rv);
void * memcpy(void *dest, const void *src, size_t n)
#define printk(level,...)
static int crosec_command_proto_v3(struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context)
static int handle_proto3_response(struct ec_response_v3 *resp, struct chromeec_command *cec_command)
Handle a protocol version 3 response packet.
static void cros_ec_dump_data(const char *name, int cmd, const uint8_t *data, int len)
static int create_proto3_request(const struct chromeec_command *cec_command, struct ec_command_v3 *cmd)
Create a request packet for protocol version 3.
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.
int crosec_command_proto(struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context)
static int send_command_proto3(struct chromeec_command *cec_command, crosec_io_t crosec_io, void *context)
static int cros_ec_calc_checksum(const uint8_t *data, int size)
void *__weak crosec_get_buffer(size_t size, int req)
int(* crosec_io_t)(size_t req_size, size_t resp_size, void *context)
#define EC_HOST_RESPONSE_VERSION
@ EC_RES_INVALID_CHECKSUM
@ EC_RES_REQUEST_TRUNCATED
@ EC_RES_INVALID_RESPONSE
@ EC_RES_RESPONSE_TOO_BIG
#define EC_HOST_REQUEST_VERSION
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
const struct smm_save_state_ops *legacy_ops __weak
struct ec_host_request header
struct ec_host_request - Version 3 request from host.
struct ec_host_response - Version 3 response from EC.
struct ec_host_response header