net: ping: make do_ping() available via <net.h>
Make the do_ping() function in cmd/net.c a global one by getting rid of the static qualifier, and move the prototype declaration from net-lwip.h to net-common.h. This makes the function available to other parts of U-Boot when CONFIG_NET=y, as was already the case when CONFIG_NET_LWIP=y. This is a peparation step to make the sandbox tests use a common API between NET and NET_LWIP. Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -456,8 +456,7 @@ static int netboot_common(enum proto_t proto, struct cmd_tbl *cmdtp, int argc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_PING)
|
#if defined(CONFIG_CMD_PING)
|
||||||
static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc,
|
int do_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||||
char *const argv[])
|
|
||||||
{
|
{
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
return CMD_RET_USAGE;
|
return CMD_RET_USAGE;
|
||||||
|
@@ -493,6 +493,18 @@ int net_loop(enum proto_t protocol);
|
|||||||
*/
|
*/
|
||||||
int dhcp_run(ulong addr, const char *fname, bool autoload);
|
int dhcp_run(ulong addr, const char *fname, bool autoload);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* do_ping - Run the ping 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_ping(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* do_tftpb - Run the tftpboot command
|
* do_tftpb - Run the tftpboot command
|
||||||
*
|
*
|
||||||
|
@@ -34,7 +34,6 @@ bool wget_validate_uri(char *uri);
|
|||||||
|
|
||||||
int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
int do_dns(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]);
|
||||||
int do_ping(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[]);
|
int do_wget(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]);
|
||||||
|
|
||||||
#endif /* __NET_LWIP_H__ */
|
#endif /* __NET_LWIP_H__ */
|
||||||
|
Reference in New Issue
Block a user