diff options
-rw-r--r-- | common/host_command.c | 9 | ||||
-rw-r--r-- | common/system_common.c | 2 | ||||
-rw-r--r-- | include/host_command.h | 10 |
3 files changed, 18 insertions, 3 deletions
diff --git a/common/host_command.c b/common/host_command.c index 088f8e8521..c7fabeef3f 100644 --- a/common/host_command.c +++ b/common/host_command.c @@ -39,6 +39,11 @@ uint8_t *host_get_memmap(int offset) #endif } +void host_send_response(struct host_cmd_handler_args *args) +{ + args->send_response(args); +} + void host_command_received(struct host_cmd_handler_args *args) { /* TODO: should warn if we already think we're in a command */ @@ -56,7 +61,7 @@ void host_command_received(struct host_cmd_handler_args *args) /* If the driver has signalled an error, send the response now */ if (args->result) { - args->send_response(args); + host_send_response(args); } else { /* Save the command */ pending_args = args; @@ -237,7 +242,7 @@ void host_command_task(void) if ((evt & TASK_EVENT_CMD_PENDING) && pending_args) { pending_args->result = host_command_process(pending_args); - pending_args->send_response(pending_args); + host_send_response(pending_args); } } } diff --git a/common/system_common.c b/common/system_common.c index e2dcddc342..60bb888726 100644 --- a/common/system_common.c +++ b/common/system_common.c @@ -829,7 +829,7 @@ int host_command_reboot(struct host_cmd_handler_args *args) #ifdef CONFIG_TASK_HOSTCMD /* Clean busy bits on host */ args->result = EC_RES_SUCCESS; - args->send_response(args); + host_send_response(args); #endif CPRINTF("[%T Executing host reboot command %d]\n", p.cmd); diff --git a/include/host_command.h b/include/host_command.h index 5313277cab..6218d17ebc 100644 --- a/include/host_command.h +++ b/include/host_command.h @@ -114,6 +114,16 @@ void host_clear_events(uint32_t mask); uint32_t host_get_events(void); /** + * Send a response to the relevent driver for transmission + * + * Once command processing is complete, this is used to send a response + * back to the host. + * + * @param args Contains response to send + */ +void host_send_response(struct host_cmd_handler_args *args); + +/** * Called by host interface module when a command is received. */ void host_command_received(struct host_cmd_handler_args *args); |