net: ipv6: Add callbacks declarations to get access to IPv6 variables

Set up callbacks for main IPv6 variables ip6add, serverip6, gatewayip6
and set options to them in flag file. These variables are often set up by
users.

Signed-off-by: Viacheslav Mitrofanov <v.v.mitrofanov@yadro.com>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Viacheslav Mitrofanov 2022-12-02 12:18:00 +03:00 committed by Tom Rini
parent 3cc04a3ab2
commit 1dfa4ef14d
2 changed files with 20 additions and 0 deletions

View File

@ -51,6 +51,15 @@
#define NET_CALLBACKS #define NET_CALLBACKS
#endif #endif
#ifdef CONFIG_IPV6
#define NET6_CALLBACKS \
"ip6addr:ip6addr," \
"serverip6:serverip6," \
"gatewayip6:gatewayip6,"
#else
#define NET6_CALLBACKS
#endif
#ifdef CONFIG_BOOTSTD #ifdef CONFIG_BOOTSTD
#define BOOTSTD_CALLBACK "bootmeths:bootmeths," #define BOOTSTD_CALLBACK "bootmeths:bootmeths,"
#else #else
@ -65,6 +74,7 @@
ENV_DOT_ESCAPE ENV_FLAGS_VAR ":flags," \ ENV_DOT_ESCAPE ENV_FLAGS_VAR ":flags," \
"baudrate:baudrate," \ "baudrate:baudrate," \
NET_CALLBACKS \ NET_CALLBACKS \
NET6_CALLBACKS \
BOOTSTD_CALLBACK \ BOOTSTD_CALLBACK \
"loadaddr:loadaddr," \ "loadaddr:loadaddr," \
SILENT_CALLBACK \ SILENT_CALLBACK \

View File

@ -67,6 +67,15 @@ enum env_flags_varaccess {
#define NET_FLAGS #define NET_FLAGS
#endif #endif
#ifdef CONFIG_IPV6
#define NET6_FLAGS \
"ip6addr:s," \
"serverip6:s," \
"gatewayip6:s"
#else
#define NET6_FLAGS
#endif
#ifndef CONFIG_ENV_OVERWRITE #ifndef CONFIG_ENV_OVERWRITE
#define SERIAL_FLAGS "serial#:so," #define SERIAL_FLAGS "serial#:so,"
#else #else
@ -76,6 +85,7 @@ enum env_flags_varaccess {
#define ENV_FLAGS_LIST_STATIC \ #define ENV_FLAGS_LIST_STATIC \
ETHADDR_FLAGS \ ETHADDR_FLAGS \
NET_FLAGS \ NET_FLAGS \
NET6_FLAGS \
SERIAL_FLAGS \ SERIAL_FLAGS \
CONFIG_ENV_FLAGS_LIST_STATIC CONFIG_ENV_FLAGS_LIST_STATIC