netloop: updates for NetLoop
Fix some issues introduced from commit:
2f70c49e5b
suggested by Mike Frysinger.
- added some comment for the env_id variable in common_cmd_nvedit.c
- moved some variables in fn scope instead of file scope
- NetInitLoop now static void
Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Ben Warren <biggerbadderben@gmail.com>
This commit is contained in:
parent
3c1d89545d
commit
da95427ce4
|
@ -77,6 +77,13 @@ SPI_FLASH|MG_DISK|NVRAM|NOWHERE}
|
||||||
static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
|
static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
|
||||||
#define N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
|
#define N_BAUDRATES (sizeof(baudrate_table) / sizeof(baudrate_table[0]))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This variable is incremented on each do_setenv (), so it can
|
||||||
|
* be used via get_env_id() as an indication, if the environment
|
||||||
|
* has changed or not. So it is possible to reread an environment
|
||||||
|
* variable only if the environment was changed ... done so for
|
||||||
|
* example in NetInitLoop()
|
||||||
|
*/
|
||||||
static int env_id = 1;
|
static int env_id = 1;
|
||||||
|
|
||||||
int get_env_id (void)
|
int get_env_id (void)
|
||||||
|
|
|
@ -57,9 +57,6 @@ int eth_setenv_enetaddr(char *name, const uchar *enetaddr)
|
||||||
|
|
||||||
#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
|
#if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
|
||||||
|
|
||||||
static char *act = NULL;
|
|
||||||
static int env_changed_id = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CPU and board-specific Ethernet initializations. Aliased function
|
* CPU and board-specific Ethernet initializations. Aliased function
|
||||||
* signals caller to move on
|
* signals caller to move on
|
||||||
|
@ -471,6 +468,8 @@ void eth_try_another(int first_restart)
|
||||||
#ifdef CONFIG_NET_MULTI
|
#ifdef CONFIG_NET_MULTI
|
||||||
void eth_set_current(void)
|
void eth_set_current(void)
|
||||||
{
|
{
|
||||||
|
static char *act = NULL;
|
||||||
|
static int env_changed_id = 0;
|
||||||
struct eth_device* old_current;
|
struct eth_device* old_current;
|
||||||
int env_id;
|
int env_id;
|
||||||
|
|
||||||
|
|
|
@ -209,8 +209,6 @@ uchar NetArpWaitPacketBuf[PKTSIZE_ALIGN + PKTALIGN];
|
||||||
ulong NetArpWaitTimerStart;
|
ulong NetArpWaitTimerStart;
|
||||||
int NetArpWaitTry;
|
int NetArpWaitTry;
|
||||||
|
|
||||||
int env_changed_id = 0;
|
|
||||||
|
|
||||||
void ArpRequest (void)
|
void ArpRequest (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -278,9 +276,10 @@ void ArpTimeoutCheck(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static void
|
||||||
NetInitLoop(proto_t protocol)
|
NetInitLoop(proto_t protocol)
|
||||||
{
|
{
|
||||||
|
static int env_changed_id = 0;
|
||||||
bd_t *bd = gd->bd;
|
bd_t *bd = gd->bd;
|
||||||
int env_id = get_env_id ();
|
int env_id = get_env_id ();
|
||||||
|
|
||||||
|
@ -295,7 +294,7 @@ NetInitLoop(proto_t protocol)
|
||||||
env_changed_id = env_id;
|
env_changed_id = env_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************/
|
/**********************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue