summaryrefslogtreecommitdiff
path: root/include/host_command.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2012-07-22 12:20:09 -0700
committerGerrit <chrome-bot@google.com>2012-07-22 13:17:04 -0700
commitee71c0ae1b8f34b955e466e2c84d7fd95c55ace3 (patch)
tree1d5f1c70d3efa707bd3d156cd7b02c98342c5bce /include/host_command.h
parent5fdf655b12f161f69b28e75f285a99f08a97d5f9 (diff)
downloadchrome-ec-ee71c0ae1b8f34b955e466e2c84d7fd95c55ace3.tar.gz
Revert "host_command: Add send_result() to the arg structure"
This reverts commit 18db93b25b05c871826fd1853a33a560e64ed247 Breaks link checksums. Change-Id: Ieeb278b7d4da0600bdc9ced1476b67f23abce1a1 Reviewed-on: https://gerrit.chromium.org/gerrit/28136 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'include/host_command.h')
-rw-r--r--include/host_command.h29
1 files changed, 11 insertions, 18 deletions
diff --git a/include/host_command.h b/include/host_command.h
index a88761a6e2..65cf849c6a 100644
--- a/include/host_command.h
+++ b/include/host_command.h
@@ -13,16 +13,10 @@
/* Args for host command handler */
struct host_cmd_handler_args {
- /*
- * The driver that receives the command sets up the send_response()
- * handler. Once the command is processed this handler is called to
- * send the response back to the host.
- */
- void (*send_response)(struct host_cmd_handler_args *args);
uint8_t command; /* Command (e.g., EC_CMD_FLASH_GET_INFO) */
uint8_t version; /* Version of command (0-31) */
- uint8_t params_size; /* Size of input parameters in bytes */
const uint8_t *params; /* Input parameters */
+ uint8_t params_size; /* Size of input parameters in bytes */
/*
* Pointer to output response data buffer. On input to the handler,
* points to a buffer of size response_max. Command handler can change
@@ -37,17 +31,6 @@ struct host_cmd_handler_args {
*/
uint8_t response_max;
uint8_t response_size; /* Size of data pointed to by resp_ptr */
-
- /*
- * This is the result returned by command and therefore the status to
- * be reported from the command execution to the host. The driver
- * should set this to EC_RES_SUCCESS on receipt of a valid command.
- * It is then passed back to the driver via send_response() when
- * command execution is complete. The driver may still override this
- * when sending the response back to the host if it detects an error
- * in the response or in its own operation.
- */
- enum ec_status result;
};
/* Host command */
@@ -117,6 +100,16 @@ uint32_t host_get_events(void);
*/
void host_command_received(struct host_cmd_handler_args *args);
+/**
+ * Send a successful result code to a host command.
+ *
+ * Response data, if any, has been stored in the args passed to
+ * host_command_received().
+ *
+ * @param result Result code for the command (EC_RES_...)
+ */
+void host_send_response(enum ec_status result);
+
/* Register a host command handler */
#define DECLARE_HOST_COMMAND(command, routine, version_mask) \
const struct host_command __host_cmd_##command \