diff options
author | Philippe Reynes <philippe.reynes@softathome.com> | 2020-09-18 14:13:00 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-09-30 16:55:03 -0400 |
commit | b43ea1bf18bf4ba5eeec7131c1a19d864399e422 (patch) | |
tree | 5ae63ab33c462f8c016a61f31eea62c8240dd6e5 /net/net.c | |
parent | cafaa301c98aa8f1b81cf61a91d22d5d68b4b1d3 (diff) |
net: add a generic udp protocol
This commit adds a generic udp protocol framework in the
network loop. So protocol based on udp may be implemented
without modifying the network loop (for example custom
wait magic packet).
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net/net.c')
-rw-r--r-- | net/net.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -102,6 +102,7 @@ #if defined(CONFIG_CMD_PCAP) #include <net/pcap.h> #endif +#include <net/udp.h> #if defined(CONFIG_LED_STATUS) #include <miiphy.h> #include <status_led.h> @@ -544,6 +545,9 @@ restart: break; } + if (IS_ENABLED(CONFIG_PROT_UDP) && protocol == UDP) + udp_start(); + break; } @@ -1364,6 +1368,13 @@ static int net_check_prereq(enum proto_t protocol) } goto common; #endif +#if defined(CONFIG_PROT_UDP) + case UDP: + if (udp_prereq()) + return 1; + goto common; +#endif + #if defined(CONFIG_CMD_NFS) case NFS: #endif @@ -1375,7 +1386,7 @@ static int net_check_prereq(enum proto_t protocol) return 1; } #if defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP) || \ - defined(CONFIG_CMD_DNS) + defined(CONFIG_CMD_DNS) || defined(CONFIG_PROT_UDP) common: #endif /* Fall through */ |