[U-Boot] [PATCH v4 26/29] env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()

Simon Glass sjg at chromium.org
Mon Jul 31 14:46:26 UTC 2017


Rename this function for consistency with env_get().

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v4:
- Add new patch to rename eth_getenv_enetaddr()

Changes in v3: None
Changes in v2: None

 arch/arm/mach-davinci/misc.c        |  2 +-
 arch/powerpc/cpu/mpc85xx/fdt.c      |  2 +-
 board/amlogic/odroid-c2/odroid-c2.c |  2 +-
 board/buffalo/lsxl/lsxl.c           |  2 +-
 board/compulab/cl-som-am57x/eth.c   |  2 +-
 board/compulab/cm_fx6/cm_fx6.c      |  6 +++---
 board/compulab/cm_t335/cm_t335.c    |  2 +-
 board/compulab/cm_t35/cm_t35.c      |  2 +-
 board/compulab/cm_t3517/cm_t3517.c  |  2 +-
 board/compulab/cm_t54/cm_t54.c      |  4 ++--
 board/davinci/da8xxevm/da850evm.c   |  2 +-
 board/gumstix/pepper/board.c        |  2 +-
 board/isee/igep003x/board.c         |  2 +-
 board/logicpd/zoom1/zoom1.c         |  2 +-
 board/phytec/pcm051/board.c         |  2 +-
 board/renesas/alt/alt.c             |  2 +-
 board/renesas/blanche/blanche.c     |  2 +-
 board/renesas/gose/gose.c           |  2 +-
 board/renesas/koelsch/koelsch.c     |  2 +-
 board/renesas/lager/lager.c         |  2 +-
 board/renesas/porter/porter.c       |  2 +-
 board/renesas/silk/silk.c           |  2 +-
 board/renesas/stout/stout.c         |  2 +-
 board/silica/pengwyn/board.c        |  2 +-
 board/spear/common/spr_misc.c       |  2 +-
 board/ti/evm/evm.c                  |  2 +-
 board/ti/ti814x/evm.c               |  2 +-
 board/ti/ti816x/evm.c               |  2 +-
 board/timll/devkit8000/devkit8000.c |  2 +-
 board/toradex/common/tdx-common.c   |  4 ++--
 cmd/elf.c                           |  4 ++--
 cmd/pxe.c                           |  3 +--
 common/board_r.c                    | 12 ++++++------
 doc/README.enetaddr                 |  4 ++--
 drivers/net/dc2114x.c               |  2 +-
 drivers/net/fsl-mc/mc.c             |  4 ++--
 drivers/net/fsl_mcdmafec.c          |  4 ++--
 drivers/net/ftgmac100.c             |  2 +-
 drivers/net/ftmac100.c              |  2 +-
 drivers/net/lan91c96.c              |  2 +-
 drivers/net/mcffec.c                |  8 ++++----
 drivers/net/ne2000_base.c           |  4 ++--
 drivers/net/sh_eth.c                |  2 +-
 include/net.h                       |  4 ++--
 net/eth-uclass.c                    |  2 +-
 net/eth_common.c                    |  8 ++++----
 net/eth_legacy.c                    |  2 +-
 net/net_rand.h                      |  2 +-
 48 files changed, 69 insertions(+), 70 deletions(-)

diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c
index 4441242cc7..461ff778c2 100644
--- a/arch/arm/mach-davinci/misc.c
+++ b/arch/arm/mach-davinci/misc.c
@@ -90,7 +90,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 	uint8_t env_enetaddr[6];
 	int ret;
 
