summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJames Hilliard <[email protected]>2026-07-08 13:31:17 -0600
committerJerome Forissier <[email protected]>2026-07-23 17:05:20 +0200
commit0601d2d9a2908d92cfad23f6a1dfcf1eaccad8b7 (patch)
tree377f3ca958eb9f4718e20b21a196f1932f305bf3 /include
parentafcd55654d858f8f6c92847e895650c443c5f8ec (diff)
net: lwip: add tftpsrv command
The legacy network stack supports tftpsrv, which listens for an incoming TFTP write request and receives the first file into memory. Despite the old command help wording, the command returns after receiving the file and does not boot it automatically. The lwIP stack already builds the lwIP TFTP application, but only wires it up for client-side tftpboot. Add a lwIP tftpsrv command and implement the server path with tftp_init_server(). Reuse the existing lwIP TFTP write callback and memory copy path so LMB checks, progress output, filesize/fileaddr updates and EFI bootdev handling stay consistent with tftpboot. Track receive timeout and write-failure state around the lwIP callbacks so a stalled or rejected receive is not reported as a successful close. Move CMD_TFTPSRV out of the legacy-only Kconfig block so it can be enabled with either network stack. Update the command help text and add usage documentation for the receive-only behavior. Add pytest coverage for tftpsrv using a generated host file and curl's TFTP upload support. Enable the command in qemu_arm64_lwip_defconfig so the test can be run with the existing lwIP QEMU build when the boardenv provides env__net_tftpsrv_file. Signed-off-by: James Hilliard <[email protected]> [Jerome Forissier: remove trailing ':' after SPDX tag] Signed-off-by: Jerome Forissier <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/net-lwip.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/net-lwip.h b/include/net-lwip.h
index 5d0627eb271..8e59a2299e0 100644
--- a/include/net-lwip.h
+++ b/include/net-lwip.h
@@ -53,6 +53,7 @@ bool wget_validate_uri(char *uri);
int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
int do_nfs(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
+int do_tftpsrv(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
#endif /* __NET_LWIP_H__ */