1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-03 09:42:22 +02:00

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>
This commit is contained in:
Dmitrii Merkurev
2023-04-12 19:49:31 +01:00
committed by Tom Rini
parent 443d319180
commit c8acbbbf08
4 changed files with 46 additions and 31 deletions

View File

@@ -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: