From: Simon Glass Date: Thu, 3 Aug 2017 18:22:11 +0000 (-0600) Subject: env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=fd1e959e91d2b0b2e853d09dd9167dfff18a616c;p=u-boot.git env: Rename eth_setenv_enetaddr() to eth_env_set_enetaddr() Rename this function for consistency with env_set(). Signed-off-by: Simon Glass --- diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c index ec331ba6bb..4441242cc7 100644 --- a/arch/arm/mach-davinci/misc.c +++ b/arch/arm/mach-davinci/misc.c @@ -99,7 +99,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr) debug("### Setting environment from EEPROM MAC address = " "\"%pM\"\n", env_enetaddr); - ret = !eth_setenv_enetaddr("ethaddr", rom_enetaddr); + ret = !eth_env_set_enetaddr("ethaddr", rom_enetaddr); } if (!ret) printf("Failed to set mac address from EEPROM: %d\n", ret); diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c index b7074638bd..c03e93878d 100644 --- a/arch/arm/mach-omap2/utils.c +++ b/arch/arm/mach-omap2/utils.c @@ -214,7 +214,7 @@ void omap_die_id_usbethaddr(void) mac[4] = die_id[0] & 0xff; mac[5] = (die_id[0] >> 8) & 0xff; - eth_setenv_enetaddr("usbethaddr", mac); + eth_env_set_enetaddr("usbethaddr", mac); } } diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c index 6bea9a4383..eb34de931e 100644 --- a/board/BuR/common/common.c +++ b/board/BuR/common/common.c @@ -670,7 +670,7 @@ int board_eth_init(bd_t *bis) if (mac) { printf("using: %pM on ", mac); - eth_setenv_enetaddr("ethaddr", (const u8 *)mac); + eth_env_set_enetaddr("ethaddr", (const u8 *)mac); } } writel(MII_MODE_ENABLE, &cdev->miisel); diff --git a/board/CZ.NIC/turris_omnia/turris_omnia.c b/board/CZ.NIC/turris_omnia/turris_omnia.c index f63e3b6c50..af66837909 100644 --- a/board/CZ.NIC/turris_omnia/turris_omnia.c +++ b/board/CZ.NIC/turris_omnia/turris_omnia.c @@ -515,17 +515,17 @@ int misc_init_r(void) mac[5] = mac1[3]; if (is_valid_ethaddr(mac)) - eth_setenv_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("ethaddr", mac); increment_mac(mac); if (is_valid_ethaddr(mac)) - eth_setenv_enetaddr("eth1addr", mac); + eth_env_set_enetaddr("eth1addr", mac); increment_mac(mac); if (is_valid_ethaddr(mac)) - eth_setenv_enetaddr("eth2addr", mac); + eth_env_set_enetaddr("eth2addr", mac); out: #endif diff --git a/board/LaCie/net2big_v2/net2big_v2.c b/board/LaCie/net2big_v2/net2big_v2.c index 2e6e9ef916..416af469fa 100644 --- a/board/LaCie/net2big_v2/net2big_v2.c +++ b/board/LaCie/net2big_v2/net2big_v2.c @@ -224,7 +224,7 @@ int misc_init_r(void) if (!getenv("ethaddr")) { uchar mac[6]; if (lacie_read_mac_address(mac) == 0) - eth_setenv_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("ethaddr", mac); } #endif init_leds(); diff --git a/board/LaCie/netspace_v2/netspace_v2.c b/board/LaCie/netspace_v2/netspace_v2.c index 16d694716f..fa07288d6e 100644 --- a/board/LaCie/netspace_v2/netspace_v2.c +++ b/board/LaCie/netspace_v2/netspace_v2.c @@ -86,7 +86,7 @@ int misc_init_r(void) if (!getenv("ethaddr")) { uchar mac[6]; if (lacie_read_mac_address(mac) == 0) - eth_setenv_enetaddr("ethaddr", mac); + eth_env_set_enetaddr("ethaddr", mac); } #endif return 0; diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index f2a394a72b..ca9c13bcc1 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -48,7 +48,7 @@ int misc_init_r(void) len = meson_sm_read_efuse(EFUSE_MAC_OFFSET, mac_addr, EFUSE_MAC_SIZE); if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } if (!getenv("serial#")) { diff --git a/board/atmel/sama5d2_xplained/sama5d2_xplained.c b/board/atmel/sama5d2_xplained/sama5d2_xplained.c index 48f45b35ce..4a06cda6f4 100644 --- a/board/atmel/sama5d2_xplained/sama5d2_xplained.c +++ b/board/atmel/sama5d2_xplained/sama5d2_xplained.c @@ -192,7 +192,7 @@ static int set_ethaddr_from_eeprom(void) return -1; } - return eth_setenv_enetaddr(ETHADDR_NAME, ethaddr); + return eth_env_set_enetaddr(ETHADDR_NAME, ethaddr); } #else static int set_ethaddr_from_eeprom(void) diff --git a/board/birdland/bav335x/board.c b/board/birdland/bav335x/board.c index c5122253cf..a9d9ce6fa5 100644 --- a/board/birdland/bav335x/board.c +++ b/board/birdland/bav335x/board.c @@ -396,7 +396,7 @@ int board_eth_init(bd_t *bis) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } #ifdef CONFIG_DRIVER_TI_CPSW diff --git a/board/bosch/shc/board.c b/board/bosch/shc/board.c index 2c830a219c..b4c6a0b45d 100644 --- a/board/bosch/shc/board.c +++ b/board/bosch/shc/board.c @@ -460,7 +460,7 @@ int board_late_init(void) #ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG if (shc_eeprom_valid) if (is_valid_ethaddr(header.mac_addr)) - eth_setenv_enetaddr("ethaddr", header.mac_addr); + eth_env_set_enetaddr("ethaddr", header.mac_addr); #endif return 0; @@ -549,7 +549,7 @@ int board_eth_init(bd_t *bis) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } writel(MII_MODE_ENABLE, &cdev->miisel); @@ -565,7 +565,7 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_USB_ETHER) && \ (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + eth_env_set_enetaddr("usbnet_devaddr", mac_addr); rv = usb_eth_initialize(bis); if (rv < 0) diff --git a/board/compulab/cl-som-am57x/eth.c b/board/compulab/cl-som-am57x/eth.c index 0c4bf91c13..d2992d3a63 100644 --- a/board/compulab/cl-som-am57x/eth.c +++ b/board/compulab/cl-som-am57x/eth.c @@ -107,7 +107,7 @@ static int cl_som_am57x_handle_mac_address(char *env_name, uint port_num) if (!is_valid_ethaddr(enetaddr)) return -1; - ret = eth_setenv_enetaddr(env_name, enetaddr); + ret = eth_env_set_enetaddr(env_name, enetaddr); if (ret) printf("cl-som-am57x: Failed to set Eth port %d MAC address\n", port_num); diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c index c59884a8c3..2368226546 100644 --- a/board/compulab/cm_fx6/cm_fx6.c +++ b/board/compulab/cm_fx6/cm_fx6.c @@ -481,7 +481,7 @@ static int handle_mac_address(char *env_var, uint eeprom_bus) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr(env_var, enetaddr); + return eth_env_set_enetaddr(env_var, enetaddr); } #define SB_FX6_I2C_EEPROM_BUS 0 diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c index c4506b910e..f6030ddf29 100644 --- a/board/compulab/cm_t335/cm_t335.c +++ b/board/compulab/cm_t335/cm_t335.c @@ -117,7 +117,7 @@ static int handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_env_set_enetaddr("ethaddr", enetaddr); } #define AR8051_PHY_DEBUG_ADDR_REG 0x1d diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c index da6709889a..e1cf7fc4d6 100644 --- a/board/compulab/cm_t35/cm_t35.c +++ b/board/compulab/cm_t35/cm_t35.c @@ -445,7 +445,7 @@ static int handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_env_set_enetaddr("ethaddr", enetaddr); } /* diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c index 38eb641bc4..0568234f66 100644 --- a/board/compulab/cm_t3517/cm_t3517.c +++ b/board/compulab/cm_t3517/cm_t3517.c @@ -182,7 +182,7 @@ static int cm_t3517_handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("ethaddr", enetaddr); + return eth_env_set_enetaddr("ethaddr", enetaddr); } #define SB_T35_ETH_RST_GPIO 164 diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c index 6437718415..582512dbe4 100644 --- a/board/compulab/cm_t54/cm_t54.c +++ b/board/compulab/cm_t54/cm_t54.c @@ -172,7 +172,7 @@ static int handle_mac_address(void) if (!is_valid_ethaddr(enetaddr)) return -1; - return eth_setenv_enetaddr("usbethaddr", enetaddr); + return eth_env_set_enetaddr("usbethaddr", enetaddr); } int board_eth_init(bd_t *bis) diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c index 11ea52f240..8cab357a92 100644 --- a/board/davinci/da8xxevm/da850evm.c +++ b/board/davinci/da8xxevm/da850evm.c @@ -147,7 +147,7 @@ int misc_init_r(void) if (!enetaddr_found) { if (!spi_mac_read) { if (is_valid_ethaddr(buff)) { - if (eth_setenv_enetaddr("ethaddr", buff)) { + if (eth_env_set_enetaddr("ethaddr", buff)) { printf("Warning: Failed to " "set MAC address from SPI flash\n"); } diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index efadb0c324..61298ab2fd 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -771,11 +771,11 @@ int misc_init_r(void) /* initialize env from EEPROM */ if (test_bit(EECONFIG_ETH0, info->config) && !getenv("ethaddr")) { - eth_setenv_enetaddr("ethaddr", info->mac0); + eth_env_set_enetaddr("ethaddr", info->mac0); } if (test_bit(EECONFIG_ETH1, info->config) && !getenv("eth1addr")) { - eth_setenv_enetaddr("eth1addr", info->mac1); + eth_env_set_enetaddr("eth1addr", info->mac1); } /* board serial-number */ diff --git a/board/grinn/chiliboard/board.c b/board/grinn/chiliboard/board.c index e3f82b0a80..2900109bbd 100644 --- a/board/grinn/chiliboard/board.c +++ b/board/grinn/chiliboard/board.c @@ -130,7 +130,7 @@ int board_late_init(void) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl(&cdev->macid1l); @@ -144,7 +144,7 @@ int board_late_init(void) if (!getenv("eth1addr")) { if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } #endif diff --git a/board/gumstix/pepper/board.c b/board/gumstix/pepper/board.c index d76c28bd3c..7e8b014e3d 100644 --- a/board/gumstix/pepper/board.c +++ b/board/gumstix/pepper/board.c @@ -250,7 +250,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } writel((RGMII_MODE_ENABLE | RGMII_INT_DELAY), &cdev->miisel); diff --git a/board/isee/igep003x/board.c b/board/isee/igep003x/board.c index 24687e22e4..1aa2f52069 100644 --- a/board/isee/igep003x/board.c +++ b/board/isee/igep003x/board.c @@ -275,7 +275,7 @@ int board_eth_init(bd_t *bis) mac_addr[4] = mac_lo & 0xFF; mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } writel((GMII1_SEL_RMII | RMII1_IO_CLK_EN), diff --git a/board/kosagi/novena/novena.c b/board/kosagi/novena/novena.c index 980cd6288c..baca7223fa 100644 --- a/board/kosagi/novena/novena.c +++ b/board/kosagi/novena/novena.c @@ -264,7 +264,7 @@ int misc_init_r(void) } /* Set ethernet address from EEPROM. */ - eth_setenv_enetaddr("ethaddr", data.mac); + eth_env_set_enetaddr("ethaddr", data.mac); return ret; } diff --git a/board/logicpd/zoom1/zoom1.c b/board/logicpd/zoom1/zoom1.c index e91f874a2b..f76223cacd 100644 --- a/board/logicpd/zoom1/zoom1.c +++ b/board/logicpd/zoom1/zoom1.c @@ -133,7 +133,7 @@ int board_eth_init(bd_t *bis) if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { dev = eth_get_dev_by_index(0); if (dev) { - eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); } else { printf("zoom1: Couldn't get eth device\n"); rc = -1; diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c index 4f3853ac42..0da96e7413 100644 --- a/board/phytec/pcm051/board.c +++ b/board/phytec/pcm051/board.c @@ -229,7 +229,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else goto try_usbether; } diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index aaa3a42abf..7ff7b269f9 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -300,7 +300,7 @@ static void set_usbethaddr(void) return; } - eth_setenv_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac); + eth_env_set_enetaddr("usbethaddr", msg->get_mac_address.body.resp.mac); if (!getenv("ethaddr")) env_set("ethaddr", getenv("usbethaddr")); diff --git a/board/renesas/blanche/blanche.c b/board/renesas/blanche/blanche.c index 5156eafeb4..e3262f779a 100644 --- a/board/renesas/blanche/blanche.c +++ b/board/renesas/blanche/blanche.c @@ -421,7 +421,7 @@ int board_eth_init(bd_t *bis) if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { dev = eth_get_dev_by_index(0); if (dev) { - eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); } else { printf("blanche: Couldn't get eth device\n"); rc = -1; diff --git a/board/rockchip/tinker_rk3288/tinker-rk3288.c b/board/rockchip/tinker_rk3288/tinker-rk3288.c index c2872e7330..790a921515 100644 --- a/board/rockchip/tinker_rk3288/tinker-rk3288.c +++ b/board/rockchip/tinker_rk3288/tinker-rk3288.c @@ -29,7 +29,7 @@ int rk_board_late_init(void) return 0; if (is_valid_ethaddr(ethaddr)) - eth_setenv_enetaddr("ethaddr", ethaddr); + eth_env_set_enetaddr("ethaddr", ethaddr); return 0; } diff --git a/board/samtec/vining_2000/vining_2000.c b/board/samtec/vining_2000/vining_2000.c index d15f2a9c1d..125f6e7070 100644 --- a/board/samtec/vining_2000/vining_2000.c +++ b/board/samtec/vining_2000/vining_2000.c @@ -132,7 +132,7 @@ int board_eth_init(bd_t *bis) /* just to get secound mac address */ imx_get_mac_from_fuse(1, eth1addr); if (!getenv("eth1addr") && is_valid_ethaddr(eth1addr)) - eth_setenv_enetaddr("eth1addr", eth1addr); + eth_env_set_enetaddr("eth1addr", eth1addr); imx_iomux_v3_setup_multiple_pads(fec1_pads, ARRAY_SIZE(fec1_pads)); diff --git a/board/samtec/vining_fpga/socfpga.c b/board/samtec/vining_fpga/socfpga.c index 2ee6d3b554..760fc71217 100644 --- a/board/samtec/vining_fpga/socfpga.c +++ b/board/samtec/vining_fpga/socfpga.c @@ -93,7 +93,7 @@ int misc_init_r(void) /* Set ethernet address from EEPROM. */ if (!getenv("ethaddr") && is_valid_ethaddr(&data[0x62])) - eth_setenv_enetaddr("ethaddr", &data[0x62]); + eth_env_set_enetaddr("ethaddr", &data[0x62]); return 0; } diff --git a/board/siemens/common/factoryset.c b/board/siemens/common/factoryset.c index 4e5ad58d44..b4f027af28 100644 --- a/board/siemens/common/factoryset.c +++ b/board/siemens/common/factoryset.c @@ -292,7 +292,7 @@ static int factoryset_mac_env_set(void) } } - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); return 0; } diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c index 012974d8eb..8bbb03561b 100644 --- a/board/siemens/pxm2/board.c +++ b/board/siemens/pxm2/board.c @@ -225,7 +225,7 @@ int board_eth_init(bd_t *bis) if (!is_valid_ethaddr(factory_dat.mac)) printf("Error: no valid mac address\n"); else - eth_setenv_enetaddr("ethaddr", factory_dat.mac); + eth_env_set_enetaddr("ethaddr", factory_dat.mac); #endif /* #ifdef CONFIG_FACTORYSET */ /* Set rgmii mode and enable rmii clock to be sourced from chip */ diff --git a/board/silica/pengwyn/board.c b/board/silica/pengwyn/board.c index 1f5a5868cb..057691b045 100644 --- a/board/silica/pengwyn/board.c +++ b/board/silica/pengwyn/board.c @@ -184,7 +184,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else return n; } diff --git a/board/spear/common/spr_misc.c b/board/spear/common/spr_misc.c index 3bb4ff14d9..67de28e7ea 100644 --- a/board/spear/common/spr_misc.c +++ b/board/spear/common/spr_misc.c @@ -54,7 +54,7 @@ int misc_init_r(void) uchar mac_id[6]; if (!eth_getenv_enetaddr("ethaddr", mac_id) && !i2c_read_mac(mac_id)) - eth_setenv_enetaddr("ethaddr", mac_id); + eth_env_set_enetaddr("ethaddr", mac_id); #endif env_set("verify", "n"); diff --git a/board/sunxi/board.c b/board/sunxi/board.c index 92fa6c8974..26732dc40f 100644 --- a/board/sunxi/board.c +++ b/board/sunxi/board.c @@ -705,7 +705,7 @@ static void setup_environment(const void *fdt) mac_addr[4] = (sid[3] >> 8) & 0xff; mac_addr[5] = (sid[3] >> 0) & 0xff; - eth_setenv_enetaddr(ethaddr, mac_addr); + eth_env_set_enetaddr(ethaddr, mac_addr); } if (!getenv("serial#")) { diff --git a/board/tcl/sl50/board.c b/board/tcl/sl50/board.c index d3c953e993..cc65c7b84b 100644 --- a/board/tcl/sl50/board.c +++ b/board/tcl/sl50/board.c @@ -326,7 +326,7 @@ int board_eth_init(bd_t *bis) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } #ifdef CONFIG_DRIVER_TI_CPSW @@ -342,7 +342,7 @@ int board_eth_init(bd_t *bis) if (!getenv("eth1addr")) { if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } @@ -373,7 +373,7 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_USB_ETHER) && \ (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) if (is_valid_ether_addr(mac_addr)) - eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + eth_env_set_enetaddr("usbnet_devaddr", mac_addr); rv = usb_eth_initialize(bis); if (rv < 0) diff --git a/board/technologic/ts4800/ts4800.c b/board/technologic/ts4800/ts4800.c index 94251c6d91..8fe26a75e8 100644 --- a/board/technologic/ts4800/ts4800.c +++ b/board/technologic/ts4800/ts4800.c @@ -178,7 +178,7 @@ static int fec_get_mac_from_register(uint32_t base_addr) ethaddr[i] = (reg_mac[i / 4] >> ((i % 4) * 8)) & 0xFF; if (is_valid_ethaddr(ethaddr)) { - eth_setenv_enetaddr("ethaddr", ethaddr); + eth_env_set_enetaddr("ethaddr", ethaddr); return 0; } diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index fd3b638466..733fe96726 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -89,7 +89,7 @@ static void setup_macaddr(void) /* Make this a valid MAC address and set it */ mac_addr[0] &= 0xfe; /* clear multicast bit */ mac_addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); #endif return; diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c index 5751b814ca..7bdbc89d5e 100644 --- a/board/ti/am335x/board.c +++ b/board/ti/am335x/board.c @@ -749,7 +749,7 @@ int board_late_init(void) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl(&cdev->macid1l); @@ -763,7 +763,7 @@ int board_late_init(void) if (!getenv("eth1addr")) { if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } #endif @@ -908,7 +908,7 @@ int board_eth_init(bd_t *bis) #if defined(CONFIG_USB_ETHER) && \ (!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT)) if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("usbnet_devaddr", mac_addr); + eth_env_set_enetaddr("usbnet_devaddr", mac_addr); rv = usb_eth_initialize(bis); if (rv < 0) diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c index 55098bf816..933ff31a8e 100644 --- a/board/ti/am43xx/board.c +++ b/board/ti/am43xx/board.c @@ -794,7 +794,7 @@ int board_eth_init(bd_t *bis) if (!getenv("ethaddr")) { puts(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl(&cdev->macid1l); @@ -808,7 +808,7 @@ int board_eth_init(bd_t *bis) if (!getenv("eth1addr")) { if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } if (board_is_eposevm()) { diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index bd94a90f8f..aaa1464273 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -937,7 +937,7 @@ int board_eth_init(bd_t *bis) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl((*ctrl)->control_core_mac_id_1_lo); @@ -951,7 +951,7 @@ int board_eth_init(bd_t *bis) if (!getenv("eth1addr")) { if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33); @@ -986,9 +986,9 @@ int board_eth_init(bd_t *bis) for (i = 0; i < num_macs; i++) { u64_to_mac(mac1 + i, mac_addr); if (is_valid_ethaddr(mac_addr)) { - eth_setenv_enetaddr_by_index("eth", - i + 2, - mac_addr); + eth_env_set_enetaddr_by_index("eth", + i + 2, + mac_addr); } } } diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index c4ef28282f..6f07ec331a 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -451,8 +451,8 @@ void board_ti_set_ethaddr(int index) for (i = 0; i < num_macs; i++) { u64_to_mac(mac1 + i, mac_addr); if (is_valid_ethaddr(mac_addr)) { - eth_setenv_enetaddr_by_index("eth", i + index, - mac_addr); + eth_env_set_enetaddr_by_index("eth", i + index, + mac_addr); } } } diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c index 5c43561bb7..4252074e74 100644 --- a/board/ti/dra7xx/evm.c +++ b/board/ti/dra7xx/evm.c @@ -897,7 +897,7 @@ int board_eth_init(bd_t *bis) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } mac_lo = readl((*ctrl)->control_core_mac_id_1_lo); @@ -911,7 +911,7 @@ int board_eth_init(bd_t *bis) if (!getenv("eth1addr")) { if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("eth1addr", mac_addr); + eth_env_set_enetaddr("eth1addr", mac_addr); } ctrl_val = readl((*ctrl)->control_core_control_io1) & (~0x33); diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index 6f75bd16f8..f15313acf2 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -300,7 +300,7 @@ int board_eth_init(bd_t *bis) if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { dev = eth_get_dev_by_index(0); if (dev) { - eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); } else { printf("omap3evm: Couldn't get eth device\n"); rc = -1; diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c index 055a29d9c6..38f9c57606 100644 --- a/board/ti/ti814x/evm.c +++ b/board/ti/ti814x/evm.c @@ -179,7 +179,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else printf("Unable to read MAC address. Set \n"); } diff --git a/board/ti/ti816x/evm.c b/board/ti/ti816x/evm.c index 9d6c3d6b5d..1a8fe27c9f 100644 --- a/board/ti/ti816x/evm.c +++ b/board/ti/ti816x/evm.c @@ -51,7 +51,7 @@ int board_eth_init(bd_t *bis) mac_addr[5] = (mac_lo & 0xFF00) >> 8; if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); else printf("Unable to read MAC address. Set \n"); } diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c index d31eeb878a..2f80d15666 100644 --- a/board/timll/devkit8000/devkit8000.c +++ b/board/timll/devkit8000/devkit8000.c @@ -111,7 +111,7 @@ int misc_init_r(void) enetaddr[3] = (die_id_0 & 0x00ff0000) >> 16; enetaddr[4] = (die_id_0 & 0x0000ff00) >> 8; enetaddr[5] = (die_id_0 & 0x000000ff); - eth_setenv_enetaddr("ethaddr", enetaddr); + eth_env_set_enetaddr("ethaddr", enetaddr); } #endif diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index 77ebb88317..78b2bc0c2b 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -87,7 +87,7 @@ int show_board_info(void) * set the one from config block if not */ if (!eth_getenv_enetaddr("ethaddr", ethaddr)) - eth_setenv_enetaddr("ethaddr", (u8 *)&tdx_eth_addr); + eth_env_set_enetaddr("ethaddr", (u8 *)&tdx_eth_addr); #ifdef CONFIG_TDX_CFG_BLOCK_2ND_ETHADDR if (!eth_getenv_enetaddr("eth1addr", ethaddr)) { @@ -97,7 +97,7 @@ int show_board_info(void) */ memcpy(ethaddr, &tdx_eth_addr, 6); ethaddr[3] += 0x10; - eth_setenv_enetaddr("eth1addr", ethaddr); + eth_env_set_enetaddr("eth1addr", ethaddr); } #endif diff --git a/board/vscom/baltos/board.c b/board/vscom/baltos/board.c index 5f730b8fd0..2e3baeb118 100644 --- a/board/vscom/baltos/board.c +++ b/board/vscom/baltos/board.c @@ -457,7 +457,7 @@ int board_eth_init(bd_t *bis) printf(" not set. Validating first E-fuse MAC\n"); if (is_valid_ethaddr(mac_addr)) - eth_setenv_enetaddr("ethaddr", mac_addr); + eth_env_set_enetaddr("ethaddr", mac_addr); } #ifdef CONFIG_DRIVER_TI_CPSW diff --git a/doc/README.enetaddr b/doc/README.enetaddr index bf994d4e41..241d528ff7 100644 --- a/doc/README.enetaddr +++ b/doc/README.enetaddr @@ -98,12 +98,12 @@ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { } /* enetaddr is now set to the value stored in the ethaddr env var */ - * int eth_setenv_enetaddr(char *name, const uchar *enetaddr); + * int eth_env_set_enetaddr(char *name, const uchar *enetaddr); Store the MAC address into the named environment variable. The return value is the same as the env_set() function. uchar enetaddr[6] = { 0x00, 0x11, 0x22, 0x33, 0x44, 0x55 }; -eth_setenv_enetaddr("ethaddr", enetaddr); +eth_env_set_enetaddr("ethaddr", enetaddr); /* the "ethaddr" env var should now be set to "00:11:22:33:44:55" */ * the %pM format modifier diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 40be52070e..424c347e0e 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -1097,7 +1097,7 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr, else strcpy(mac, "ethaddr"); if (!getenv(mac)) - eth_setenv_enetaddr(mac, ethaddr); + eth_env_set_enetaddr(mac, ethaddr); } return ret; err4: diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c index 3526876d14..255c7010cc 100644 --- a/drivers/net/lan91c96.c +++ b/drivers/net/lan91c96.c @@ -710,7 +710,7 @@ static int smc_get_ethaddr(bd_t *bd, struct eth_device *dev) printf("\n*** ERROR: ethaddr is NOT set !!\n"); return -1; } - eth_setenv_enetaddr("ethaddr", v_mac); + eth_env_set_enetaddr("ethaddr", v_mac); } smc_set_mac_addr(v_mac); /* use old function to update smc default */ diff --git a/drivers/net/ne2000_base.c b/drivers/net/ne2000_base.c index 377d87f04b..f6e5eafba5 100644 --- a/drivers/net/ne2000_base.c +++ b/drivers/net/ne2000_base.c @@ -723,7 +723,7 @@ static int ne2k_setup_driver(struct eth_device *dev) * returns -1 due to eth_getenv_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_setenv_enetaddr("ethaddr", dev->enetaddr); + eth_env_set_enetaddr("ethaddr", dev->enetaddr); } return 0; } diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 4137d76c42..d0105372cf 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -2685,7 +2685,7 @@ static int usb_eth_probe(struct udevice *dev) l_priv = priv; get_ether_addr(CONFIG_USBNET_DEVADDR, pdata->enetaddr); - eth_setenv_enetaddr("usbnet_devaddr", pdata->enetaddr); + eth_env_set_enetaddr("usbnet_devaddr", pdata->enetaddr); return 0; } diff --git a/include/net.h b/include/net.h index e1269486ad..376cc1ebfc 100644 --- a/include/net.h +++ b/include/net.h @@ -240,10 +240,10 @@ 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_setenv_enetaddr(const char *name, const uchar *enetaddr); +int eth_env_set_enetaddr(const char *name, const uchar *enetaddr); /** - * eth_setenv_enetaddr_by_index() - set the MAC address environment variable + * eth_env_set_enetaddr_by_index() - set the MAC address environment variable * * This sets up an environment variable with the given MAC address (@enetaddr). * The environment variable to be set is defined by <@base_name><@index>addr. @@ -255,7 +255,7 @@ int eth_setenv_enetaddr(const char *name, const uchar *enetaddr); * @enetaddr: Pointer to MAC address to put into the variable * @return 0 if OK, other value on error */ -int eth_setenv_enetaddr_by_index(const char *base_name, int index, +int eth_env_set_enetaddr_by_index(const char *base_name, int index, uchar *enetaddr); diff --git a/net/eth-uclass.c b/net/eth-uclass.c index b659961a5d..d356576210 100644 --- a/net/eth-uclass.c +++ b/net/eth-uclass.c @@ -510,7 +510,7 @@ static int eth_post_probe(struct udevice *dev) /* Override the ROM MAC address */ memcpy(pdata->enetaddr, env_enetaddr, ARP_HLEN); } else if (is_valid_ethaddr(pdata->enetaddr)) { - eth_setenv_enetaddr_by_index("eth", dev->seq, pdata->enetaddr); + eth_env_set_enetaddr_by_index("eth", dev->seq, pdata->enetaddr); printf("\nWarning: %s using MAC address from ROM\n", dev->name); } else if (is_zero_ethaddr(pdata->enetaddr) || diff --git a/net/eth_common.c b/net/eth_common.c index ef97da7267..7b36532ee1 100644 --- a/net/eth_common.c +++ b/net/eth_common.c @@ -30,7 +30,7 @@ int eth_getenv_enetaddr(const char *name, uchar *enetaddr) return is_valid_ethaddr(enetaddr); } -int eth_setenv_enetaddr(const char *name, const uchar *enetaddr) +int eth_env_set_enetaddr(const char *name, const uchar *enetaddr) { char buf[ARP_HLEN_ASCII + 1]; @@ -50,12 +50,12 @@ int eth_getenv_enetaddr_by_index(const char *base_name, int index, return eth_getenv_enetaddr(enetvar, enetaddr); } -int eth_setenv_enetaddr_by_index(const char *base_name, int index, +int eth_env_set_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_setenv_enetaddr(enetvar, enetaddr); + return eth_env_set_enetaddr(enetvar, enetaddr); } void eth_common_init(void) diff --git a/net/eth_internal.h b/net/eth_internal.h index a14b20844f..4b0e716b73 100644 --- a/net/eth_internal.h +++ b/net/eth_internal.h @@ -13,7 +13,7 @@ void eth_common_init(void); /** - * eth_setenv_enetaddr_by_index() - set the MAC address environment variable + * eth_env_set_enetaddr_by_index() - set the MAC address environment variable * * This sets up an environment variable with the given MAC address (@enetaddr). * The environment variable to be set is defined by <@base_name><@index>addr. @@ -25,7 +25,7 @@ void eth_common_init(void); * @enetaddr: Pointer to MAC address to put into the variable * @return 0 if OK, other value on error */ -int eth_setenv_enetaddr_by_index(const char *base_name, int index, +int eth_env_set_enetaddr_by_index(const char *base_name, int index, uchar *enetaddr); int eth_mac_skip(int index); diff --git a/net/eth_legacy.c b/net/eth_legacy.c index e4bd0f4c1a..2608302648 100644 --- a/net/eth_legacy.c +++ b/net/eth_legacy.c @@ -152,8 +152,8 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name, memcpy(dev->enetaddr, env_enetaddr, ARP_HLEN); } else if (is_valid_ethaddr(dev->enetaddr)) { - eth_setenv_enetaddr_by_index(base_name, eth_number, - dev->enetaddr); + eth_env_set_enetaddr_by_index(base_name, eth_number, + dev->enetaddr); } else if (is_zero_ethaddr(dev->enetaddr)) { #ifdef CONFIG_NET_RANDOM_ETHADDR net_random_ethaddr(dev->enetaddr);