env: Couple networking-related variable flags to CONFIG_NET
Boards may set networking variables programmatically, thus may have CONFIG_NET on but CONFIG_CMD_NET off. The IOT2050 is an example. CC: Joe Hershberger <joe.hershberger@ni.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
parent
5ab8105836
commit
906bad3cc4
2 changed files with 7 additions and 7 deletions
10
env/flags.c
vendored
10
env/flags.c
vendored
|
@ -22,7 +22,7 @@
|
||||||
#include <env_internal.h>
|
#include <env_internal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
#define ENV_FLAGS_NET_VARTYPE_REPS "im"
|
#define ENV_FLAGS_NET_VARTYPE_REPS "im"
|
||||||
#else
|
#else
|
||||||
#define ENV_FLAGS_NET_VARTYPE_REPS ""
|
#define ENV_FLAGS_NET_VARTYPE_REPS ""
|
||||||
|
@ -57,7 +57,7 @@ static const char * const env_flags_vartype_names[] = {
|
||||||
"decimal",
|
"decimal",
|
||||||
"hexadecimal",
|
"hexadecimal",
|
||||||
"boolean",
|
"boolean",
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
"IP address",
|
"IP address",
|
||||||
"MAC address",
|
"MAC address",
|
||||||
#endif
|
#endif
|
||||||
|
@ -211,7 +211,7 @@ static void skip_num(int hex, const char *value, const char **end,
|
||||||
*end = value;
|
*end = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
int eth_validate_ethaddr_str(const char *addr)
|
int eth_validate_ethaddr_str(const char *addr)
|
||||||
{
|
{
|
||||||
const char *end;
|
const char *end;
|
||||||
|
@ -244,7 +244,7 @@ static int _env_flags_validate_type(const char *value,
|
||||||
enum env_flags_vartype type)
|
enum env_flags_vartype type)
|
||||||
{
|
{
|
||||||
const char *end;
|
const char *end;
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
const char *cur;
|
const char *cur;
|
||||||
int i;
|
int i;
|
||||||
#endif
|
#endif
|
||||||
|
@ -273,7 +273,7 @@ static int _env_flags_validate_type(const char *value,
|
||||||
if (value[1] != '\0')
|
if (value[1] != '\0')
|
||||||
return -1;
|
return -1;
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
case env_flags_vartype_ipaddr:
|
case env_flags_vartype_ipaddr:
|
||||||
cur = value;
|
cur = value;
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
|
|
@ -12,7 +12,7 @@ enum env_flags_vartype {
|
||||||
env_flags_vartype_decimal,
|
env_flags_vartype_decimal,
|
||||||
env_flags_vartype_hex,
|
env_flags_vartype_hex,
|
||||||
env_flags_vartype_bool,
|
env_flags_vartype_bool,
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
env_flags_vartype_ipaddr,
|
env_flags_vartype_ipaddr,
|
||||||
env_flags_vartype_macaddr,
|
env_flags_vartype_macaddr,
|
||||||
#endif
|
#endif
|
||||||
|
@ -121,7 +121,7 @@ enum env_flags_varaccess env_flags_parse_varaccess(const char *flags);
|
||||||
*/
|
*/
|
||||||
enum env_flags_varaccess env_flags_parse_varaccess_from_binflags(int binflags);
|
enum env_flags_varaccess env_flags_parse_varaccess_from_binflags(int binflags);
|
||||||
|
|
||||||
#ifdef CONFIG_CMD_NET
|
#ifdef CONFIG_NET
|
||||||
/*
|
/*
|
||||||
* Check if a string has the format of an Ethernet MAC address
|
* Check if a string has the format of an Ethernet MAC address
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue