diff options
| author | Tom Rini <[email protected]> | 2020-10-01 09:46:10 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2020-10-01 09:46:10 -0400 |
| commit | 26acc6395fee680cea72e51348bd59e206eb0464 (patch) | |
| tree | 14a2a97d03c4c0cf7b0c531fbdcf9ebec7cfdd13 /cmd | |
| parent | 097bbf1ba97b8ece930deca663f05ea444e99e45 (diff) | |
| parent | 912ece4c3dd486bcd62f0d0dfee760b9f01caac6 (diff) | |
Merge branch '2020-09-30-assorted-network-improvements' into next
- Generic UDP framework
- TFTP fixes
- dwc_eth_qos, smc911x, smc911x and mscc phy fixes
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/Kconfig | 1 | ||||
| -rw-r--r-- | cmd/net.c | 10 |
2 files changed, 10 insertions, 1 deletions
diff --git a/cmd/Kconfig b/cmd/Kconfig index 30c358d7e74..999b6cf239a 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -1645,6 +1645,7 @@ config CMD_CDP config CMD_SNTP bool "sntp" + select PROT_UDP help Synchronize RTC via network diff --git a/cmd/net.c b/cmd/net.c index 9bbcdbcfe07..beb2877dfd5 100644 --- a/cmd/net.c +++ b/cmd/net.c @@ -13,6 +13,8 @@ #include <env.h> #include <image.h> #include <net.h> +#include <net/udp.h> +#include <net/sntp.h> static int netboot_common(enum proto_t, struct cmd_tbl *, int, char * const []); @@ -356,6 +358,12 @@ U_BOOT_CMD( #endif #if defined(CONFIG_CMD_SNTP) +static struct udp_ops sntp_ops = { + .prereq = sntp_prereq, + .start = sntp_start, + .data = NULL, +}; + int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { char *toff; @@ -380,7 +388,7 @@ int do_sntp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) else net_ntp_time_offset = simple_strtol(toff, NULL, 10); - if (net_loop(SNTP) < 0) { + if (udp_loop(&sntp_ops) < 0) { printf("SNTP failed: host %pI4 not responding\n", &net_ntp_server); return CMD_RET_FAILURE; |