-	ret = eth_getenv_enetaddr_by_index("eth", 0, env_enetaddr);
+	ret = eth_env_get_enetaddr_by_index("eth", 0, env_enetaddr);
 	if (!ret) {
 		/*
 		 * There is no MAC address in the environment, so we
diff --git a/arch/powerpc/cpu/mpc85xx/fdt.c b/arch/powerpc/cpu/mpc85xx/fdt.c
index 27d3b3ffe9..599839d0ff 100644
--- a/arch/powerpc/cpu/mpc85xx/fdt.c
+++ b/arch/powerpc/cpu/mpc85xx/fdt.c
@@ -580,7 +580,7 @@ static void fdt_fixup_l2_switch(void *blob)
 		return;
 
 	/* Get MAC address for the l2switch from "l2switchaddr"*/
-	if (!eth_getenv_enetaddr("l2switchaddr", l2swaddr)) {
+	if (!eth_env_get_enetaddr("l2switchaddr", l2swaddr)) {
 		printf("Warning: MAC address for l2switch not found\n");
 		memset(l2swaddr, 0, sizeof(l2swaddr));
 	}
diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c
index 611155d3e5..eac04d8178 100644
--- a/board/amlogic/odroid-c2/odroid-c2.c
+++ b/board/amlogic/odroid-c2/odroid-c2.c
@@ -44,7 +44,7 @@ int misc_init_r(void)
 	mdelay(10);
 	setbits_le32(GXBB_GPIO_OUT(3), BIT(14));
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		len = meson_sm_read_efuse(EFUSE_MAC_OFFSET,
 					  mac_addr, EFUSE_MAC_SIZE);
 		if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index 5b31e056ba..2d01ac25d8 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -203,7 +203,7 @@ void check_enetaddr(void)
 {
 	uchar enetaddr[6];
 
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr)) {
 		/* signal unset/invalid ethaddr to user */
 		set_led(LED_INFO_BLINKING);
 	}
diff --git a/board/compulab/cl-som-am57x/eth.c b/board/compulab/cl-som-am57x/eth.c
index 0ad10056fe..b615fb9e7e 100644
--- a/board/compulab/cl-som-am57x/eth.c
+++ b/board/compulab/cl-som-am57x/eth.c
@@ -95,7 +95,7 @@ static int cl_som_am57x_handle_mac_address(char *env_name, uint port_num)
 	int ret;
 	uint8_t enetaddr[6];
 
-	ret = eth_getenv_enetaddr(env_name, enetaddr);
+	ret = eth_env_get_enetaddr(env_name, enetaddr);
 	if (ret)
 		return 0;
 
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index 5a8ee13c8b..a1da2780aa 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -470,7 +470,7 @@ static int handle_mac_address(char *env_var, uint eeprom_bus)
 	unsigned char enetaddr[6];
 	int rc;
 
-	rc = eth_getenv_enetaddr(env_var, enetaddr);
+	rc = eth_env_get_enetaddr(env_var, enetaddr);
 	if (rc)
 		return 0;
 
@@ -605,13 +605,13 @@ int ft_board_setup(void *blob, bd_t *bd)
 	fdt_shrink_to_minimum(blob, 0); /* Make room for new properties */
 
 	/* MAC addr */
-	if (eth_getenv_enetaddr("ethaddr", enetaddr)) {
+	if (eth_env_get_enetaddr("ethaddr", enetaddr)) {
 		fdt_find_and_setprop(blob,
 				     "/soc/aips-bus at 02100000/ethernet at 02188000",
 				     "local-mac-address", enetaddr, 6, 1);
 	}
 
-	if (eth_getenv_enetaddr("eth1addr", enetaddr)) {
+	if (eth_env_get_enetaddr("eth1addr", enetaddr)) {
 		fdt_find_and_setprop(blob, "/eth at pcie", "local-mac-address",
 				     enetaddr, 6, 1);
 	}
diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c
index f6030ddf29..6f6ba49af5 100644
--- a/board/compulab/cm_t335/cm_t335.c
+++ b/board/compulab/cm_t335/cm_t335.c
@@ -106,7 +106,7 @@ static int handle_mac_address(void)
 	uchar enetaddr[6];
 	int rv;
 
-	rv = eth_getenv_enetaddr("ethaddr", enetaddr);
+	rv = eth_env_get_enetaddr("ethaddr", enetaddr);
 	if (rv)
 		return 0;
 
diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index a8696aea83..1e37e392ec 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -434,7 +434,7 @@ static int handle_mac_address(void)
 	unsigned char enetaddr[6];
 	int rc;
 
-	rc = eth_getenv_enetaddr("ethaddr", enetaddr);
+	rc = eth_env_get_enetaddr("ethaddr", enetaddr);
 	if (rc)
 		return 0;
 
diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
index 0568234f66..0ff49dcdcc 100644
--- a/board/compulab/cm_t3517/cm_t3517.c
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -168,7 +168,7 @@ static int cm_t3517_handle_mac_address(void)
 	unsigned char enetaddr[6];
 	int ret;
 
-	ret = eth_getenv_enetaddr("ethaddr", enetaddr);
+	ret = eth_env_get_enetaddr("ethaddr", enetaddr);
 	if (ret)
 		return 0;
 
diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c
index 582512dbe4..31730a4d1c 100644
--- a/board/compulab/cm_t54/cm_t54.c
+++ b/board/compulab/cm_t54/cm_t54.c
@@ -126,7 +126,7 @@ int ft_board_setup(void *blob, bd_t *bd)
 	uint8_t enetaddr[6];
 
 	/* MAC addr */
-	if (eth_getenv_enetaddr("usbethaddr", enetaddr)) {
+	if (eth_env_get_enetaddr("usbethaddr", enetaddr)) {
 		fdt_find_and_setprop(blob, "/smsc95xx at 0", "mac-address",
 				     enetaddr, 6, 1);
 	}
@@ -161,7 +161,7 @@ static int handle_mac_address(void)
 	uint8_t enetaddr[6];
 	int ret;
 
-	ret = eth_getenv_enetaddr("usbethaddr", enetaddr);
+	ret = eth_env_get_enetaddr("usbethaddr", enetaddr);
 	if (ret)
 		return 0;
 
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index f8c8bff64c..c2d2e8e882 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -131,7 +131,7 @@ int misc_init_r(void)
 	uchar env_enetaddr[6];
 	int enetaddr_found;
 
-	enetaddr_found = eth_getenv_enetaddr("ethaddr", env_enetaddr);
+	enetaddr_found = eth_env_get_enetaddr("ethaddr", env_enetaddr);
 
 #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
 	int spi_mac_read;
diff --git a/board/gumstix/pepper/board.c b/board/gumstix/pepper/board.c
index 7e8b014e3d..bfc5fd1c46 100644
--- a/board/gumstix/pepper/board.c
+++ b/board/gumstix/pepper/board.c
@@ -239,7 +239,7 @@ int board_eth_init(bd_t *bis)
 	uint32_t mac_hi, mac_lo;
 	const char *devname;
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		/* try reading mac address from efuse */
 		mac_lo = readl(&cdev->macid0l);
 		mac_hi = readl(&cdev->macid0h);
diff --git a/board/isee/igep003x/board.c b/board/isee/igep003x/board.c
index 1aa2f52069..d33dc960a5 100644
--- a/board/isee/igep003x/board.c
+++ b/board/isee/igep003x/board.c
@@ -264,7 +264,7 @@ int board_eth_init(bd_t *bis)
 	uint8_t mac_addr[6];
 	uint32_t mac_hi, mac_lo;
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		/* try reading mac address from efuse */
 		mac_lo = readl(&cdev->macid0l);
 		mac_hi = readl(&cdev->macid0h);
diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c
index f76223cacd..e6c2526ea1 100644
--- a/board/logicpd/zoom1/zoom1.c
+++ b/board/logicpd/zoom1/zoom1.c
@@ -130,7 +130,7 @@ int board_eth_init(bd_t *bis)
 	uchar eth_addr[6];
 
 	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
-	if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
+	if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
 		dev = eth_get_dev_by_index(0);
 		if (dev) {
 			eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c
index 0da96e7413..52ad5b64de 100644
--- a/board/phytec/pcm051/board.c
+++ b/board/phytec/pcm051/board.c
@@ -216,7 +216,7 @@ int board_eth_init(bd_t *bis)
 	uint8_t mac_addr[6];
 	uint32_t mac_hi, mac_lo;
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		printf("<ethaddr> not set. Reading from E-fuse\n");
 		/* try reading mac address from efuse */
 		mac_lo = readl(&cdev->macid0l);
diff --git a/board/renesas/alt/alt.c b/board/renesas/alt/alt.c
index b35b6a3ad1..0bf8160f1f 100644
--- a/board/renesas/alt/alt.c
+++ b/board/renesas/alt/alt.c
@@ -143,7 +143,7 @@ int board_eth_init(bd_t *bis)
 	unsigned char enetaddr[6];
 
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c
index e3262f779a..574dcda01b 100644
--- a/board/renesas/blanche/blanche.c
+++ b/board/renesas/blanche/blanche.c
@@ -418,7 +418,7 @@ int board_eth_init(bd_t *bis)
 
 	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
 
-	if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
+	if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
 		dev = eth_get_dev_by_index(0);
 		if (dev) {
 			eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
diff --git a/board/renesas/gose/gose.c b/board/renesas/gose/gose.c
index 359f95e264..54e126985b 100644
--- a/board/renesas/gose/gose.c
+++ b/board/renesas/gose/gose.c
@@ -126,7 +126,7 @@ int board_eth_init(bd_t *bis)
 
 #ifdef CONFIG_SH_ETHER
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/renesas/koelsch/koelsch.c b/board/renesas/koelsch/koelsch.c
index dd62145ac9..8fa648e40a 100644
--- a/board/renesas/koelsch/koelsch.c
+++ b/board/renesas/koelsch/koelsch.c
@@ -131,7 +131,7 @@ int board_eth_init(bd_t *bis)
 	unsigned char enetaddr[6];
 
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/renesas/lager/lager.c b/board/renesas/lager/lager.c
index 2ada816006..562be04760 100644
--- a/board/renesas/lager/lager.c
+++ b/board/renesas/lager/lager.c
@@ -136,7 +136,7 @@ int board_eth_init(bd_t *bis)
 	unsigned char enetaddr[6];
 
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/renesas/porter/porter.c b/board/renesas/porter/porter.c
index 926a657511..5b1a167906 100644
--- a/board/renesas/porter/porter.c
+++ b/board/renesas/porter/porter.c
@@ -126,7 +126,7 @@ int board_eth_init(bd_t *bis)
 	unsigned char enetaddr[6];
 
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/renesas/silk/silk.c b/board/renesas/silk/silk.c
index e13a38f5ea..a8de402d20 100644
--- a/board/renesas/silk/silk.c
+++ b/board/renesas/silk/silk.c
@@ -135,7 +135,7 @@ int board_eth_init(bd_t *bis)
 	unsigned char enetaddr[6];
 
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/renesas/stout/stout.c b/board/renesas/stout/stout.c
index fe8dd3d952..d681148273 100644
--- a/board/renesas/stout/stout.c
+++ b/board/renesas/stout/stout.c
@@ -137,7 +137,7 @@ int board_eth_init(bd_t *bis)
 	unsigned char enetaddr[6];
 
 	ret = sh_eth_initialize(bis);
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return ret;
 
 	/* Set Mac address */
diff --git a/board/silica/pengwyn/board.c b/board/silica/pengwyn/board.c
index 057691b045..0429e6f0c7 100644
--- a/board/silica/pengwyn/board.c
+++ b/board/silica/pengwyn/board.c
@@ -171,7 +171,7 @@ int board_eth_init(bd_t *bis)
 	uint8_t mac_addr[6];
 	uint32_t mac_hi, mac_lo;
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		printf("<ethaddr> not set. Reading from E-fuse\n");
 		/* try reading mac address from efuse */
 		mac_lo = readl(&cdev->macid0l);
diff --git a/board/spear/common/spr_misc.c b/board/spear/common/spr_misc.c
index 67de28e7ea..a02304f49e 100644
--- a/board/spear/common/spr_misc.c
+++ b/board/spear/common/spr_misc.c
@@ -53,7 +53,7 @@ int misc_init_r(void)
 #if defined(CONFIG_CMD_NET)
 	uchar mac_id[6];
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id))
+	if (!eth_env_get_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id))
 		eth_env_set_enetaddr("ethaddr", mac_id);
 #endif
 	env_set("verify", "n");
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index ac8e093e5a..61f69e1296 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -245,7 +245,7 @@ int board_eth_init(bd_t *bis)
 
 	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
 
-	if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
+	if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
 		dev = eth_get_dev_by_index(0);
 		if (dev) {
 			eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c
index 38f9c57606..cdde6a8ca3 100644
--- a/board/ti/ti814x/evm.c
+++ b/board/ti/ti814x/evm.c
@@ -166,7 +166,7 @@ int board_eth_init(bd_t *bis)
 	uint8_t mac_addr[6];
 	uint32_t mac_hi, mac_lo;
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		printf("<ethaddr> not set. Reading from E-fuse\n");
 		/* try reading mac address from efuse */
 		mac_lo = readl(&cdev->macid0l);
diff --git a/board/ti/ti816x/evm.c b/board/ti/ti816x/evm.c
index 1a8fe27c9f..cb40cc5f47 100644
--- a/board/ti/ti816x/evm.c
+++ b/board/ti/ti816x/evm.c
@@ -38,7 +38,7 @@ int board_eth_init(bd_t *bis)
 	uint32_t mac_hi, mac_lo;
 	struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
 
-	if (!eth_getenv_enetaddr("ethaddr", mac_addr)) {
+	if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {
 		printf("<ethaddr> not set. Reading from E-fuse\n");
 		/* try reading mac address from efuse */
 		mac_lo = readl(&cdev->macid0l);
diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c
index 2f80d15666..741b3acce2 100644
--- a/board/timll/devkit8000/devkit8000.c
+++ b/board/timll/devkit8000/devkit8000.c
@@ -102,7 +102,7 @@ int misc_init_r(void)
 			CONFIG_DM9000_BASE, GPMC_SIZE_16M);
 
 	/* Use OMAP DIE_ID as MAC address */
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr)) {
 		printf("ethaddr not set, using Die ID\n");
 		die_id_0 = readl(&id_base->die_id_0);
 		enetaddr[0] = 0x02; /* locally administered */
diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c
index 78b2bc0c2b..b4e4727e63 100644
--- a/board/toradex/common/tdx-common.c
+++ b/board/toradex/common/tdx-common.c
@@ -86,11 +86,11 @@ int show_board_info(void)
 	 * Check if environment contains a valid MAC address,
 	 * set the one from config block if not
 	 */
-	if (!eth_getenv_enetaddr("ethaddr", ethaddr))
+	if (!eth_env_get_enetaddr("ethaddr", ethaddr))
 		eth_env_set_enetaddr("ethaddr", (u8 *)&tdx_eth_addr);
 
 #ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR
-	if (!eth_getenv_enetaddr("eth1addr", ethaddr)) {
+	if (!eth_env_get_enetaddr("eth1addr", ethaddr)) {
 		/*
 		 * Secondary MAC address is allocated from block
 		 * 0x100000 higher then the first MAC address
diff --git a/cmd/elf.c b/cmd/elf.c
index 5d071ee26c..51dac03170 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -242,11 +242,11 @@ int do_bootvx(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	 */
 #if defined(CONFIG_WALNUT)
 	tmp = (char *)CONFIG_SYS_NVRAM_BASE_ADDR + 0x500;
-	eth_getenv_enetaddr("ethaddr", (uchar *)build_buf);
+	eth_env_get_enetaddr("ethaddr", (uchar *)build_buf);
 	memcpy(tmp, &build_buf[3], 3);
 #elif defined(CONFIG_SYS_VXWORKS_MAC_PTR)
 	tmp = (char *)CONFIG_SYS_VXWORKS_MAC_PTR;
-	eth_getenv_enetaddr("ethaddr", (uchar *)build_buf);
+	eth_env_get_enetaddr("ethaddr", (uchar *)build_buf);
 	memcpy(tmp, build_buf, 6);
 #else
 	puts("## Ethernet MAC address not copied to NV RAM\n");
diff --git a/cmd/pxe.c b/cmd/pxe.c
index c0579079b8..c5a770a269 100644
--- a/cmd/pxe.c
+++ b/cmd/pxe.c
@@ -70,8 +70,7 @@ static int format_mac_pxe(char *outbuf, size_t outbuf_len)
 		return -EINVAL;
 	}
 
-	if (!eth_getenv_enetaddr_by_index("eth", eth_get_dev_index(),
-					  ethaddr))
+	if (!eth_env_get_enetaddr_by_index("eth", eth_get_dev_index(), ethaddr))
 		return -ENOENT;
 
 	sprintf(outbuf, "01-%02x-%02x-%02x-%02x-%02x-%02x",
diff --git a/common/board_r.c b/common/board_r.c
index c659714ca2..94697e7bc1 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -537,21 +537,21 @@ static int initr_ethaddr(void)
 	bd_t *bd = gd->bd;
 
 	/* kept around for legacy kernels only ... ignore the next section */
-	eth_getenv_enetaddr("ethaddr", bd->bi_enetaddr);
+	eth_env_get_enetaddr("ethaddr", bd->bi_enetaddr);
 #ifdef CONFIG_HAS_ETH1
-	eth_getenv_enetaddr("eth1addr", bd->bi_enet1addr);
+	eth_env_get_enetaddr("eth1addr", bd->bi_enet1addr);
 #endif
 #ifdef CONFIG_HAS_ETH2
-	eth_getenv_enetaddr("eth2addr", bd->bi_enet2addr);
+	eth_env_get_enetaddr("eth2addr", bd->bi_enet2addr);
 #endif
 #ifdef CONFIG_HAS_ETH3
-	eth_getenv_enetaddr("eth3addr", bd->bi_enet3addr);
+	eth_env_get_enetaddr("eth3addr", bd->bi_enet3addr);
 #endif
 #ifdef CONFIG_HAS_ETH4
-	eth_getenv_enetaddr("eth4addr", bd->bi_enet4addr);
+	eth_env_get_enetaddr("eth4addr", bd->bi_enet4addr);
 #endif
 #ifdef CONFIG_HAS_ETH5
-	eth_getenv_enetaddr("eth5addr", bd->bi_enet5addr);
+	eth_env_get_enetaddr("eth5addr", bd->bi_enet5addr);
 #endif
 	return 0;
 }
diff --git a/doc/README.enetaddr b/doc/README.enetaddr
index 241d528ff7..f926485986 100644
--- a/doc/README.enetaddr
+++ b/doc/README.enetaddr
@@ -84,7 +84,7 @@ uchar enetaddr[6];
 eth_parse_enetaddr(addr, enetaddr);
 /* enetaddr now equals { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 } */
 
-	* int eth_getenv_enetaddr(char *name, uchar *enetaddr);
+	* int eth_env_get_enetaddr(char *name, uchar *enetaddr);
 
 Look up an environment variable and convert the stored address.  If the address
 is valid, then the function returns 1.  Otherwise, the function returns 0.  In
@@ -92,7 +92,7 @@ all cases, the enetaddr memory is initialized.  If the env var is not found,
 then it is set to all zeros.  The common function is_valid_ethaddr() is used
 to determine address validity.
 uchar enetaddr[6];
-if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
+if (!eth_env_get_enetaddr("ethaddr", enetaddr)) {
 	/* "ethaddr" is not set in the environment */
 	... try and setup "ethaddr" in the env ...
 }
diff --git a/drivers/net/dc2114x.c b/drivers/net/dc2114x.c
index 8245cf51cc..f38f36beb1 100644
--- a/drivers/net/dc2114x.c
+++ b/drivers/net/dc2114x.c
@@ -750,7 +750,7 @@ static void update_srom(struct eth_device *dev, bd_t *bis)
 	uchar enetaddr[6];
 
 	/* Ethernet Addr... */
-	if (!eth_getenv_enetaddr("ethaddr", enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", enetaddr))
 		return;
 	eeprom[0x0a] = (enetaddr[1] << 8) | enetaddr[0];
 	eeprom[0x0b] = (enetaddr[3] << 8) | enetaddr[2];
diff --git a/drivers/net/fsl-mc/mc.c b/drivers/net/fsl-mc/mc.c
index 9c0af2843d..142aeecfe9 100644
--- a/drivers/net/fsl-mc/mc.c
+++ b/drivers/net/fsl-mc/mc.c
@@ -190,8 +190,8 @@ static int mc_fixup_mac_addr(void *blob, int nodeoffset,
 	/* MAC address property present */
 	if (fdt_get_property(blob, nodeoffset, propname, NULL)) {
 		/* u-boot MAC addr randomly assigned - leave the present one */
-		if (!eth_getenv_enetaddr_by_index("eth", eth_dev->index,
-						  env_enetaddr))
+		if (!eth_env_get_enetaddr_by_index("eth", eth_dev->index,
+						   env_enetaddr))
 			return err;
 	} else {
 		size = MC_DT_INCREASE_SIZE + strlen(propname) + len;
diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c
index 628b420add..26c714cc04 100644
--- a/drivers/net/fsl_mcdmafec.c
+++ b/drivers/net/fsl_mcdmafec.c
@@ -383,9 +383,9 @@ static int fec_init(struct eth_device *dev, bd_t * bd)
 
 	/* Set station address   */
 	if ((u32) fecp == CONFIG_SYS_FEC0_IOBASE)
-		eth_getenv_enetaddr("ethaddr", enetaddr);
+		eth_env_get_enetaddr("ethaddr", enetaddr);
 	else
-		eth_getenv_enetaddr("eth1addr", enetaddr);
+		eth_env_get_enetaddr("eth1addr", enetaddr);
 	fec_set_hwaddr(fecp, enetaddr);
 
 	/* Set Opcode/Pause Duration Register */
diff --git a/drivers/net/ftgmac100.c b/drivers/net/ftgmac100.c
index 5ccc4beda8..d0939e93dc 100644
--- a/drivers/net/ftgmac100.c
+++ b/drivers/net/ftgmac100.c
@@ -346,7 +346,7 @@ static void ftgmac100_set_mac(struct eth_device *dev,
 
 static void ftgmac100_set_mac_from_env(struct eth_device *dev)
 {
-	eth_getenv_enetaddr("ethaddr", dev->enetaddr);
+	eth_env_get_enetaddr("ethaddr", dev->enetaddr);
 
 	ftgmac100_set_mac(dev, dev->enetaddr);
 }
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index cd24a21f04..f231e6b33b 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -355,7 +355,7 @@ static int ftmac100_free_pkt(struct udevice *dev, uchar *packet, int length)
 int ftmac100_read_rom_hwaddr(struct udevice *dev)
 {
 	struct eth_pdata *pdata = dev_get_platdata(dev);
-	eth_getenv_enetaddr("ethaddr", pdata->enetaddr);
+	eth_env_get_enetaddr("ethaddr", pdata->enetaddr);
 	return 0;
 }
 
diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c
index 255c7010cc..a9fc74bdee 100644
--- a/drivers/net/lan91c96.c
+++ b/drivers/net/lan91c96.c
@@ -704,7 +704,7 @@ static int smc_get_ethaddr(bd_t *bd, struct eth_device *dev)
 {
 	uchar v_mac[6];
 
-	if (!eth_getenv_enetaddr("ethaddr", v_mac)) {
+	if (!eth_env_get_enetaddr("ethaddr", v_mac)) {
 		/* get ROM mac value if any */
 		if (!get_rom_mac(dev, v_mac)) {
 			printf("\n*** ERROR: ethaddr is NOT set !!\n");
diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c
index e1b06b25d7..39a6747320 100644
--- a/drivers/net/mcffec.c
+++ b/drivers/net/mcffec.c
@@ -428,25 +428,25 @@ int fec_init(struct eth_device *dev, bd_t * bd)
 	if ((u32) fecp == CONFIG_SYS_FEC0_IOBASE) {
 #ifdef CONFIG_SYS_FEC1_IOBASE
 		volatile fec_t *fecp1 = (fec_t *) (CONFIG_SYS_FEC1_IOBASE);
-		eth_getenv_enetaddr("eth1addr", ea);
+		eth_env_get_enetaddr("eth1addr", ea);
 		fecp1->palr =
 		    (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
 		fecp1->paur = (ea[4] << 24) | (ea[5] << 16);
 #endif
-		eth_getenv_enetaddr("ethaddr", ea);
+		eth_env_get_enetaddr("ethaddr", ea);
 		fecp->palr =
 		    (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
 		fecp->paur = (ea[4] << 24) | (ea[5] << 16);
 	} else {
 #ifdef CONFIG_SYS_FEC0_IOBASE
 		volatile fec_t *fecp0 = (fec_t *) (CONFIG_SYS_FEC0_IOBASE);
-		eth_getenv_enetaddr("ethaddr", ea);
+		eth_env_get_enetaddr("ethaddr", ea);
 		fecp0->palr =
 		    (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
 		fecp0->paur = (ea[4] << 24) | (ea[5] << 16);
 #endif
 #ifdef CONFIG_SYS_FEC1_IOBASE
-		eth_getenv_enetaddr("eth1addr", ea);
+		eth_env_get_enetaddr("eth1addr", ea);
 		fecp->palr =
 		    (ea[0] << 24) | (ea[1] << 16) | (ea[2] << 8) | (ea[3]);
 		fecp->paur = (ea[4] << 24) | (ea[5] << 16);
diff --git a/drivers/net/ne2000_base.c b/drivers/net/ne2000_base.c
index f6e5eafba5..fb088e06a4 100644
--- a/drivers/net/ne2000_base.c
+++ b/drivers/net/ne2000_base.c
@@ -715,12 +715,12 @@ static int ne2k_setup_driver(struct eth_device *dev)
 	 * to the MAC address value in the environment, so we do not read
 	 * it from the prom or eeprom if it is specified in the environment.
 	 */
-	if (!eth_getenv_enetaddr("ethaddr", dev->enetaddr)) {
+	if (!eth_env_get_enetaddr("ethaddr", dev->enetaddr)) {
 		/* If the MAC address is not in the environment, get it: */
 		if (!get_prom(dev->enetaddr, nic.base)) /* get MAC from prom */
 			dp83902a_init(dev->enetaddr);   /* fallback: seeprom */
 		/* And write it into the environment otherwise eth_write_hwaddr
-		 * returns -1 due to eth_getenv_enetaddr_by_index() failing,
+		 * returns -1 due to eth_env_get_enetaddr_by_index() failing,
 		 * and this causes "Warning: failed to set MAC address", and
 		 * cmd_bdinfo has no ethaddr value which it can show: */
 		eth_env_set_enetaddr("ethaddr", dev->enetaddr);
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index a7c265b980..970d730e56 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -578,7 +578,7 @@ int sh_eth_initialize(bd_t *bd)
 	if (retval < 0)
 		return retval;
 
-	if (!eth_getenv_enetaddr("ethaddr", dev->enetaddr))
+	if (!eth_env_get_enetaddr("ethaddr", dev->enetaddr))
 		puts("Please set MAC address\n");
 
 	return ret;
diff --git a/include/net.h b/include/net.h
index 65ab7b2c79..814be33899 100644
--- a/include/net.h
+++ b/include/net.h
@@ -239,7 +239,7 @@ void eth_set_current(void);		/* set nterface to ethcur var */
 
 int eth_get_dev_index(void);		/* get the device index */
 void eth_parse_enetaddr(const char *addr, uchar *enetaddr);
-int eth_getenv_enetaddr(const char *name, uchar *enetaddr);
+int eth_env_get_enetaddr(const char *name, uchar *enetaddr);
 int eth_env_set_enetaddr(const char *name, const uchar *enetaddr);
 
 /**
@@ -275,7 +275,7 @@ int usb_ether_init(void);
  * Returns:
  *	Return true if the address is valid.
  */
-int eth_getenv_enetaddr_by_index(const char *base_name, int index,
+int eth_env_get_enetaddr_by_index(const char *base_name, int index,
 				 uchar *enetaddr);
 
 int eth_init(void);			/* Initialize the device */
diff --git a/net/eth-uclass.c b/net/eth-uclass.c
index 6051a6ab6f..d30b04ba86 100644
--- a/net/eth-uclass.c
+++ b/net/eth-uclass.c
@@ -495,7 +495,7 @@ static int eth_post_probe(struct udevice *dev)
 	if (eth_get_ops(dev)->read_rom_hwaddr)
 		eth_get_ops(dev)->read_rom_hwaddr(dev);
 
-	eth_getenv_enetaddr_by_index("eth", dev->seq, env_enetaddr);
+	eth_env_get_enetaddr_by_index("eth", dev->seq, env_enetaddr);
 	if (!is_zero_ethaddr(env_enetaddr)) {
 		if (!is_zero_ethaddr(pdata->enetaddr) &&
 		    memcmp(pdata->enetaddr, env_enetaddr, ARP_HLEN)) {
diff --git a/net/eth_common.c b/net/eth_common.c
index bde3b88322..66d0d22966 100644
--- a/net/eth_common.c
+++ b/net/eth_common.c
@@ -24,7 +24,7 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr)
 	}
 }
 
-int eth_getenv_enetaddr(const char *name, uchar *enetaddr)
+int eth_env_get_enetaddr(const char *name, uchar *enetaddr)
 {
 	eth_parse_enetaddr(env_get(name), enetaddr);
 	return is_valid_ethaddr(enetaddr);
@@ -34,7 +34,7 @@ int eth_env_set_enetaddr(const char *name, const uchar *enetaddr)
 {
 	char buf[ARP_HLEN_ASCII + 1];
 
-	if (eth_getenv_enetaddr(name, (uchar *)buf))
+	if (eth_env_get_enetaddr(name, (uchar *)buf))
 		return -EEXIST;
 
 	sprintf(buf, "%pM", enetaddr);
@@ -42,12 +42,12 @@ int eth_env_set_enetaddr(const char *name, const uchar *enetaddr)
 	return env_set(name, buf);
 }
 
-int eth_getenv_enetaddr_by_index(const char *base_name, int index,
+int eth_env_get_enetaddr_by_index(const char *base_name, int index,
 				 uchar *enetaddr)
 {
 	char enetvar[32];
 	sprintf(enetvar, index ? "%s%daddr" : "%saddr", base_name, index);
-	return eth_getenv_enetaddr(enetvar, enetaddr);
+	return eth_env_get_enetaddr(enetvar, enetaddr);
 }
 
 int eth_env_set_enetaddr_by_index(const char *base_name, int index,
diff --git a/net/eth_legacy.c b/net/eth_legacy.c
index 5d29d3483b..be0cf64a3d 100644
--- a/net/eth_legacy.c
+++ b/net/eth_legacy.c
@@ -137,7 +137,7 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
 	unsigned char env_enetaddr[ARP_HLEN];
 	int ret = 0;
 
-	eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
+	eth_env_get_enetaddr_by_index(base_name, eth_number, env_enetaddr);
 
 	if (!is_zero_ethaddr(env_enetaddr)) {
 		if (!is_zero_ethaddr(dev->enetaddr) &&
diff --git a/net/net_rand.h b/net/net_rand.h
index ba9d0642cf..4b31227cee 100644
--- a/net/net_rand.h
+++ b/net/net_rand.h
@@ -20,7 +20,7 @@ static inline unsigned int seed_mac(void)
 	unsigned int seed;
 
 	/* get our mac */
-	eth_getenv_enetaddr("ethaddr", enetaddr);
+	eth_env_get_enetaddr("ethaddr", enetaddr);
 
 	seed = enetaddr[5];
 	seed ^= enetaddr[4] << 8;
-- 
2.14.0.rc0.400.g1c36432dff-goog



More information about the U-Boot mailing list