projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-spi into next
[platform/kernel/u-boot.git]
/
cmd
/
net.c
diff --git
a/cmd/net.c
b/cmd/net.c
index
6bce214
..
9bbcdbc
100644
(file)
--- a/
cmd/net.c
+++ b/
cmd/net.c
@@
-8,14
+8,17
@@
* Boot support
*/
#include <common.h>
* Boot support
*/
#include <common.h>
+#include <bootstage.h>
#include <command.h>
#include <env.h>
#include <command.h>
#include <env.h>
+#include <image.h>
#include <net.h>
#include <net.h>
-static int netboot_common(enum proto_t,
cmd_tbl_t
*, int, char * const []);
+static int netboot_common(enum proto_t,
struct cmd_tbl
*, int, char * const []);
#ifdef CONFIG_CMD_BOOTP
#ifdef CONFIG_CMD_BOOTP
-static int do_bootp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_bootp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(BOOTP, cmdtp, argc, argv);
}
{
return netboot_common(BOOTP, cmdtp, argc, argv);
}
@@
-28,7
+31,7
@@
U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_TFTPBOOT
#endif
#ifdef CONFIG_CMD_TFTPBOOT
-int do_tftpb(
cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])
+int do_tftpb(
struct cmd_tbl *cmdtp, int flag, int argc, char *
const argv[])
{
int ret;
{
int ret;
@@
-46,7
+49,8
@@
U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_TFTPPUT
#endif
#ifdef CONFIG_CMD_TFTPPUT
-static int do_tftpput(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_tftpput(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(TFTPPUT, cmdtp, argc, argv);
}
{
return netboot_common(TFTPPUT, cmdtp, argc, argv);
}
@@
-59,7
+63,8
@@
U_BOOT_CMD(
#endif
#ifdef CONFIG_CMD_TFTPSRV
#endif
#ifdef CONFIG_CMD_TFTPSRV
-static int do_tftpsrv(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
+static int do_tftpsrv(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(TFTPSRV, cmdtp, argc, argv);
}
{
return netboot_common(TFTPSRV, cmdtp, argc, argv);
}
@@
-76,7
+81,7
@@
U_BOOT_CMD(
#ifdef CONFIG_CMD_RARP
#ifdef CONFIG_CMD_RARP
-int do_rarpb(
cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])
+int do_rarpb(
struct cmd_tbl *cmdtp, int flag, int argc, char *
const argv[])
{
return netboot_common(RARP, cmdtp, argc, argv);
}
{
return netboot_common(RARP, cmdtp, argc, argv);
}
@@
-89,7
+94,8
@@
U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_DHCP)
#endif
#if defined(CONFIG_CMD_DHCP)
-static int do_dhcp(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_dhcp(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(DHCP, cmdtp, argc, argv);
}
{
return netboot_common(DHCP, cmdtp, argc, argv);
}
@@
-102,7
+108,8
@@
U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_NFS)
#endif
#if defined(CONFIG_CMD_NFS)
-static int do_nfs(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_nfs(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
return netboot_common(NFS, cmdtp, argc, argv);
}
{
return netboot_common(NFS, cmdtp, argc, argv);
}
@@
-128,11
+135,15
@@
static void netboot_update_env(void)
env_set("netmask", tmp);
}
env_set("netmask", tmp);
}
+#ifdef CONFIG_CMD_BOOTP
if (net_hostname[0])
env_set("hostname", net_hostname);
if (net_hostname[0])
env_set("hostname", net_hostname);
+#endif
+#ifdef CONFIG_CMD_BOOTP
if (net_root_path[0])
env_set("rootpath", net_root_path);
if (net_root_path[0])
env_set("rootpath", net_root_path);
+#endif
if (net_ip.s_addr) {
ip_to_string(net_ip, tmp);
if (net_ip.s_addr) {
ip_to_string(net_ip, tmp);
@@
-158,8
+169,10
@@
static void netboot_update_env(void)
env_set("dnsip2", tmp);
}
#endif
env_set("dnsip2", tmp);
}
#endif
+#ifdef CONFIG_CMD_BOOTP
if (net_nis_domain[0])
env_set("domain", net_nis_domain);
if (net_nis_domain[0])
env_set("domain", net_nis_domain);
+#endif
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
if (net_ntp_time_offset) {
#if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_TIMEOFFSET)
if (net_ntp_time_offset) {
@@
-175,8
+188,8
@@
static void netboot_update_env(void)
#endif
}
#endif
}
-static int netboot_common(enum proto_t proto,
cmd_tbl_t
*cmdtp, int argc,
-
char *
const argv[])
+static int netboot_common(enum proto_t proto,
struct cmd_tbl
*cmdtp, int argc,
+
char *
const argv[])
{
char *s;
char *end;
{
char *s;
char *end;
@@
-271,7
+284,8
@@
static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
}
#if defined(CONFIG_CMD_PING)
}
#if defined(CONFIG_CMD_PING)
-static int do_ping(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+static int do_ping(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
if (argc < 2)
return CMD_RET_USAGE;
{
if (argc < 2)
return CMD_RET_USAGE;
@@
-319,7
+333,7
@@
static void cdp_update_env(void)
}
}
}
}
-int do_cdp(
cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])
+int do_cdp(
struct cmd_tbl *cmdtp, int flag, int argc, char *
const argv[])
{
int r;
{
int r;
@@
-342,7
+356,7
@@
U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_SNTP)
#endif
#if defined(CONFIG_CMD_SNTP)
-int do_sntp(
cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])
+int do_sntp(
struct cmd_tbl *cmdtp, int flag, int argc, char *
const argv[])
{
char *toff;
{
char *toff;
@@
-383,7
+397,7
@@
U_BOOT_CMD(
#endif
#if defined(CONFIG_CMD_DNS)
#endif
#if defined(CONFIG_CMD_DNS)
-int do_dns(
cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])
+int do_dns(
struct cmd_tbl *cmdtp, int flag, int argc, char *
const argv[])
{
if (argc == 1)
return CMD_RET_USAGE;
{
if (argc == 1)
return CMD_RET_USAGE;
@@
-429,8
+443,8
@@
U_BOOT_CMD(
#endif /* CONFIG_CMD_DNS */
#if defined(CONFIG_CMD_LINK_LOCAL)
#endif /* CONFIG_CMD_DNS */
#if defined(CONFIG_CMD_LINK_LOCAL)
-static int do_link_local(
cmd_tbl_t
*cmdtp, int flag, int argc,
-
char *
const argv[])
+static int do_link_local(
struct cmd_tbl
*cmdtp, int flag, int argc,
+
char *
const argv[])
{
char tmp[22];
{
char tmp[22];