Compare commits

..

2 Commits

Author SHA1 Message Date
Simon Glass
638e5af7da net: Move env_get_ip() out of the header file
This function requires access to env.h but it is a lot to include just
for the env_get() function. It eventually pulls in linux/byteorder which
causes a conflict with exfat which has its own byteorder functions.

Move the function to a C file instead.

Series-to: u-boot
Series-cc: trini
Series-cc: Jerome Forissier <jerome.forissier@linaro.org>

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-30 08:38:15 -06:00
Simon Glass
eb3a1b3ab6 net: Use a forward declaration for cmd_tbl in net-common.h
We don't need to include command.h just for this declaration. It
eventually pulls in linux/byteorder which causes a conflict with exfat
which has its own byteorder functions.

Use a forward declaration instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-30 08:37:27 -06:00
21 changed files with 23 additions and 46 deletions

View File

@@ -3,7 +3,6 @@
* Copyright (c) 2010-2016, NVIDIA CORPORATION. * Copyright (c) 2010-2016, NVIDIA CORPORATION.
*/ */
#include <env.h>
#include <fdtdec.h> #include <fdtdec.h>
#include <stdlib.h> #include <stdlib.h>
#include <asm/arch-tegra/cboot.h> #include <asm/arch-tegra/cboot.h>

View File

@@ -4,7 +4,6 @@
* Copyright (C) 2015 Phil Sutter <phil@nwl.cc> * Copyright (C) 2015 Phil Sutter <phil@nwl.cc>
*/ */
#include <env.h>
#include <init.h> #include <init.h>
#include <miiphy.h> #include <miiphy.h>
#include <asm/global_data.h> #include <asm/global_data.h>

View File

@@ -4,7 +4,6 @@
* Copyright 2019-2023 Kococonnector GmbH * Copyright 2019-2023 Kococonnector GmbH
*/ */
#include <env.h>
#include <errno.h> #include <errno.h>
#include <linux/libfdt.h> #include <linux/libfdt.h>
#include <asm/io.h> #include <asm/io.h>

View File

@@ -5,7 +5,6 @@
*/ */
#include <dm.h> #include <dm.h>
#include <env.h>
#include <init.h> #include <init.h>
#include <net.h> #include <net.h>
#include <asm/io.h> #include <asm/io.h>

View File

@@ -3,8 +3,7 @@
* Copyright 2018 congatec AG * Copyright 2018 congatec AG
* Copyright (C) 2019 Oliver Graute <oliver.graute@kococonnector.com> * Copyright (C) 2019 Oliver Graute <oliver.graute@kococonnector.com>
*/ */
#include <config.h>
#include <env.h>
#include <errno.h> #include <errno.h>
#include <linux/libfdt.h> #include <linux/libfdt.h>
#include <fsl_esdhc.h> #include <fsl_esdhc.h>

View File

@@ -5,7 +5,6 @@
*/ */
#include <dm.h> #include <dm.h>
#include <env.h>
#include <i2c_eeprom.h> #include <i2c_eeprom.h>
#include <net.h> #include <net.h>

View File

@@ -3,7 +3,6 @@
* Copyright 2020 NXP * Copyright 2020 NXP
*/ */
#include <env.h>
#include <miiphy.h> #include <miiphy.h>
#include <netdev.h> #include <netdev.h>
#include <asm/arch/imx8ulp-pins.h> #include <asm/arch/imx8ulp-pins.h>

View File

@@ -3,7 +3,6 @@
* Copyright (C) 2015 Freescale Semiconductor, Inc. * Copyright (C) 2015 Freescale Semiconductor, Inc.
*/ */
#include <env.h>
#include <init.h> #include <init.h>
#include <net.h> #include <net.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>

View File

@@ -3,7 +3,6 @@
* Copyright 2021 Gateworks Corporation * Copyright 2021 Gateworks Corporation
*/ */
#include <env.h>
#include <fdt_support.h> #include <fdt_support.h>
#include <init.h> #include <init.h>
#include <led.h> #include <led.h>

View File

@@ -2,8 +2,6 @@
/* /*
* Copyright 2022 Google LLC * Copyright 2022 Google LLC
*/ */
#include <env.h>
#include <net.h> #include <net.h>
#include <errno.h> #include <errno.h>
#include "mercury_aa1.h" #include "mercury_aa1.h"

View File

@@ -13,7 +13,6 @@
* *
*/ */
#include <env.h>
#include <fdt_support.h> #include <fdt_support.h>
#include <init.h> #include <init.h>
#include <log.h> #include <log.h>

View File

@@ -4,7 +4,6 @@
* Author: Daniel Schultz <d.schultz@phytec.de> * Author: Daniel Schultz <d.schultz@phytec.de>
*/ */
#include <env.h>
#include <malloc.h> #include <malloc.h>
#include <u-boot/crc.h> #include <u-boot/crc.h>
#include <net.h> #include <net.h>

View File

@@ -3,7 +3,6 @@
* Copyright 2018 NXP * Copyright 2018 NXP
*/ */
#include <env.h>
#include <miiphy.h> #include <miiphy.h>
#include <asm-generic/gpio.h> #include <asm-generic/gpio.h>
#include <asm/arch/imx8mq_pins.h> #include <asm/arch/imx8mq_pins.h>

View File

@@ -3,7 +3,6 @@
* Copyright (C) 2017 NXP Semiconductors * Copyright (C) 2017 NXP Semiconductors
*/ */
#include <env.h>
#include <init.h> #include <init.h>
#include <net.h> #include <net.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>

View File

@@ -4,7 +4,6 @@
*/ */
#include <cpu_func.h> #include <cpu_func.h>
#include <env.h>
#include <init.h> #include <init.h>
#include <net.h> #include <net.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>

View File

@@ -3,7 +3,7 @@
* Copyright 2020-2021 Toradex * Copyright 2020-2021 Toradex
*/ */
#include <env.h> #include <config.h>
#include <init.h> #include <init.h>
#include <asm/arch/clock.h> #include <asm/arch/clock.h>
#include <asm/arch/sys_proto.h> #include <asm/arch/sys_proto.h>

View File

@@ -242,34 +242,31 @@ int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
* The following parameters are only needed if 'bootdev' * The following parameters are only needed if 'bootdev'
* is an ethernet device, otherwise they are optional. * is an ethernet device, otherwise they are optional.
*/ */
if (IS_ENABLED(CONFIG_NET) || IS_ENABLED(CONFIG_NET_LWIP)) { tmp = env_get("ipaddr");
tmp = env_get("ipaddr"); if (tmp) {
ptr += sprintf(build_buf + ptr, "e=%s", tmp);
tmp = env_get("netmask");
if (tmp) { if (tmp) {
ptr += sprintf(build_buf + ptr, "e=%s", tmp); u32 mask = env_get_ip("netmask").s_addr;
tmp = env_get("netmask"); ptr += sprintf(build_buf + ptr,
if (tmp) { ":%08x ", ntohl(mask));
u32 mask = env_get_ip("netmask").s_addr; } else {
ptr += sprintf(build_buf + ptr, " ");
ptr += sprintf(build_buf + ptr,
":%08x ", ntohl(mask));
} else {
ptr += sprintf(build_buf + ptr, " ");
}
} }
tmp = env_get("serverip");
if (tmp)
ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
tmp = env_get("gatewayip");
if (tmp)
ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
tmp = env_get("hostname");
if (tmp)
ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
} }
tmp = env_get("serverip");
if (tmp)
ptr += sprintf(build_buf + ptr, "h=%s ", tmp);
tmp = env_get("gatewayip");
if (tmp)
ptr += sprintf(build_buf + ptr, "g=%s ", tmp);
tmp = env_get("hostname");
if (tmp)
ptr += sprintf(build_buf + ptr, "tn=%s ", tmp);
tmp = env_get("othbootargs"); tmp = env_get("othbootargs");
if (tmp) { if (tmp) {
strcpy(build_buf + ptr, tmp); strcpy(build_buf + ptr, tmp);

View File

@@ -3,7 +3,6 @@
#include <asm/io.h> #include <asm/io.h>
#include <cpu_func.h> #include <cpu_func.h>
#include <dm.h> #include <dm.h>
#include <env.h>
#include <malloc.h> #include <malloc.h>
#include <net.h> #include <net.h>
#include <netdev.h> #include <netdev.h>

View File

@@ -17,7 +17,6 @@
#include <log.h> #include <log.h>
#include <time.h> #include <time.h>
#include <linux/if_ether.h> #include <linux/if_ether.h>
#include <linux/string.h>
struct bd_info; struct bd_info;
struct cmd_tbl; struct cmd_tbl;

View File

@@ -11,7 +11,6 @@
#define __NET6_H__ #define __NET6_H__
#include <net.h> #include <net.h>
#include <asm/byteorder.h>
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/errno.h> #include <linux/errno.h>

View File

@@ -3,7 +3,6 @@
* Copyright 2019 Ramon Fried <rfried.dev@gmail.com> * Copyright 2019 Ramon Fried <rfried.dev@gmail.com>
*/ */
#include <env.h>
#include <net.h> #include <net.h>
#include <net/pcap.h> #include <net/pcap.h>
#include <time.h> #include <time.h>