mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-21 04:14:34 +00:00
rarp: Condtionally compile rarp support
Most people don't use the 'rarpboot' command, so only enable it when CONFIG_CMD_RARP is defined. Signed-off-by: Peter Tyser <ptyser@xes-inc.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
3f91ec0fa1
commit
bf6cb247a5
4 changed files with 13 additions and 3 deletions
|
@ -54,6 +54,7 @@ U_BOOT_CMD(
|
||||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_RARP
|
||||||
int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
int do_rarpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
{
|
{
|
||||||
return netboot_common (RARP, cmdtp, argc, argv);
|
return netboot_common (RARP, cmdtp, argc, argv);
|
||||||
|
@ -64,6 +65,7 @@ U_BOOT_CMD(
|
||||||
"boot image via network using RARP/TFTP protocol",
|
"boot image via network using RARP/TFTP protocol",
|
||||||
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
"[loadAddress] [[hostIPaddr:]bootfilename]"
|
||||||
);
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_DHCP)
|
#if defined(CONFIG_CMD_DHCP)
|
||||||
int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
int do_dhcp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
|
|
|
@ -70,6 +70,7 @@
|
||||||
#define CONFIG_CMD_PORTIO /* Port I/O */
|
#define CONFIG_CMD_PORTIO /* Port I/O */
|
||||||
#define CONFIG_CMD_REGINFO /* Register dump */
|
#define CONFIG_CMD_REGINFO /* Register dump */
|
||||||
#define CONFIG_CMD_REISER /* Reiserfs support */
|
#define CONFIG_CMD_REISER /* Reiserfs support */
|
||||||
|
#define CONFIG_CMD_RARP /* rarpboot support */
|
||||||
#define CONFIG_CMD_RUN /* run command in env variable */
|
#define CONFIG_CMD_RUN /* run command in env variable */
|
||||||
#define CONFIG_CMD_SAVEENV /* saveenv */
|
#define CONFIG_CMD_SAVEENV /* saveenv */
|
||||||
#define CONFIG_CMD_SAVES /* save S record dump */
|
#define CONFIG_CMD_SAVES /* save S record dump */
|
||||||
|
|
|
@ -32,7 +32,7 @@ COBJS-$(CONFIG_CMD_DNS) += dns.o
|
||||||
COBJS-$(CONFIG_CMD_NET) += eth.o
|
COBJS-$(CONFIG_CMD_NET) += eth.o
|
||||||
COBJS-$(CONFIG_CMD_NET) += net.o
|
COBJS-$(CONFIG_CMD_NET) += net.o
|
||||||
COBJS-$(CONFIG_CMD_NFS) += nfs.o
|
COBJS-$(CONFIG_CMD_NFS) += nfs.o
|
||||||
COBJS-$(CONFIG_CMD_NET) += rarp.o
|
COBJS-$(CONFIG_CMD_RARP) += rarp.o
|
||||||
COBJS-$(CONFIG_CMD_SNTP) += sntp.o
|
COBJS-$(CONFIG_CMD_SNTP) += sntp.o
|
||||||
COBJS-$(CONFIG_CMD_NET) += tftp.o
|
COBJS-$(CONFIG_CMD_NET) += tftp.o
|
||||||
|
|
||||||
|
|
11
net/net.c
11
net/net.c
|
@ -80,7 +80,9 @@
|
||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include "bootp.h"
|
#include "bootp.h"
|
||||||
#include "tftp.h"
|
#include "tftp.h"
|
||||||
|
#ifdef CONFIG_CMD_RARP
|
||||||
#include "rarp.h"
|
#include "rarp.h"
|
||||||
|
#endif
|
||||||
#include "nfs.h"
|
#include "nfs.h"
|
||||||
#ifdef CONFIG_STATUS_LED
|
#ifdef CONFIG_STATUS_LED
|
||||||
#include <status_led.h>
|
#include <status_led.h>
|
||||||
|
@ -401,11 +403,13 @@ restart:
|
||||||
BootpRequest ();
|
BootpRequest ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(CONFIG_CMD_RARP)
|
||||||
case RARP:
|
case RARP:
|
||||||
RarpTry = 0;
|
RarpTry = 0;
|
||||||
NetOurIP = 0;
|
NetOurIP = 0;
|
||||||
RarpRequest ();
|
RarpRequest ();
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
#if defined(CONFIG_CMD_PING)
|
#if defined(CONFIG_CMD_PING)
|
||||||
case PING:
|
case PING:
|
||||||
PingStart();
|
PingStart();
|
||||||
|
@ -1492,6 +1496,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifdef CONFIG_CMD_RARP
|
||||||
case PROT_RARP:
|
case PROT_RARP:
|
||||||
debug("Got RARP\n");
|
debug("Got RARP\n");
|
||||||
arp = (ARP_t *)ip;
|
arp = (ARP_t *)ip;
|
||||||
|
@ -1515,7 +1520,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
||||||
(*packetHandler)(0,0,0,0);
|
(*packetHandler)(0,0,0,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
case PROT_IP:
|
case PROT_IP:
|
||||||
debug("Got IP\n");
|
debug("Got IP\n");
|
||||||
/* Before we start poking the header, make sure it is there */
|
/* Before we start poking the header, make sure it is there */
|
||||||
|
@ -1729,10 +1734,12 @@ static int net_check_prereq (proto_t protocol)
|
||||||
}
|
}
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
|
|
||||||
case DHCP:
|
#ifdef CONFIG_CMD_RARP
|
||||||
case RARP:
|
case RARP:
|
||||||
|
#endif
|
||||||
case BOOTP:
|
case BOOTP:
|
||||||
case CDP:
|
case CDP:
|
||||||
|
case DHCP:
|
||||||
if (memcmp (NetOurEther, "\0\0\0\0\0\0", 6) == 0) {
|
if (memcmp (NetOurEther, "\0\0\0\0\0\0", 6) == 0) {
|
||||||
#ifdef CONFIG_NET_MULTI
|
#ifdef CONFIG_NET_MULTI
|
||||||
extern int eth_get_dev_index (void);
|
extern int eth_get_dev_index (void);
|
||||||
|
|
Loading…
Add table
Reference in a new issue