Lines Matching refs:fd
106 static int send_socket_ack(void *arg, int fd, char *ack) in send_socket_ack() argument
112 client = find_socket_client(sock, fd); in send_socket_ack()
116 LOG_PRINTF("Receive shutdown request from unix socket, fd=%d\n", client->fd); in send_socket_ack()
124 int socket_req_shutdown_service_vm_handler(void *arg, int fd) in socket_req_shutdown_service_vm_handler() argument
129 ret = send_socket_ack(arg, fd, ACK_REQ_SYS_SHUTDOWN); in socket_req_shutdown_service_vm_handler()
137 static int req_user_vm_shutdown_reboot(void *arg, int fd, char *msg, char *ack_msg) in req_user_vm_shutdown_reboot() argument
145 client = find_socket_client(sock, fd); in req_user_vm_shutdown_reboot()
151 (void) send_socket_ack(arg, fd, USER_VM_DISCONNECT); in req_user_vm_shutdown_reboot()
156 ret = send_socket_ack(arg, fd, ack_msg); in req_user_vm_shutdown_reboot()
168 int socket_req_user_vm_shutdown_handler(void *arg, int fd) in socket_req_user_vm_shutdown_handler() argument
170 return req_user_vm_shutdown_reboot(arg, fd, USER_VM_SHUTDOWN, ACK_REQ_USER_VM_SHUTDOWN); in socket_req_user_vm_shutdown_handler()
172 int socket_req_user_vm_reboot_handler(void *arg, int fd) in socket_req_user_vm_reboot_handler() argument
174 return req_user_vm_shutdown_reboot(arg, fd, USER_VM_REBOOT, ACK_REQ_USER_VM_REBOOT); in socket_req_user_vm_reboot_handler()
177 int req_system_shutdown_reboot(void *arg, int fd, char *msg, char *ack_msg) in req_system_shutdown_reboot() argument
185 (void) send_socket_ack(arg, fd, USER_VM_DISCONNECT); in req_system_shutdown_reboot()
190 ret = send_socket_ack(arg, fd, ack_msg); in req_system_shutdown_reboot()
203 int socket_req_system_reboot_user_vm_handler(void *arg, int fd) in socket_req_system_reboot_user_vm_handler() argument
205 return req_system_shutdown_reboot(arg, fd, REQ_SYS_REBOOT, ACK_REQ_SYS_REBOOT); in socket_req_system_reboot_user_vm_handler()
208 int socket_req_system_shutdown_user_vm_handler(void *arg, int fd) in socket_req_system_shutdown_user_vm_handler() argument
210 return req_system_shutdown_reboot(arg, fd, REQ_SYS_SHUTDOWN, ACK_REQ_SYS_SHUTDOWN); in socket_req_system_shutdown_user_vm_handler()
232 int sync_cmd_handler(void *arg, int fd) in sync_cmd_handler() argument
237 c_dev = find_uart_channel_dev(c, fd); in sync_cmd_handler()
247 int req_reboot_handler(void *arg, int fd) in req_reboot_handler() argument
253 c_dev = find_uart_channel_dev(c, fd); in req_reboot_handler()
283 int req_shutdown_handler(void *arg, int fd) in req_shutdown_handler() argument
289 c_dev = find_uart_channel_dev(c, fd); in req_shutdown_handler()
318 int ack_poweroff_handler(void *arg, int fd) in ack_poweroff_handler() argument
323 c_dev = find_uart_channel_dev(c, fd); in ack_poweroff_handler()
344 int ack_timeout_handler(void *arg, int fd) in ack_timeout_handler() argument
349 c_dev = find_uart_channel_dev(c, fd); in ack_timeout_handler()
353 ack_poweroff_handler(arg, fd); in ack_timeout_handler()
358 static int ack_user_vm_cmd(void *arg, int fd, char *ack_msg) in ack_user_vm_cmd() argument
363 c_dev = find_uart_channel_dev(c, fd); in ack_user_vm_cmd()
370 int ack_user_vm_shutdown_cmd_handler(void *arg, int fd) in ack_user_vm_shutdown_cmd_handler() argument
372 return ack_user_vm_cmd(arg, fd, ACK_USER_VM_SHUTDOWN); in ack_user_vm_shutdown_cmd_handler()
375 int ack_user_vm_reboot_cmd_handler(void *arg, int fd) in ack_user_vm_reboot_cmd_handler() argument
377 return ack_user_vm_cmd(arg, fd, ACK_USER_VM_REBOOT); in ack_user_vm_reboot_cmd_handler()
386 int acked_sync_handler(void *arg, int fd) in acked_sync_handler() argument
391 c_dev = find_uart_channel_dev(c, fd); in acked_sync_handler()
405 int acked_req_shutdown_reboot_handler(void *arg, int fd) in acked_req_shutdown_reboot_handler() argument
410 c_dev = find_uart_channel_dev(c, fd); in acked_req_shutdown_reboot_handler()
417 static int user_vm_shutdown_reboot(struct uart_channel *c, int fd, char *ack, bool reboot) in user_vm_shutdown_reboot() argument
422 c_dev = find_uart_channel_dev(c, fd); in user_vm_shutdown_reboot()
447 int poweroff_cmd_handler(void *arg, int fd) in poweroff_cmd_handler() argument
451 (void) user_vm_shutdown_reboot(c, fd, ACK_POWEROFF, false); in poweroff_cmd_handler()
454 int user_vm_shutdown_cmd_handler(void *arg, int fd) in user_vm_shutdown_cmd_handler() argument
457 (void) user_vm_shutdown_reboot(c, fd, ACK_USER_VM_SHUTDOWN, false); in user_vm_shutdown_cmd_handler()
460 int user_vm_reboot_cmd_handler(void *arg, int fd) in user_vm_reboot_cmd_handler() argument
463 (void) user_vm_shutdown_reboot(c, fd, ACK_USER_VM_REBOOT, true); in user_vm_reboot_cmd_handler()
473 int ack_timeout_default_handler(void *arg, int fd) in ack_timeout_default_handler() argument
478 c_dev = find_uart_channel_dev(c, fd); in ack_timeout_default_handler()
484 LOG_PRINTF("Failed to receive ACK message from service VM (fd = %d)\n", fd); in ack_timeout_default_handler()