net/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).
This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
This commit is contained in:
parent
45cdb9b72c
commit
6e2115acb6
26
net/bootp.c
26
net/bootp.c
@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#define BOOTP_VENDOR_MAGIC 0x63825363 /* RFC1048 Magic Cookie */
|
#define BOOTP_VENDOR_MAGIC 0x63825363 /* RFC1048 Magic Cookie */
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)
|
||||||
|
|
||||||
#define TIMEOUT 5 /* Seconds before trying BOOTP again */
|
#define TIMEOUT 5 /* Seconds before trying BOOTP again */
|
||||||
#ifndef CONFIG_NET_RETRY_COUNT
|
#ifndef CONFIG_NET_RETRY_COUNT
|
||||||
@ -53,7 +53,7 @@ int BootpTry;
|
|||||||
ulong seed1, seed2;
|
ulong seed1, seed2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
dhcp_state_t dhcp_state = INIT;
|
dhcp_state_t dhcp_state = INIT;
|
||||||
unsigned long dhcp_leasetime = 0;
|
unsigned long dhcp_leasetime = 0;
|
||||||
IPaddr_t NetDHCPServerIP = 0;
|
IPaddr_t NetDHCPServerIP = 0;
|
||||||
@ -148,7 +148,7 @@ static int truncate_sz (const char *name, int maxlen, int curlen)
|
|||||||
return (curlen);
|
return (curlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !(CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if !((CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP))
|
||||||
|
|
||||||
static void BootpVendorFieldProcess (u8 * ext)
|
static void BootpVendorFieldProcess (u8 * ext)
|
||||||
{
|
{
|
||||||
@ -344,7 +344,7 @@ BootpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
|
|||||||
*/
|
*/
|
||||||
NetState = NETLOOP_SUCCESS;
|
NetState = NETLOOP_SUCCESS;
|
||||||
return;
|
return;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
} else if (strcmp(s, "NFS") == 0) {
|
} else if (strcmp(s, "NFS") == 0) {
|
||||||
/*
|
/*
|
||||||
* Use NFS to load the bootfile.
|
* Use NFS to load the bootfile.
|
||||||
@ -377,7 +377,7 @@ BootpTimeout(void)
|
|||||||
/*
|
/*
|
||||||
* Initialize BOOTP extension fields in the request.
|
* Initialize BOOTP extension fields in the request.
|
||||||
*/
|
*/
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t RequestedIP)
|
static int DhcpExtended (u8 * e, int message_type, IPaddr_t ServerID, IPaddr_t RequestedIP)
|
||||||
{
|
{
|
||||||
u8 *start = e;
|
u8 *start = e;
|
||||||
@ -504,7 +504,7 @@ static int BootpExtended (u8 * e)
|
|||||||
*e++ = 83;
|
*e++ = 83;
|
||||||
*e++ = 99;
|
*e++ = 99;
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
*e++ = 53; /* DHCP Message Type */
|
*e++ = 53; /* DHCP Message Type */
|
||||||
*e++ = 1;
|
*e++ = 1;
|
||||||
*e++ = DHCP_DISCOVER;
|
*e++ = DHCP_DISCOVER;
|
||||||
@ -570,7 +570,7 @@ BootpRequest (void)
|
|||||||
Bootp_t *bp;
|
Bootp_t *bp;
|
||||||
int ext_len, pktlen, iplen;
|
int ext_len, pktlen, iplen;
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
dhcp_state = INIT;
|
dhcp_state = INIT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -678,7 +678,7 @@ BootpRequest (void)
|
|||||||
copy_filename (bp->bp_file, BootFile, sizeof(bp->bp_file));
|
copy_filename (bp->bp_file, BootFile, sizeof(bp->bp_file));
|
||||||
|
|
||||||
/* Request additional information from the BOOTP/DHCP server */
|
/* Request additional information from the BOOTP/DHCP server */
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
ext_len = DhcpExtended((u8 *)bp->bp_vend, DHCP_DISCOVER, 0, 0);
|
ext_len = DhcpExtended((u8 *)bp->bp_vend, DHCP_DISCOVER, 0, 0);
|
||||||
#else
|
#else
|
||||||
ext_len = BootpExtended((u8 *)bp->bp_vend);
|
ext_len = BootpExtended((u8 *)bp->bp_vend);
|
||||||
@ -705,7 +705,7 @@ BootpRequest (void)
|
|||||||
NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
|
NetSetIP(iphdr, 0xFFFFFFFFL, PORT_BOOTPS, PORT_BOOTPC, iplen);
|
||||||
NetSetTimeout(SELECT_TIMEOUT * CFG_HZ, BootpTimeout);
|
NetSetTimeout(SELECT_TIMEOUT * CFG_HZ, BootpTimeout);
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
dhcp_state = SELECTING;
|
dhcp_state = SELECTING;
|
||||||
NetSetHandler(DhcpHandler);
|
NetSetHandler(DhcpHandler);
|
||||||
#else
|
#else
|
||||||
@ -714,7 +714,7 @@ BootpRequest (void)
|
|||||||
NetSendPacket(NetTxPacket, pktlen);
|
NetSendPacket(NetTxPacket, pktlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
|
static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
|
||||||
{
|
{
|
||||||
uchar *end = popt + BOOTP_HDR_SIZE;
|
uchar *end = popt + BOOTP_HDR_SIZE;
|
||||||
@ -726,7 +726,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
|
|||||||
case 1:
|
case 1:
|
||||||
NetCopyIP (&NetOurSubnetMask, (popt + 2));
|
NetCopyIP (&NetOurSubnetMask, (popt + 2));
|
||||||
break;
|
break;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
|
#if ((CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_TIMEOFFSET)
|
||||||
case 2: /* Time offset */
|
case 2: /* Time offset */
|
||||||
NetCopyLong (&NetTimeOffset, (ulong *) (popt + 2));
|
NetCopyLong (&NetTimeOffset, (ulong *) (popt + 2));
|
||||||
NetTimeOffset = ntohl (NetTimeOffset);
|
NetTimeOffset = ntohl (NetTimeOffset);
|
||||||
@ -755,7 +755,7 @@ static void DhcpOptionsProcess (uchar * popt, Bootp_t *bp)
|
|||||||
memcpy (&NetOurRootPath, popt + 2, size);
|
memcpy (&NetOurRootPath, popt + 2, size);
|
||||||
NetOurRootPath[size] = 0;
|
NetOurRootPath[size] = 0;
|
||||||
break;
|
break;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
|
#if ((CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)) && (CONFIG_BOOTP_MASK & CONFIG_BOOTP_NTPSERVER)
|
||||||
case 42: /* NTP server IP */
|
case 42: /* NTP server IP */
|
||||||
NetCopyIP (&NetNtpServerIP, (popt + 2));
|
NetCopyIP (&NetNtpServerIP, (popt + 2));
|
||||||
break;
|
break;
|
||||||
@ -950,7 +950,7 @@ DhcpHandler(uchar * pkt, unsigned dest, unsigned src, unsigned len)
|
|||||||
*/
|
*/
|
||||||
NetState = NETLOOP_SUCCESS;
|
NetState = NETLOOP_SUCCESS;
|
||||||
return;
|
return;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
} else if (strcmp(s, "NFS") == 0) {
|
} else if (strcmp(s, "NFS") == 0) {
|
||||||
/*
|
/*
|
||||||
* Use NFS to load the bootfile.
|
* Use NFS to load the bootfile.
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
/*
|
/*
|
||||||
* BOOTP header.
|
* BOOTP header.
|
||||||
*/
|
*/
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
#define OPT_SIZE 312 /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */
|
#define OPT_SIZE 312 /* Minimum DHCP Options size per RFC2131 - results in 576 byte pkt */
|
||||||
#else
|
#else
|
||||||
#define OPT_SIZE 64
|
#define OPT_SIZE 64
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
#include <net.h>
|
#include <net.h>
|
||||||
#include <miiphy.h>
|
#include <miiphy.h>
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NET) && defined(CONFIG_NET_MULTI)
|
#if ((CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)) && defined(CONFIG_NET_MULTI)
|
||||||
|
|
||||||
#ifdef CFG_GT_6426x
|
#ifdef CFG_GT_6426x
|
||||||
extern int gt6426x_eth_initialize(bd_t *bis);
|
extern int gt6426x_eth_initialize(bd_t *bis);
|
||||||
@ -142,7 +142,7 @@ int eth_initialize(bd_t *bis)
|
|||||||
eth_devices = NULL;
|
eth_devices = NULL;
|
||||||
eth_current = NULL;
|
eth_current = NULL;
|
||||||
|
|
||||||
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
|
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII)
|
||||||
miiphy_init();
|
miiphy_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ char *eth_get_name (void)
|
|||||||
{
|
{
|
||||||
return (eth_current ? eth_current->name : "unknown");
|
return (eth_current ? eth_current->name : "unknown");
|
||||||
}
|
}
|
||||||
#elif (CONFIG_COMMANDS & CFG_CMD_NET) && !defined(CONFIG_NET_MULTI)
|
#elif ((CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)) && !defined(CONFIG_NET_MULTI)
|
||||||
|
|
||||||
extern int at91rm9200_miiphy_initialize(bd_t *bis);
|
extern int at91rm9200_miiphy_initialize(bd_t *bis);
|
||||||
extern int emac4xx_miiphy_initialize(bd_t *bis);
|
extern int emac4xx_miiphy_initialize(bd_t *bis);
|
||||||
@ -460,7 +460,7 @@ extern int ns7520_miiphy_initialize(bd_t *bis);
|
|||||||
|
|
||||||
int eth_initialize(bd_t *bis)
|
int eth_initialize(bd_t *bis)
|
||||||
{
|
{
|
||||||
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
|
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII)
|
||||||
miiphy_init();
|
miiphy_init();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
60
net/net.c
60
net/net.c
@ -86,11 +86,11 @@
|
|||||||
#include <status_led.h>
|
#include <status_led.h>
|
||||||
#include <miiphy.h>
|
#include <miiphy.h>
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
|
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)
|
||||||
#include "sntp.h"
|
#include "sntp.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ uchar NetBcastAddr[6] = /* Ethernet bcast address */
|
|||||||
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
|
||||||
uchar NetEtherNullAddr[6] =
|
uchar NetEtherNullAddr[6] =
|
||||||
{ 0, 0, 0, 0, 0, 0 };
|
{ 0, 0, 0, 0, 0, 0 };
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
uchar NetCDPAddr[6] = /* Ethernet bcast address */
|
uchar NetCDPAddr[6] = /* Ethernet bcast address */
|
||||||
{ 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
|
{ 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
|
||||||
#endif
|
#endif
|
||||||
@ -150,17 +150,17 @@ ushort NetOurNativeVLAN = 0xFFFF; /* ditto */
|
|||||||
|
|
||||||
char BootFile[128]; /* Boot File name */
|
char BootFile[128]; /* Boot File name */
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
IPaddr_t NetPingIP; /* the ip address to ping */
|
IPaddr_t NetPingIP; /* the ip address to ping */
|
||||||
|
|
||||||
static void PingStart(void);
|
static void PingStart(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
static void CDPStart(void);
|
static void CDPStart(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
|
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)
|
||||||
IPaddr_t NetNtpServerIP; /* NTP server IP address */
|
IPaddr_t NetNtpServerIP; /* NTP server IP address */
|
||||||
int NetTimeOffset=0; /* offset time from UTC */
|
int NetTimeOffset=0; /* offset time from UTC */
|
||||||
#endif
|
#endif
|
||||||
@ -326,13 +326,13 @@ restart:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
case NFS:
|
case NFS:
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
case PING:
|
case PING:
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
|
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)
|
||||||
case SNTP:
|
case SNTP:
|
||||||
#endif
|
#endif
|
||||||
case NETCONS:
|
case NETCONS:
|
||||||
@ -344,19 +344,19 @@ restart:
|
|||||||
NetOurNativeVLAN = getenv_VLAN("nvlan");
|
NetOurNativeVLAN = getenv_VLAN("nvlan");
|
||||||
|
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
case NFS:
|
case NFS:
|
||||||
#endif
|
#endif
|
||||||
case NETCONS:
|
case NETCONS:
|
||||||
case TFTP:
|
case TFTP:
|
||||||
NetServerIP = getenv_IPaddr ("serverip");
|
NetServerIP = getenv_IPaddr ("serverip");
|
||||||
break;
|
break;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
case PING:
|
case PING:
|
||||||
/* nothing */
|
/* nothing */
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
|
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)
|
||||||
case SNTP:
|
case SNTP:
|
||||||
/* nothing */
|
/* nothing */
|
||||||
break;
|
break;
|
||||||
@ -406,7 +406,7 @@ restart:
|
|||||||
TftpStart();
|
TftpStart();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DHCP)
|
#if (CONFIG_COMMANDS & CFG_CMD_DHCP) || defined(CONFIG_CMD_DHCP)
|
||||||
case DHCP:
|
case DHCP:
|
||||||
/* Start with a clean slate... */
|
/* Start with a clean slate... */
|
||||||
BootpTry = 0;
|
BootpTry = 0;
|
||||||
@ -425,17 +425,17 @@ restart:
|
|||||||
RarpTry = 0;
|
RarpTry = 0;
|
||||||
RarpRequest ();
|
RarpRequest ();
|
||||||
break;
|
break;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
case PING:
|
case PING:
|
||||||
PingStart();
|
PingStart();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
case NFS:
|
case NFS:
|
||||||
NfsStart();
|
NfsStart();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
case CDP:
|
case CDP:
|
||||||
CDPStart();
|
CDPStart();
|
||||||
break;
|
break;
|
||||||
@ -445,7 +445,7 @@ restart:
|
|||||||
NcStart();
|
NcStart();
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
|
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)
|
||||||
case SNTP:
|
case SNTP:
|
||||||
SntpStart();
|
SntpStart();
|
||||||
break;
|
break;
|
||||||
@ -458,7 +458,7 @@ restart:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
|
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII)
|
||||||
#if defined(CFG_FAULT_ECHO_LINK_DOWN) && defined(CONFIG_STATUS_LED) && defined(STATUS_LED_RED)
|
#if defined(CFG_FAULT_ECHO_LINK_DOWN) && defined(CONFIG_STATUS_LED) && defined(STATUS_LED_RED)
|
||||||
/*
|
/*
|
||||||
* Echo the inverted link state to the fault LED.
|
* Echo the inverted link state to the fault LED.
|
||||||
@ -507,7 +507,7 @@ restart:
|
|||||||
if (timeHandler && ((get_timer(0) - timeStart) > timeDelta)) {
|
if (timeHandler && ((get_timer(0) - timeStart) > timeDelta)) {
|
||||||
thand_f *x;
|
thand_f *x;
|
||||||
|
|
||||||
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
|
#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) || defined(CONFIG_CMD_MII)
|
||||||
# if defined(CFG_FAULT_ECHO_LINK_DOWN) && \
|
# if defined(CFG_FAULT_ECHO_LINK_DOWN) && \
|
||||||
defined(CONFIG_STATUS_LED) && \
|
defined(CONFIG_STATUS_LED) && \
|
||||||
defined(STATUS_LED_RED)
|
defined(STATUS_LED_RED)
|
||||||
@ -687,7 +687,7 @@ NetSendUDPPacket(uchar *ether, IPaddr_t dest, int dport, int sport, int len)
|
|||||||
return 0; /* transmitted */
|
return 0; /* transmitted */
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
static ushort PingSeqNo;
|
static ushort PingSeqNo;
|
||||||
|
|
||||||
int PingSend(void)
|
int PingSend(void)
|
||||||
@ -777,7 +777,7 @@ static void PingStart(void)
|
|||||||
}
|
}
|
||||||
#endif /* CFG_CMD_PING */
|
#endif /* CFG_CMD_PING */
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
|
|
||||||
#define CDP_DEVICE_ID_TLV 0x0001
|
#define CDP_DEVICE_ID_TLV 0x0001
|
||||||
#define CDP_ADDRESS_TLV 0x0002
|
#define CDP_ADDRESS_TLV 0x0002
|
||||||
@ -1140,7 +1140,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
|||||||
IPaddr_t tmp;
|
IPaddr_t tmp;
|
||||||
int x;
|
int x;
|
||||||
uchar *pkt;
|
uchar *pkt;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
int iscdp;
|
int iscdp;
|
||||||
#endif
|
#endif
|
||||||
ushort cti = 0, vlanid = VLAN_NONE, myvlanid, mynvlanid;
|
ushort cti = 0, vlanid = VLAN_NONE, myvlanid, mynvlanid;
|
||||||
@ -1157,7 +1157,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
|||||||
if (len < ETHER_HDR_SIZE)
|
if (len < ETHER_HDR_SIZE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
/* keep track if packet is CDP */
|
/* keep track if packet is CDP */
|
||||||
iscdp = memcmp(et->et_dest, NetCDPAddr, 6) == 0;
|
iscdp = memcmp(et->et_dest, NetCDPAddr, 6) == 0;
|
||||||
#endif
|
#endif
|
||||||
@ -1200,7 +1200,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
|||||||
|
|
||||||
/* if no VLAN active */
|
/* if no VLAN active */
|
||||||
if ((ntohs(NetOurVLAN) & VLAN_IDMASK) == VLAN_NONE
|
if ((ntohs(NetOurVLAN) & VLAN_IDMASK) == VLAN_NONE
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
&& iscdp == 0
|
&& iscdp == 0
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -1218,7 +1218,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
|||||||
printf("Receive from protocol 0x%x\n", x);
|
printf("Receive from protocol 0x%x\n", x);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_CDP)
|
#if (CONFIG_COMMANDS & CFG_CMD_CDP) || defined(CONFIG_CMD_CDP)
|
||||||
if (iscdp) {
|
if (iscdp) {
|
||||||
CDPHandler((uchar *)ip, len);
|
CDPHandler((uchar *)ip, len);
|
||||||
return;
|
return;
|
||||||
@ -1416,7 +1416,7 @@ NetReceive(volatile uchar * inpkt, int len)
|
|||||||
print_IPaddr(icmph->un.gateway);
|
print_IPaddr(icmph->un.gateway);
|
||||||
putc(' ');
|
putc(' ');
|
||||||
return;
|
return;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
case ICMP_ECHO_REPLY:
|
case ICMP_ECHO_REPLY:
|
||||||
/*
|
/*
|
||||||
* IP header OK. Pass the packet to the current handler.
|
* IP header OK. Pass the packet to the current handler.
|
||||||
@ -1516,7 +1516,7 @@ static int net_check_prereq (proto_t protocol)
|
|||||||
{
|
{
|
||||||
switch (protocol) {
|
switch (protocol) {
|
||||||
/* Fall through */
|
/* Fall through */
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_PING)
|
#if (CONFIG_COMMANDS & CFG_CMD_PING) || defined(CONFIG_CMD_PING)
|
||||||
case PING:
|
case PING:
|
||||||
if (NetPingIP == 0) {
|
if (NetPingIP == 0) {
|
||||||
puts ("*** ERROR: ping address not given\n");
|
puts ("*** ERROR: ping address not given\n");
|
||||||
@ -1524,7 +1524,7 @@ static int net_check_prereq (proto_t protocol)
|
|||||||
}
|
}
|
||||||
goto common;
|
goto common;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_SNTP)
|
#if (CONFIG_COMMANDS & CFG_CMD_SNTP) || defined(CONFIG_CMD_SNTP)
|
||||||
case SNTP:
|
case SNTP:
|
||||||
if (NetNtpServerIP == 0) {
|
if (NetNtpServerIP == 0) {
|
||||||
puts ("*** ERROR: NTP server address not given\n");
|
puts ("*** ERROR: NTP server address not given\n");
|
||||||
@ -1532,7 +1532,7 @@ static int net_check_prereq (proto_t protocol)
|
|||||||
}
|
}
|
||||||
goto common;
|
goto common;
|
||||||
#endif
|
#endif
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
case NFS:
|
case NFS:
|
||||||
#endif
|
#endif
|
||||||
case NETCONS:
|
case NETCONS:
|
||||||
@ -1541,7 +1541,7 @@ static int net_check_prereq (proto_t protocol)
|
|||||||
puts ("*** ERROR: `serverip' not set\n");
|
puts ("*** ERROR: `serverip' not set\n");
|
||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
#if (CONFIG_COMMANDS & (CFG_CMD_PING | CFG_CMD_SNTP))
|
#if (CONFIG_COMMANDS & (CFG_CMD_PING | CFG_CMD_SNTP)) || defined(CONFIG_CMD_PING) || defined(CONFIG_CMD_SNTP)
|
||||||
common:
|
common:
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -31,7 +31,8 @@
|
|||||||
|
|
||||||
/*#define NFS_DEBUG*/
|
/*#define NFS_DEBUG*/
|
||||||
|
|
||||||
#if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_NFS))
|
#if (((CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)) \
|
||||||
|
&& ((CONFIG_COMMANDS & CFG_CMD_NFS)) || defined(CONFIG_CMD_NFS))
|
||||||
|
|
||||||
#define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
|
#define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
|
||||||
#define NFS_TIMEOUT 60
|
#define NFS_TIMEOUT 60
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "rarp.h"
|
#include "rarp.h"
|
||||||
#include "tftp.h"
|
#include "tftp.h"
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)
|
||||||
|
|
||||||
#define TIMEOUT 5 /* Seconds before trying BOOTP again */
|
#define TIMEOUT 5 /* Seconds before trying BOOTP again */
|
||||||
#ifndef CONFIG_NET_RETRY_COUNT
|
#ifndef CONFIG_NET_RETRY_COUNT
|
||||||
@ -59,7 +59,7 @@ RarpHandler(uchar * dummi0, unsigned dummi1, unsigned dummi2, unsigned dummi3)
|
|||||||
*/
|
*/
|
||||||
NetState = NETLOOP_SUCCESS;
|
NetState = NETLOOP_SUCCESS;
|
||||||
return;
|
return;
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NFS)
|
#if (CONFIG_COMMANDS & CFG_CMD_NFS) || defined(CONFIG_CMD_NFS)
|
||||||
} else if ((s != NULL) && !strcmp(s, "NFS")) {
|
} else if ((s != NULL) && !strcmp(s, "NFS")) {
|
||||||
NfsStart();
|
NfsStart();
|
||||||
return;
|
return;
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
|
|
||||||
#include "sntp.h"
|
#include "sntp.h"
|
||||||
|
|
||||||
#if ((CONFIG_COMMANDS & CFG_CMD_NET) && (CONFIG_COMMANDS & CFG_CMD_SNTP))
|
#if (((CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)) \
|
||||||
|
&& ((CONFIG_COMMANDS & CFG_CMD_SNTP)) || defined(CONFIG_CMD_SNTP))
|
||||||
|
|
||||||
#define SNTP_TIMEOUT 10
|
#define SNTP_TIMEOUT 10
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ SntpHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
|
|||||||
memcpy (&seconds, &rpktp->transmit_timestamp, sizeof(ulong));
|
memcpy (&seconds, &rpktp->transmit_timestamp, sizeof(ulong));
|
||||||
|
|
||||||
to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm);
|
to_tm(ntohl(seconds) - 2208988800UL + NetTimeOffset, &tm);
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_DATE)
|
#if (CONFIG_COMMANDS & CFG_CMD_DATE) || defined(CONFIG_CMD_DATE)
|
||||||
rtc_set (&tm);
|
rtc_set (&tm);
|
||||||
#endif
|
#endif
|
||||||
printf ("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n",
|
printf ("Date: %4d-%02d-%02d Time: %2d:%02d:%02d\n",
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
#undef ET_DEBUG
|
#undef ET_DEBUG
|
||||||
|
|
||||||
#if (CONFIG_COMMANDS & CFG_CMD_NET)
|
#if (CONFIG_COMMANDS & CFG_CMD_NET) || defined(CONFIG_CMD_NET)
|
||||||
|
|
||||||
#define WELL_KNOWN_PORT 69 /* Well known TFTP port # */
|
#define WELL_KNOWN_PORT 69 /* Well known TFTP port # */
|
||||||
#define TIMEOUT 5 /* Seconds to timeout for a lost pkt */
|
#define TIMEOUT 5 /* Seconds to timeout for a lost pkt */
|
||||||
|
Loading…
Reference in New Issue
Block a user