|
@@ -169,14 +169,12 @@ uchar NetCDPAddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
|
|
#endif
|
|
#endif
|
|
/* Network loop state */
|
|
/* Network loop state */
|
|
int NetState;
|
|
int NetState;
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
/* Tried all network devices */
|
|
/* Tried all network devices */
|
|
int NetRestartWrap;
|
|
int NetRestartWrap;
|
|
/* Network loop restarted */
|
|
/* Network loop restarted */
|
|
static int NetRestarted;
|
|
static int NetRestarted;
|
|
/* At least one device configured */
|
|
/* At least one device configured */
|
|
static int NetDevExists;
|
|
static int NetDevExists;
|
|
-#endif
|
|
|
|
|
|
|
|
/* XXX in both little & big endian machines 0xFFFF == ntohs(-1) */
|
|
/* XXX in both little & big endian machines 0xFFFF == ntohs(-1) */
|
|
/* default is without VLAN */
|
|
/* default is without VLAN */
|
|
@@ -347,10 +345,8 @@ NetLoop(proto_t protocol)
|
|
{
|
|
{
|
|
bd_t *bd = gd->bd;
|
|
bd_t *bd = gd->bd;
|
|
|
|
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
NetRestarted = 0;
|
|
NetRestarted = 0;
|
|
NetDevExists = 0;
|
|
NetDevExists = 0;
|
|
-#endif
|
|
|
|
|
|
|
|
/* XXX problem with bss workaround */
|
|
/* XXX problem with bss workaround */
|
|
NetArpWaitPacketMAC = NULL;
|
|
NetArpWaitPacketMAC = NULL;
|
|
@@ -379,20 +375,14 @@ NetLoop(proto_t protocol)
|
|
}
|
|
}
|
|
|
|
|
|
eth_halt();
|
|
eth_halt();
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
eth_set_current();
|
|
eth_set_current();
|
|
-#endif
|
|
|
|
if (eth_init(bd) < 0) {
|
|
if (eth_init(bd) < 0) {
|
|
eth_halt();
|
|
eth_halt();
|
|
return -1;
|
|
return -1;
|
|
}
|
|
}
|
|
|
|
|
|
restart:
|
|
restart:
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
|
|
memcpy(NetOurEther, eth_get_dev()->enetaddr, 6);
|
|
-#else
|
|
|
|
- eth_getenv_enetaddr("ethaddr", NetOurEther);
|
|
|
|
-#endif
|
|
|
|
|
|
|
|
NetState = NETLOOP_CONTINUE;
|
|
NetState = NETLOOP_CONTINUE;
|
|
|
|
|
|
@@ -409,16 +399,12 @@ restart:
|
|
eth_halt();
|
|
eth_halt();
|
|
return -1;
|
|
return -1;
|
|
|
|
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
case 2:
|
|
case 2:
|
|
/* network device not configured */
|
|
/* network device not configured */
|
|
break;
|
|
break;
|
|
-#endif /* CONFIG_NET_MULTI */
|
|
|
|
|
|
|
|
case 0:
|
|
case 0:
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
NetDevExists = 1;
|
|
NetDevExists = 1;
|
|
-#endif
|
|
|
|
switch (protocol) {
|
|
switch (protocol) {
|
|
case TFTP:
|
|
case TFTP:
|
|
/* always use ARP to get server ethernet address */
|
|
/* always use ARP to get server ethernet address */
|
|
@@ -562,9 +548,7 @@ restart:
|
|
switch (NetState) {
|
|
switch (NetState) {
|
|
|
|
|
|
case NETLOOP_RESTART:
|
|
case NETLOOP_RESTART:
|
|
-#ifdef CONFIG_NET_MULTI
|
|
|
|
NetRestarted = 1;
|
|
NetRestarted = 1;
|
|
-#endif
|
|
|
|
goto restart;
|
|
goto restart;
|
|
|
|
|
|
case NETLOOP_SUCCESS:
|
|
case NETLOOP_SUCCESS:
|
|
@@ -630,10 +614,6 @@ void NetStartAgain(void)
|
|
|
|
|
|
NetTryCount++;
|
|
NetTryCount++;
|
|
|
|
|
|
-#ifndef CONFIG_NET_MULTI
|
|
|
|
- NetSetTimeout(10000UL, startAgainTimeout);
|
|
|
|
- NetSetHandler(startAgainHandler);
|
|
|
|
-#else /* !CONFIG_NET_MULTI*/
|
|
|
|
eth_halt();
|
|
eth_halt();
|
|
#if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER)
|
|
#if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER)
|
|
eth_try_another(!NetRestarted);
|
|
eth_try_another(!NetRestarted);
|
|
@@ -650,7 +630,6 @@ void NetStartAgain(void)
|
|
} else {
|
|
} else {
|
|
NetState = NETLOOP_RESTART;
|
|
NetState = NETLOOP_RESTART;
|
|
}
|
|
}
|
|
-#endif /* CONFIG_NET_MULTI */
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/**********************************************************************/
|
|
/**********************************************************************/
|
|
@@ -816,9 +795,7 @@ PingHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
|
|
|
|
|
|
static void PingStart(void)
|
|
static void PingStart(void)
|
|
{
|
|
{
|
|
-#if defined(CONFIG_NET_MULTI)
|
|
|
|
printf("Using %s device\n", eth_get_name());
|
|
printf("Using %s device\n", eth_get_name());
|
|
-#endif /* CONFIG_NET_MULTI */
|
|
|
|
NetSetTimeout(10000UL, PingTimeout);
|
|
NetSetTimeout(10000UL, PingTimeout);
|
|
NetSetHandler(PingHandler);
|
|
NetSetHandler(PingHandler);
|
|
|
|
|
|
@@ -1168,9 +1145,7 @@ CDPHandler(const uchar *pkt, unsigned len)
|
|
|
|
|
|
static void CDPStart(void)
|
|
static void CDPStart(void)
|
|
{
|
|
{
|
|
-#if defined(CONFIG_NET_MULTI)
|
|
|
|
printf("Using %s device\n", eth_get_name());
|
|
printf("Using %s device\n", eth_get_name());
|
|
-#endif
|
|
|
|
CDPSeq = 0;
|
|
CDPSeq = 0;
|
|
CDPOK = 0;
|
|
CDPOK = 0;
|
|
|
|
|
|
@@ -1810,7 +1785,6 @@ common:
|
|
case CDP:
|
|
case CDP:
|
|
case DHCP:
|
|
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
|
|
|
|
extern int eth_get_dev_index(void);
|
|
extern int eth_get_dev_index(void);
|
|
int num = eth_get_dev_index();
|
|
int num = eth_get_dev_index();
|
|
|
|
|
|
@@ -1829,10 +1803,6 @@ common:
|
|
|
|
|
|
NetStartAgain();
|
|
NetStartAgain();
|
|
return 2;
|
|
return 2;
|
|
-#else
|
|
|
|
- puts("*** ERROR: `ethaddr' not set\n");
|
|
|
|
- return 1;
|
|
|
|
-#endif
|
|
|
|
}
|
|
}
|
|
/* Fall through */
|
|
/* Fall through */
|
|
default:
|
|
default:
|