diff options
author | Dmitrii Merkurev | 2023-04-12 19:49:31 +0100 |
---|---|---|
committer | Tom Rini | 2023-05-05 17:48:44 -0400 |
commit | c8acbbbf0847744ff2ad98e9d8d4e11d5e37eda2 (patch) | |
tree | e37737cfec46839b48ab3e86d49239f9bf24c451 /net/fastboot_tcp.c | |
parent | 443d319180a68156ca152d164f446e6789004c1d (diff) |
net: share fastboot boot handle logic between transports
Introduce reboot, boot and continue commands support to
TCP fastboot by moving existing UDP logic into the common module.
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
Cc: Ying-Chun Liu (PaulLiu) <paul.liu@linaro.org>
Cc: Simon Glass <sjg@chromium.org>
Сс: Joe Hershberger <joe.hershberger@ni.com>
Сс: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/fastboot_tcp.c')
-rw-r--r-- | net/fastboot_tcp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/fastboot_tcp.c b/net/fastboot_tcp.c index b5613b6aa20..2eb52ea2567 100644 --- a/net/fastboot_tcp.c +++ b/net/fastboot_tcp.c @@ -73,6 +73,7 @@ static void fastboot_tcp_handler_ipv4(uchar *pkt, u16 dport, u32 tcp_seq_num, u32 tcp_ack_num, u8 action, unsigned int len) { + int fastboot_command_id; u64 command_size; u8 tcp_fin = action & TCP_FIN; u8 tcp_push = action & TCP_PUSH; @@ -115,8 +116,10 @@ static void fastboot_tcp_handler_ipv4(uchar *pkt, u16 dport, break; } strlcpy(command, pkt, len + 1); - fastboot_handle_command(command, response); + fastboot_command_id = fastboot_handle_command(command, response); fastboot_tcp_send_message(response, strlen(response)); + fastboot_handle_boot(fastboot_command_id, + strncmp("OKAY", response, 4) == 0); } break; case FASTBOOT_DISCONNECTING: |