net: Export auto_load, use it in rarp
The rarp code includes another instance of the auto_load logic, so call
what is now net_auto_load() instead.
This also fixes an incorrect call to TftpStart() which was never seen
since apparently no boards enable rarp.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
diff --git a/net/bootp.c b/net/bootp.c
index b703f42..b789eec 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -138,36 +138,6 @@
return (curlen);
}
-/*
- * Check if autoload is enabled. If so, use either NFS or TFTP to download
- * the boot file.
- */
-static void auto_load(void)
-{
- const char *s = getenv("autoload");
-
- if (s != NULL) {
- if (*s == 'n') {
- /*
- * Just use BOOTP to configure system;
- * Do not use TFTP to load the bootfile.
- */
- NetState = NETLOOP_SUCCESS;
- return;
- }
-#if defined(CONFIG_CMD_NFS)
- if (strcmp(s, "NFS") == 0) {
- /*
- * Use NFS to load the bootfile.
- */
- NfsStart();
- return;
- }
-#endif
- }
- TftpStart(TFTPGET);
-}
-
#if !defined(CONFIG_CMD_DHCP)
static void BootpVendorFieldProcess (u8 * ext)
@@ -354,7 +324,7 @@
debug("Got good BOOTP\n");
- auto_load();
+ net_auto_load();
}
#endif
@@ -979,7 +949,7 @@
dhcp_state = BOUND;
printf ("DHCP client bound to address %pI4\n", &NetOurIP);
- auto_load();
+ net_auto_load();
return;
}
break;