/* Processes a received packet */
extern void NetReceive(volatile uchar *, int);
+/*
+ * Check if autoload is enabled. If so, use either NFS or TFTP to download
+ * the boot file.
+ */
+void net_auto_load(void);
+
/*
* The following functions are a bit ugly, but necessary to deal with
* alignment restrictions on ARM.
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)
debug("Got good BOOTP\n");
- auto_load();
+ net_auto_load();
}
#endif
dhcp_state = BOUND;
printf ("DHCP client bound to address %pI4\n", &NetOurIP);
- auto_load();
+ net_auto_load();
return;
}
break;
}
}
+/*
+ * Check if autoload is enabled. If so, use either NFS or TFTP to download
+ * the boot file.
+ */
+void net_auto_load(void)
+{
+ const char *s = getenv("autoload");
+
+ if (s != NULL) {
+ if (*s == 'n') {
+ /*
+ * Just use BOOTP/RARP 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);
+}
+
static void NetInitLoop(enum proto_t protocol)
{
static int env_changed_id;
RarpHandler(uchar *dummi0, unsigned dummi1, IPaddr_t sip, unsigned dummi2,
unsigned dummi3)
{
- char *s;
debug("Got good RARP\n");
- if ((s = getenv("autoload")) != NULL) {
- if (*s == 'n') {
- /*
- * Just use RARP to configure system;
- * Do not use TFTP/NFS to to load the bootfile.
- */
- NetState = NETLOOP_SUCCESS;
- return;
-#if defined(CONFIG_CMD_NFS)
- } else if ((s != NULL) && !strcmp(s, "NFS")) {
- NfsStart();
- return;
-#endif
- }
- }
- TftpStart ();
+ net_auto_load();
}