[Concept,3/5] Kconfig: Rename API to LEGACY_API
Commit Message
From: Simon Glass <sjg@chromium.org>
Update Kconfig use use CONFIG_LEGACY_API since the API is now
deprecated.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
Makefile | 2 +-
common/board_r.c | 4 ++--
examples/Makefile | 2 +-
include/net-common.h | 2 +-
include/net-legacy.h | 2 +-
legacy_api/Kconfig | 22 +++++++++++++---------
legacy_api/README | 2 +-
net/lwip/net-lwip.c | 4 ++--
net/net.c | 4 ++--
9 files changed, 24 insertions(+), 20 deletions(-)
@@ -865,7 +865,7 @@ c_flags := $(KBUILD_CFLAGS) $(cpp_flags)
HAVE_VENDOR_COMMON_LIB = $(if $(wildcard $(srctree)/board/$(VENDOR)/common/Makefile),y,n)
-libs-$(CONFIG_API) += legacy_api/
+libs-$(CONFIG_LEGACY_API) += legacy_api/
libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
libs-y += boot/
libs-$(CONFIG_CMDLINE) += cmd/
@@ -686,8 +686,8 @@ static void initcall_run_r(void)
#endif
INITCALL(stdio_add_devices);
INITCALL(jumptable_init);
-#if CONFIG_IS_ENABLED(API)
- INITCALL(api_init);
+#if CONFIG_IS_ENABLED(LEGACY_API)
+ INITCALL(legacy_api_init);
#endif
INITCALL(console_init_r); /* fully init console as a device */
#if CONFIG_IS_ENABLED(DISPLAY_BOARDINFO_LATE)
@@ -7,5 +7,5 @@ subdir-ccflags-y += -finstrument-functions -DFTRACE
endif
subdir-y += standalone
-subdir-$(CONFIG_API) += api
+subdir-$(CONFIG_LEGACY_API) += api
endif
@@ -198,7 +198,7 @@ int usb_ether_init(void);
int eth_init(void); /* Initialize the device */
int eth_start_udev(struct udevice *dev); /* ->start() if not already running */
int eth_send(void *packet, int length); /* Send a packet */
-#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
+#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER)
int eth_receive(void *packet, int length); /* Receive a packet*/
extern void (*push_packet)(void *packet, int length);
#endif
@@ -105,7 +105,7 @@ int eth_env_get_enetaddr_by_index(const char *base_name, int index,
int eth_send(void *packet, int length); /* Send a packet */
-#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
+#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER)
int eth_receive(void *packet, int length); /* Receive a packet*/
extern void (*push_packet)(void *packet, int length);
#endif
@@ -1,23 +1,27 @@
-config API
- bool "Enable U-Boot API"
+config LEGACY_API
+ bool "Enable Legacy U-Boot API"
depends on CC_IS_GCC
help
- This option enables the U-Boot API. See api/README for more information.
+ This option enables the legcay U-Boot API. See legacy_api/README for
+ more information.
-menu "API"
- depends on API
+ Note that this is deprecated and not intended to be used. It will be
+ removed by the end of 2027.
+
+menu "LEGACY API"
+ depends on LEGACY_API
config SYS_MMC_MAX_DEVICE
- int "Maximum number of MMC devices exposed via the API"
+ int "Maximum number of MMC devices exposed via the legacy API"
default 1
config EXAMPLES
- bool "Compile API examples"
+ bool "Compile legacy API examples"
depends on !SANDBOX
default y if ARCH_QEMU_ARM
help
- U-Boot provides an API for standalone applications. Examples are
- provided in directory examples/.
+ U-Boot provides an legacy API for standalone applications. Examples
+ are provided in directory examples/.
config STANDALONE_LOAD_ADDR
depends on EXAMPLES
@@ -24,7 +24,7 @@ U-Boot machine/arch independent API for external apps
for example it doesn't keep states, but relies on hints from the app and
so on
- - optional (CONFIG_API)
+ - optional (CONFIG_LEGACY_API)
2. Calls
@@ -18,7 +18,7 @@
/* xx:xx:xx:xx:xx:xx\0 */
#define MAC_ADDR_STRLEN 18
-#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
+#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER)
void (*push_packet)(void *, int len) = 0;
#endif
static int net_try_count;
@@ -303,7 +303,7 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif)
void net_process_received_packet(uchar *in_packet, int len)
{
-#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
+#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER)
if (push_packet)
(*push_packet)(in_packet, len);
#endif
@@ -158,7 +158,7 @@ static unsigned net_ip_id;
/* Ethernet bcast address */
const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
const u8 net_null_ethaddr[6];
-#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
+#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER)
void (*push_packet)(void *, int len) = 0;
#endif
/* Network loop state */
@@ -1248,7 +1248,7 @@ void net_process_received_packet(uchar *in_packet, int len)
if (len < ETHER_HDR_SIZE)
return;
-#if defined(CONFIG_API) || defined(CONFIG_EFI_LOADER)
+#if defined(CONFIG_LEGACY_API) || defined(CONFIG_EFI_LOADER)
if (push_packet) {
(*push_packet)(in_packet, len);
return;