net: make dhcp_run() common for NET and NET_LWIP

There are currently two implementations of dhcp_run(): one in cmd/net.c
for NET and one in net/lwip/dhcp.c for NET_LWIP. There is no
justification for that. Therefore, move the NET version into
net/net-common.c to be used by both stacks, and drop the NET_LWIP
version which by the way does not look totally correct.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Suggested-by: Tom Rini <trini@konsulko.com>
Acked-by: Benjamin Hahn <B.Hahn@phytec.de>
This commit is contained in:
Jerome Forissier
2025-10-09 14:30:14 +02:00
parent b24268d151
commit 4b8e785851
5 changed files with 47 additions and 57 deletions

View File

@@ -479,6 +479,16 @@ int net_loop(enum proto_t protocol);
*/
int dhcp_run(ulong addr, const char *fname, bool autoload);
/**
* do_dhcp - Run the dhcp command
*
* @cmdtp: Unused
* @flag: Command flags (CMD_FLAG_...)
* @argc: Number of arguments
* @argv: List of arguments
* Return: result (see enum command_ret_t)
*/
int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
/**
* do_ping - Run the ping command