Files
MilkV-Duo/u-boot-2021.10/doc/README.udp
sam.xiang f8fc109960 [uboot] create uboot from github:
repo: https://github.com/u-boot/u-boot
	commit: d80bb749fab53da72c4a0e09b8c2d2aaa3103c91

Change-Id: Ie6434426e1ec15bc08bb1832798e371f3fd5fb29
2023-03-10 20:30:57 +08:00

36 lines
874 B
Plaintext

Udp framework
The udp framework is build on top of network framework and is designed
to define new protocol or new command based on udp without modifying
the network framework.
The udp framework define a function udp_loop that take as argument
a structure udp_ops (defined in include/net/udp.h) :
struct udp_ops {
int (*prereq)(void *data);
int (*start)(void *data);
void *data;
};
The callback prereq define if all the requirements are
valid before running the network/udp loop.
The callback start define the first step in the network/udp loop,
and it may also be used to configure a timemout and udp handler.
The pointer data is used to store private data that
could be used by both callback.
A simple example to use this framework:
static struct udp_ops udp_ops = {
.prereq = wmp_prereq,
.start = wmp_start,
.data = NULL,
};
...
err = udp_loop(&udp_ops);