summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-davinci/misc.c2
-rw-r--r--arch/powerpc/cpu/mpc8260/ether_fcc.c14
-rw-r--r--arch/powerpc/cpu/mpc8xx/fec.c6
-rw-r--r--board/BuR/common/common.c4
-rw-r--r--board/ait/cam_enc_4xx/cam_enc_4xx.c2
-rw-r--r--board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c2
-rw-r--r--board/bct-brettl2/bct-brettl2.c2
-rw-r--r--board/bf518f-ezbrd/bf518f-ezbrd.c4
-rw-r--r--board/bf526-ezbrd/bf526-ezbrd.c4
-rw-r--r--board/bf527-ezkit/bf527-ezkit.c4
-rw-r--r--board/bf537-minotaur/bf537-minotaur.c2
-rw-r--r--board/bf537-pnav/bf537-pnav.c2
-rw-r--r--board/bf537-srv1/bf537-srv1.c2
-rw-r--r--board/bf537-stamp/bf537-stamp.c4
-rw-r--r--board/birdland/bav335x/board.c4
-rw-r--r--board/buffalo/lsxl/lsxl.c2
-rw-r--r--board/cm-bf527/cm-bf527.c4
-rw-r--r--board/cm-bf537e/cm-bf537e.c2
-rw-r--r--board/cm-bf537u/cm-bf537u.c2
-rw-r--r--board/compulab/cm_fx6/cm_fx6.c2
-rw-r--r--board/compulab/cm_t335/cm_t335.c2
-rw-r--r--board/compulab/cm_t35/cm_t35.c2
-rw-r--r--board/compulab/cm_t3517/cm_t3517.c4
-rw-r--r--board/compulab/cm_t54/cm_t54.c4
-rw-r--r--board/davinci/da8xxevm/da850evm.c6
-rw-r--r--board/dnp5370/dnp5370.c4
-rw-r--r--board/gumstix/pepper/board.c2
-rw-r--r--board/ifm/ac14xx/ac14xx.c2
-rw-r--r--board/ip04/ip04.c2
-rw-r--r--board/isee/igep0033/board.c2
-rw-r--r--board/phytec/pcm051/board.c2
-rw-r--r--board/renesas/r0p7734/r0p7734.c2
-rw-r--r--board/siemens/common/factoryset.c4
-rw-r--r--board/siemens/pxm2/board.c2
-rw-r--r--board/silica/pengwyn/board.c2
-rw-r--r--board/tcm-bf518/tcm-bf518.c4
-rw-r--r--board/tcm-bf537/tcm-bf537.c2
-rw-r--r--board/ti/am335x/board.c6
-rw-r--r--board/ti/am43xx/board.c4
-rw-r--r--board/ti/beagle_x15/board.c4
-rw-r--r--board/ti/dra7xx/evm.c4
-rw-r--r--board/ti/ti814x/evm.c2
-rw-r--r--doc/README.enetaddr2
-rw-r--r--drivers/net/cpsw.c13
-rw-r--r--drivers/net/dm9000x.c4
-rw-r--r--drivers/net/e1000.c2
-rw-r--r--drivers/net/fec_mxc.c2
-rw-r--r--drivers/net/ftmac110.c2
-rw-r--r--drivers/net/macb.c2
-rw-r--r--drivers/net/netconsole.c4
-rw-r--r--drivers/usb/eth/smsc95xx.c2
-rw-r--r--drivers/usb/gadget/ether.c8
-rw-r--r--include/net.h38
-rw-r--r--net/arp.c8
-rw-r--r--net/bootp.c19
-rw-r--r--net/cdp.c8
-rw-r--r--net/dns.c4
-rw-r--r--net/eth.c22
-rw-r--r--net/link_local.c18
-rw-r--r--net/net.c24
-rw-r--r--net/nfs.c4
-rw-r--r--net/ping.c2
-rw-r--r--net/rarp.c8
-rw-r--r--net/sntp.c4
-rw-r--r--net/tftp.c6
65 files changed, 171 insertions, 173 deletions
diff --git a/arch/arm/mach-davinci/misc.c b/arch/arm/mach-davinci/misc.c
index e18bdfc729..e699d61874 100644
--- a/arch/arm/mach-davinci/misc.c
+++ b/arch/arm/mach-davinci/misc.c
@@ -49,7 +49,7 @@ int dvevm_read_mac_address(uint8_t *buf)
goto i2cerr;
/* Check that MAC address is valid. */
- if (!is_valid_ether_addr(buf))
+ if (!is_valid_ethaddr(buf))
goto err;
return 1; /* Found */
diff --git a/arch/powerpc/cpu/mpc8260/ether_fcc.c b/arch/powerpc/cpu/mpc8260/ether_fcc.c
index f777ba14cc..240e7aedf3 100644
--- a/arch/powerpc/cpu/mpc8260/ether_fcc.c
+++ b/arch/powerpc/cpu/mpc8260/ether_fcc.c
@@ -637,7 +637,7 @@ eth_loopback_test (void)
puts ("FCC Ethernet External loopback test\n");
- eth_getenv_enetaddr("ethaddr", NetOurEther);
+ eth_getenv_enetaddr("ethaddr", net_ethaddr);
/*
* global initialisations for all FCC channels
@@ -721,7 +721,7 @@ eth_loopback_test (void)
BD_ENET_TX_LAST | BD_ENET_TX_TC;
memset ((void *)bp, patbytes[i], ELBT_BUFSZ);
- NetSetEther (bp, NetBcastAddr, 0x8000);
+ NetSetEther(bp, net_bcast_ethaddr, 0x8000);
}
ecp->txbd[ELBT_NTXBD - 1].cbd_sc |= BD_ENET_TX_WRAP;
@@ -799,11 +799,9 @@ eth_loopback_test (void)
* So, far we have only been given one Ethernet address. We use
* the same address for all channels
*/
-#define ea NetOurEther
- fpp->fen_paddrh = (ea[5] << 8) + ea[4];
- fpp->fen_paddrm = (ea[3] << 8) + ea[2];
- fpp->fen_paddrl = (ea[1] << 8) + ea[0];
-#undef ea
+ fpp->fen_paddrh = (net_ethaddr[5] << 8) + net_ethaddr[4];
+ fpp->fen_paddrm = (net_ethaddr[3] << 8) + net_ethaddr[2];
+ fpp->fen_paddrl = (net_ethaddr[1] << 8) + net_ethaddr[0];
fpp->fen_minflr = PKT_MINBUF_SIZE; /* min frame len register */
/*
@@ -1016,7 +1014,7 @@ eth_loopback_test (void)
&ecp->rxbufs[i][0];
ours = memcmp (ehp->et_src, \
- NetOurEther, 6);
+ net_ethaddr, 6);
prot = swap16 (ehp->et_protlen);
tb = prot & 0x8000;
diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c
index 22b8ec752b..454e77af99 100644
--- a/arch/powerpc/cpu/mpc8xx/fec.c
+++ b/arch/powerpc/cpu/mpc8xx/fec.c
@@ -252,9 +252,9 @@ static int fec_recv (struct eth_device *dev)
length -= 4;
#if defined(CONFIG_CMD_CDP)
- if ((rx[0] & 1) != 0
- && memcmp ((uchar *) rx, NetBcastAddr, 6) != 0
- && !is_cdp_packet((uchar *)rx))
+ if ((rx[0] & 1) != 0 &&
+ memcmp((uchar *)rx, net_bcast_ethaddr, 6) != 0 &&
+ !is_cdp_packet((uchar *)rx))
rx = NULL;
#endif
/*
diff --git a/board/BuR/common/common.c b/board/BuR/common/common.c
index ccaa9c6845..13f23fd7ce 100644
--- a/board/BuR/common/common.c
+++ b/board/BuR/common/common.c
@@ -216,7 +216,7 @@ static const char *dtbmacaddr(u32 ifno)
node = fdt_path_offset((void *)dtbaddr, path);
mac = fdt_getprop((void *)dtbaddr, node, "mac-address", &len);
- if (mac && is_valid_ether_addr((u8 *)mac))
+ if (mac && is_valid_ethaddr((u8 *)mac))
return mac;
return NULL;
@@ -595,7 +595,7 @@ int board_eth_init(bd_t *bis)
#endif
if (!mac) {
printf("<ethaddr> not set. validating E-fuse MAC ... ");
- if (is_valid_ether_addr((const u8 *)mac_addr))
+ if (is_valid_ethaddr((const u8 *)mac_addr))
mac = (const char *)mac_addr;
}
diff --git a/board/ait/cam_enc_4xx/cam_enc_4xx.c b/board/ait/cam_enc_4xx/cam_enc_4xx.c
index 290dc1984a..c5687bab7d 100644
--- a/board/ait/cam_enc_4xx/cam_enc_4xx.c
+++ b/board/ait/cam_enc_4xx/cam_enc_4xx.c
@@ -70,7 +70,7 @@ static int cam_enc_4xx_check_network(void)
if (!s)
return -EINVAL;
- if (!is_valid_ether_addr((const u8 *)s))
+ if (!is_valid_ethaddr((const u8 *)s))
return -EINVAL;
s = getenv("ipaddr");
diff --git a/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c b/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
index b81a68d63d..e65befc3ba 100644
--- a/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
+++ b/board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
@@ -167,7 +167,7 @@ int board_late_init(void)
/* Read MAC address */
i2c_read(0x50, 0x0, 0, mac, 6);
- if (is_valid_ether_addr(mac))
+ if (is_valid_ethaddr(mac))
eth_setenv_enetaddr("ethaddr", mac);
return 0;
diff --git a/board/bct-brettl2/bct-brettl2.c b/board/bct-brettl2/bct-brettl2.c
index 6be9b18015..1f0dfb4d40 100644
--- a/board/bct-brettl2/bct-brettl2.c
+++ b/board/bct-brettl2/bct-brettl2.c
@@ -32,7 +32,7 @@ int checkboard(void)
static void board_init_enetaddr(uchar *mac_addr)
{
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/bf518f-ezbrd/bf518f-ezbrd.c b/board/bf518f-ezbrd/bf518f-ezbrd.c
index 3a94a572eb..8ecfbb28c9 100644
--- a/board/bf518f-ezbrd/bf518f-ezbrd.c
+++ b/board/bf518f-ezbrd/bf518f-ezbrd.c
@@ -39,7 +39,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (USE_MAC_IN_FLASH) {
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x203F0096;
- if (is_valid_ether_addr(board_mac_addr)) {
+ if (is_valid_ethaddr(board_mac_addr)) {
memcpy(mac_addr, board_mac_addr, 6);
valid_mac = true;
}
@@ -47,7 +47,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/bf526-ezbrd/bf526-ezbrd.c b/board/bf526-ezbrd/bf526-ezbrd.c
index 368d6be25f..0a88491e90 100644
--- a/board/bf526-ezbrd/bf526-ezbrd.c
+++ b/board/bf526-ezbrd/bf526-ezbrd.c
@@ -36,7 +36,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (USE_MAC_IN_FLASH) {
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x203F0096;
- if (is_valid_ether_addr(board_mac_addr)) {
+ if (is_valid_ethaddr(board_mac_addr)) {
memcpy(mac_addr, board_mac_addr, 6);
valid_mac = true;
}
@@ -44,7 +44,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/bf527-ezkit/bf527-ezkit.c b/board/bf527-ezkit/bf527-ezkit.c
index 88e18690e0..257775f3c8 100644
--- a/board/bf527-ezkit/bf527-ezkit.c
+++ b/board/bf527-ezkit/bf527-ezkit.c
@@ -40,13 +40,13 @@ static void board_init_enetaddr(uchar *mac_addr)
for (ret = 0; ret < 6; ++ret)
mac_addr[ret] = otp_mac_p[5 - ret];
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
valid_mac = true;
}
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/bf537-minotaur/bf537-minotaur.c b/board/bf537-minotaur/bf537-minotaur.c
index ca61ef97b8..71b4293ad6 100644
--- a/board/bf537-minotaur/bf537-minotaur.c
+++ b/board/bf537-minotaur/bf537-minotaur.c
@@ -26,7 +26,7 @@ int checkboard(void)
static void board_init_enetaddr(uchar *mac_addr)
{
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/bf537-pnav/bf537-pnav.c b/board/bf537-pnav/bf537-pnav.c
index df0011026a..93522df56c 100644
--- a/board/bf537-pnav/bf537-pnav.c
+++ b/board/bf537-pnav/bf537-pnav.c
@@ -26,7 +26,7 @@ int checkboard(void)
static void board_init_enetaddr(uchar *mac_addr)
{
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/bf537-srv1/bf537-srv1.c b/board/bf537-srv1/bf537-srv1.c
index 725296a416..6581028294 100644
--- a/board/bf537-srv1/bf537-srv1.c
+++ b/board/bf537-srv1/bf537-srv1.c
@@ -26,7 +26,7 @@ int checkboard(void)
static void board_init_enetaddr(uchar *mac_addr)
{
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c
index 32045a9e47..66e54925da 100644
--- a/board/bf537-stamp/bf537-stamp.c
+++ b/board/bf537-stamp/bf537-stamp.c
@@ -39,7 +39,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (USE_MAC_IN_FLASH) {
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x203F0000;
- if (is_valid_ether_addr(board_mac_addr)) {
+ if (is_valid_ethaddr(board_mac_addr)) {
memcpy(mac_addr, board_mac_addr, 6);
valid_mac = true;
}
@@ -47,7 +47,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/birdland/bav335x/board.c b/board/birdland/bav335x/board.c
index d1e1c8cbd3..32ff7a4f9e 100644
--- a/board/birdland/bav335x/board.c
+++ b/board/birdland/bav335x/board.c
@@ -384,7 +384,7 @@ int board_eth_init(bd_t *bis)
ecode = read_eeprom(&header);
/* if we have a valid EE, get mac address from there */
if ((ecode == 0) &&
- is_valid_ether_addr((const u8 *)&header.mac_addr[0][0])) {
+ is_valid_ethaddr((const u8 *)&header.mac_addr[0][0])) {
memcpy(mac_addr, (const void *)&header.mac_addr[0][0], 6);
}
@@ -395,7 +395,7 @@ int board_eth_init(bd_t *bis)
if (!getenv("ethaddr")) {
printf("<ethaddr> not set. Validating first E-fuse MAC\n");
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/buffalo/lsxl/lsxl.c b/board/buffalo/lsxl/lsxl.c
index b0d49c4ee6..487875c23a 100644
--- a/board/buffalo/lsxl/lsxl.c
+++ b/board/buffalo/lsxl/lsxl.c
@@ -232,7 +232,7 @@ static void rescue_mode(void)
printf("Entering rescue mode..\n");
#ifdef CONFIG_RANDOM_MACADDR
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
- eth_random_addr(enetaddr);
+ net_random_ethaddr(enetaddr);
if (eth_setenv_enetaddr("ethaddr", enetaddr)) {
printf("Failed to set ethernet address\n");
set_led(LED_ALARM_BLINKING);
diff --git a/board/cm-bf527/cm-bf527.c b/board/cm-bf527/cm-bf527.c
index 1533eb9c7a..2871fa2d6a 100644
--- a/board/cm-bf527/cm-bf527.c
+++ b/board/cm-bf527/cm-bf527.c
@@ -39,13 +39,13 @@ static void board_init_enetaddr(uchar *mac_addr)
for (ret = 0; ret < 6; ++ret)
mac_addr[ret] = otp_mac_p[5 - ret];
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
valid_mac = true;
}
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/cm-bf537e/cm-bf537e.c b/board/cm-bf537e/cm-bf537e.c
index e79f90f95b..902611ec01 100644
--- a/board/cm-bf537e/cm-bf537e.c
+++ b/board/cm-bf537e/cm-bf537e.c
@@ -31,7 +31,7 @@ static void board_init_enetaddr(char *var)
return;
printf("Warning: %s: generating 'random' MAC address\n", var);
- eth_random_addr(enetaddr);
+ net_random_ethaddr(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
}
diff --git a/board/cm-bf537u/cm-bf537u.c b/board/cm-bf537u/cm-bf537u.c
index 632cbda5c0..69bffd76de 100644
--- a/board/cm-bf537u/cm-bf537u.c
+++ b/board/cm-bf537u/cm-bf537u.c
@@ -31,7 +31,7 @@ static void board_init_enetaddr(char *var)
return;
printf("Warning: %s: generating 'random' MAC address\n", var);
- eth_random_addr(enetaddr);
+ net_random_ethaddr(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
}
diff --git a/board/compulab/cm_fx6/cm_fx6.c b/board/compulab/cm_fx6/cm_fx6.c
index ae6945ba9c..7a1bbafaa5 100644
--- a/board/compulab/cm_fx6/cm_fx6.c
+++ b/board/compulab/cm_fx6/cm_fx6.c
@@ -425,7 +425,7 @@ static int handle_mac_address(char *env_var, uint eeprom_bus)
if (rc)
return rc;
- if (!is_valid_ether_addr(enetaddr))
+ if (!is_valid_ethaddr(enetaddr))
return -1;
return eth_setenv_enetaddr(env_var, enetaddr);
diff --git a/board/compulab/cm_t335/cm_t335.c b/board/compulab/cm_t335/cm_t335.c
index 592ef3d30f..428aee6d24 100644
--- a/board/compulab/cm_t335/cm_t335.c
+++ b/board/compulab/cm_t335/cm_t335.c
@@ -114,7 +114,7 @@ static int handle_mac_address(void)
if (rv)
get_efuse_mac_addr(enetaddr);
- if (!is_valid_ether_addr(enetaddr))
+ if (!is_valid_ethaddr(enetaddr))
return -1;
return eth_setenv_enetaddr("ethaddr", enetaddr);
diff --git a/board/compulab/cm_t35/cm_t35.c b/board/compulab/cm_t35/cm_t35.c
index c4ea8ea875..374edbcffc 100644
--- a/board/compulab/cm_t35/cm_t35.c
+++ b/board/compulab/cm_t35/cm_t35.c
@@ -441,7 +441,7 @@ static int handle_mac_address(void)
if (rc)
return rc;
- if (!is_valid_ether_addr(enetaddr))
+ if (!is_valid_ethaddr(enetaddr))
return -1;
return eth_setenv_enetaddr("ethaddr", enetaddr);
diff --git a/board/compulab/cm_t3517/cm_t3517.c b/board/compulab/cm_t3517/cm_t3517.c
index 624cf4c034..03b2badd02 100644
--- a/board/compulab/cm_t3517/cm_t3517.c
+++ b/board/compulab/cm_t3517/cm_t3517.c
@@ -132,7 +132,7 @@ static int am3517_get_efuse_enetaddr(u8 *enetaddr)
enetaddr[4] = (u8)((lsb >> 8) & 0xff);
enetaddr[5] = (u8)(lsb & 0xff);
- return is_valid_ether_addr(enetaddr);
+ return is_valid_ethaddr(enetaddr);
}
static inline int cm_t3517_init_emac(bd_t *bis)
@@ -170,7 +170,7 @@ static int cm_t3517_handle_mac_address(void)
return ret;
}
- if (!is_valid_ether_addr(enetaddr))
+ if (!is_valid_ethaddr(enetaddr))
return -1;
return eth_setenv_enetaddr("ethaddr", enetaddr);
diff --git a/board/compulab/cm_t54/cm_t54.c b/board/compulab/cm_t54/cm_t54.c
index fdea909ff7..fad0551498 100644
--- a/board/compulab/cm_t54/cm_t54.c
+++ b/board/compulab/cm_t54/cm_t54.c
@@ -166,10 +166,10 @@ static int handle_mac_address(void)
return 0;
ret = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS);
- if (ret || !is_valid_ether_addr(enetaddr))
+ if (ret || !is_valid_ethaddr(enetaddr))
generate_mac_addr(enetaddr);
- if (!is_valid_ether_addr(enetaddr))
+ if (!is_valid_ethaddr(enetaddr))
return -1;
return eth_setenv_enetaddr("usbethaddr", enetaddr);
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index b9ca38e929..b82385a918 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -145,7 +145,7 @@ int misc_init_r(void)
*/
if (!enetaddr_found) {
if (!spi_mac_read) {
- if (is_valid_ether_addr(buff)) {
+ if (is_valid_ethaddr(buff)) {
if (eth_setenv_enetaddr("ethaddr", buff)) {
printf("Warning: Failed to "
"set MAC address from SPI flash\n");
@@ -160,8 +160,8 @@ int misc_init_r(void)
* MAC address present in environment compare it with
* the MAC address in SPI flash and warn on mismatch
*/
- if (!spi_mac_read && is_valid_ether_addr(buff) &&
- memcmp(env_enetaddr, buff, 6))
+ if (!spi_mac_read && is_valid_ethaddr(buff) &&
+ memcmp(env_enetaddr, buff, 6))
printf("Warning: MAC address in SPI flash don't match "
"with the MAC address in the environment\n");
printf("Default using MAC address from environment\n");
diff --git a/board/dnp5370/dnp5370.c b/board/dnp5370/dnp5370.c
index df721c9944..655fcace2b 100644
--- a/board/dnp5370/dnp5370.c
+++ b/board/dnp5370/dnp5370.c
@@ -46,7 +46,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (USE_MAC_IN_FLASH) {
/* we cram the MAC in the last flash sector */
uchar *board_mac_addr = (uchar *)0x202F0000;
- if (is_valid_ether_addr(board_mac_addr)) {
+ if (is_valid_ethaddr(board_mac_addr)) {
memcpy(mac_addr, board_mac_addr, 6);
valid_mac = true;
}
@@ -54,7 +54,7 @@ static void board_init_enetaddr(uchar *mac_addr)
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/gumstix/pepper/board.c b/board/gumstix/pepper/board.c
index f644f8188b..beb2fac374 100644
--- a/board/gumstix/pepper/board.c
+++ b/board/gumstix/pepper/board.c
@@ -165,7 +165,7 @@ int board_eth_init(bd_t *bis)
mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
mac_addr[4] = mac_lo & 0xFF;
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/ifm/ac14xx/ac14xx.c b/board/ifm/ac14xx/ac14xx.c
index 5d2ab2fad3..72932ca69f 100644
--- a/board/ifm/ac14xx/ac14xx.c
+++ b/board/ifm/ac14xx/ac14xx.c
@@ -225,7 +225,7 @@ int mac_read_from_eeprom(void)
break;
}
- if (mac && is_valid_ether_addr(mac)) {
+ if (mac && is_valid_ethaddr(mac)) {
eth_setenv_enetaddr("ethaddr", mac);
if (mac_diag) {
mac_txt = getenv("ethaddr");
diff --git a/board/ip04/ip04.c b/board/ip04/ip04.c
index ae52633426..d20500f4df 100644
--- a/board/ip04/ip04.c
+++ b/board/ip04/ip04.c
@@ -32,7 +32,7 @@ int misc_init_r(void)
uchar enetaddr[6];
if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(enetaddr);
+ net_random_ethaddr(enetaddr);
eth_setenv_enetaddr("ethaddr", enetaddr);
}
diff --git a/board/isee/igep0033/board.c b/board/isee/igep0033/board.c
index 9f8fcf2c1c..5fea7ffaef 100644
--- a/board/isee/igep0033/board.c
+++ b/board/isee/igep0033/board.c
@@ -156,7 +156,7 @@ int board_eth_init(bd_t *bis)
mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
mac_addr[4] = mac_lo & 0xFF;
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
diff --git a/board/phytec/pcm051/board.c b/board/phytec/pcm051/board.c
index 1071662ea9..1bf9d730e5 100644
--- a/board/phytec/pcm051/board.c
+++ b/board/phytec/pcm051/board.c
@@ -228,7 +228,7 @@ int board_eth_init(bd_t *bis)
mac_addr[4] = mac_lo & 0xFF;
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
else
goto try_usbether;
diff --git a/board/renesas/r0p7734/r0p7734.c b/board/renesas/r0p7734/r0p7734.c
index 5687ad4766..2e31ba6731 100644
--- a/board/renesas/r0p7734/r0p7734.c
+++ b/board/renesas/r0p7734/r0p7734.c
@@ -55,7 +55,7 @@ int board_late_init(void)
/* Read MAC address */
i2c_read(0x50, 0x10, 0, mac, 6);
- if (is_valid_ether_addr(mac))
+ if (is_valid_ethaddr(mac))
eth_setenv_enetaddr("ethaddr", mac);
return 0;
diff --git a/board/siemens/common/factoryset.c b/board/siemens/common/factoryset.c
index 7baac3dda6..d81f5481a7 100644
--- a/board/siemens/common/factoryset.c
+++ b/board/siemens/common/factoryset.c
@@ -271,7 +271,7 @@ static int factoryset_mac_setenv(void)
uint8_t mac_addr[6];
debug("FactorySet: Set mac address\n");
- if (is_valid_ether_addr(factory_dat.mac)) {
+ if (is_valid_ethaddr(factory_dat.mac)) {
memcpy(mac_addr, factory_dat.mac, 6);
} else {
uint32_t mac_hi, mac_lo;
@@ -286,7 +286,7 @@ static int factoryset_mac_setenv(void)
mac_addr[3] = (mac_hi & 0xFF000000) >> 24;
mac_addr[4] = mac_lo & 0xFF;
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
- if (!is_valid_ether_addr(mac_addr)) {
+ if (!is_valid_ethaddr(mac_addr)) {
printf("Warning: ethaddr not set by FactorySet or E-fuse. Set <ethaddr> variable to overcome this.\n");
return -1;
}
diff --git a/board/siemens/pxm2/board.c b/board/siemens/pxm2/board.c
index 264ba025b7..4d8ba3cd80 100644
--- a/board/siemens/pxm2/board.c
+++ b/board/siemens/pxm2/board.c
@@ -222,7 +222,7 @@ int board_eth_init(bd_t *bis)
struct ctrl_dev *cdev = (struct ctrl_dev *)CTRL_DEVICE_BASE;
#ifdef CONFIG_FACTORYSET
int rv;
- if (!is_valid_ether_addr(factory_dat.mac))
+ if (!is_valid_ethaddr(factory_dat.mac))
printf("Error: no valid mac address\n");
else
eth_setenv_enetaddr("ethaddr", factory_dat.mac);
diff --git a/board/silica/pengwyn/board.c b/board/silica/pengwyn/board.c
index ee88b6f399..815c9a7d15 100644
--- a/board/silica/pengwyn/board.c
+++ b/board/silica/pengwyn/board.c
@@ -189,7 +189,7 @@ int board_eth_init(bd_t *bis)
mac_addr[4] = mac_lo & 0xFF;
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
else
return n;
diff --git a/board/tcm-bf518/tcm-bf518.c b/board/tcm-bf518/tcm-bf518.c
index 5d25fcd0a9..3fa7d972ea 100644
--- a/board/tcm-bf518/tcm-bf518.c
+++ b/board/tcm-bf518/tcm-bf518.c
@@ -39,14 +39,14 @@ static void board_init_enetaddr(uchar *mac_addr)
for (ret = 0; ret < 6; ++ret)
mac_addr[ret] = otp_mac_p[5 - ret];
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
valid_mac = true;
}
#endif
if (!valid_mac) {
puts("Warning: Generating 'random' MAC address\n");
- eth_random_addr(mac_addr);
+ net_random_ethaddr(mac_addr);
}
eth_setenv_enetaddr("ethaddr", mac_addr);
diff --git a/board/tcm-bf537/tcm-bf537.c b/board/tcm-bf537/tcm-bf537.c
index a4f0f7121b..2531a44336 100644
--- a/board/tcm-bf537/tcm-bf537.c
+++ b/board/tcm-bf537/tcm-bf537.c
@@ -31,7 +31,7 @@ static void board_init_enetaddr(char *var)
return;
printf("Warning: %s: generating 'random' MAC address\n", var);
- eth_random_addr(enetaddr);
+ net_random_ethaddr(enetaddr);
eth_setenv_enetaddr(var, enetaddr);
}
diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
index 0739e6021a..96245a3306 100644
--- a/board/ti/am335x/board.c
+++ b/board/ti/am335x/board.c
@@ -593,7 +593,7 @@ int board_eth_init(bd_t *bis)
if (!getenv("ethaddr")) {
printf("<ethaddr> not set. Validating first E-fuse MAC\n");
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
@@ -609,7 +609,7 @@ int board_eth_init(bd_t *bis)
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
if (!getenv("eth1addr")) {
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("eth1addr", mac_addr);
}
@@ -658,7 +658,7 @@ int board_eth_init(bd_t *bis)
#endif
#if defined(CONFIG_USB_ETHER) && \
(!defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_USBETH_SUPPORT))
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("usbnet_devaddr", mac_addr);
rv = usb_eth_initialize(bis);
diff --git a/board/ti/am43xx/board.c b/board/ti/am43xx/board.c
index ddf4c5fc13..4aae230608 100644
--- a/board/ti/am43xx/board.c
+++ b/board/ti/am43xx/board.c
@@ -802,7 +802,7 @@ int board_eth_init(bd_t *bis)
if (!getenv("ethaddr")) {
puts("<ethaddr> not set. Validating first E-fuse MAC\n");
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
@@ -816,7 +816,7 @@ int board_eth_init(bd_t *bis)
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
if (!getenv("eth1addr")) {
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("eth1addr", mac_addr);
}
diff --git a/board/ti/beagle_x15/board.c b/board/ti/beagle_x15/board.c
index ac0d22c9ed..ffcd53185b 100644
--- a/board/ti/beagle_x15/board.c
+++ b/board/ti/beagle_x15/board.c
@@ -356,7 +356,7 @@ int board_eth_init(bd_t *bis)
if (!getenv("ethaddr")) {
printf("<ethaddr> not set. Validating first E-fuse MAC\n");
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
@@ -370,7 +370,7 @@ int board_eth_init(bd_t *bis)
mac_addr[5] = mac_lo & 0xFF;
if (!getenv("eth1addr")) {
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("eth1addr", mac_addr);
}
diff --git a/board/ti/dra7xx/evm.c b/board/ti/dra7xx/evm.c
index 3089fa2334..c1019289ba 100644
--- a/board/ti/dra7xx/evm.c
+++ b/board/ti/dra7xx/evm.c
@@ -341,7 +341,7 @@ int board_eth_init(bd_t *bis)
if (!getenv("ethaddr")) {
printf("<ethaddr> not set. Validating first E-fuse MAC\n");
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
}
@@ -355,7 +355,7 @@ int board_eth_init(bd_t *bis)
mac_addr[5] = mac_lo & 0xFF;
if (!getenv("eth1addr")) {
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("eth1addr", mac_addr);
}
diff --git a/board/ti/ti814x/evm.c b/board/ti/ti814x/evm.c
index 54b3dfb82c..e406dabfc0 100644
--- a/board/ti/ti814x/evm.c
+++ b/board/ti/ti814x/evm.c
@@ -178,7 +178,7 @@ int board_eth_init(bd_t *bis)
mac_addr[4] = mac_lo & 0xFF;
mac_addr[5] = (mac_lo & 0xFF00) >> 8;
- if (is_valid_ether_addr(mac_addr))
+ if (is_valid_ethaddr(mac_addr))
eth_setenv_enetaddr("ethaddr", mac_addr);
else
printf("Unable to read MAC address. Set <ethaddr>\n");
diff --git a/doc/README.enetaddr b/doc/README.enetaddr
index 1eaeaf9416..0fafd2cdcd 100644
--- a/doc/README.enetaddr
+++ b/doc/README.enetaddr
@@ -87,7 +87,7 @@ eth_parse_enetaddr(addr, 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
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_ether_addr() is used
+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)) {
diff --git a/drivers/net/cpsw.c b/drivers/net/cpsw.c
index 52f8da67e1..d4b0cb9273 100644
--- a/drivers/net/cpsw.c
+++ b/drivers/net/cpsw.c
@@ -289,7 +289,7 @@ static inline void cpsw_ale_get_addr(u32 *ale_entry, u8 *addr)
addr[i] = cpsw_ale_get_field(ale_entry, 40 - 8*i, 8);
}
-static inline void cpsw_ale_set_addr(u32 *ale_entry, u8 *addr)
+static inline void cpsw_ale_set_addr(u32 *ale_entry, const u8 *addr)
{
int i;
@@ -321,7 +321,7 @@ static int cpsw_ale_write(struct cpsw_priv *priv, int idx, u32 *ale_entry)
return idx;
}
-static int cpsw_ale_match_addr(struct cpsw_priv *priv, u8* addr)
+static int cpsw_ale_match_addr(struct cpsw_priv *priv, const u8 *addr)
{
u32 ale_entry[ALE_ENTRY_WORDS];
int type, idx;
@@ -374,7 +374,7 @@ static int cpsw_ale_find_ageable(struct cpsw_priv *priv)
return -ENOENT;
}
-static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr,
+static int cpsw_ale_add_ucast(struct cpsw_priv *priv, const u8 *addr,
int port, int flags)
{
u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
@@ -399,7 +399,8 @@ static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr,
return 0;
}
-static int cpsw_ale_add_mcast(struct cpsw_priv *priv, u8 *addr, int port_mask)
+static int cpsw_ale_add_mcast(struct cpsw_priv *priv, const u8 *addr,
+ int port_mask)
{
u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
int idx, mask;
@@ -644,7 +645,7 @@ static void cpsw_slave_init(struct cpsw_slave *slave, struct cpsw_priv *priv)
slave_port = cpsw_get_slave_port(priv, slave->slave_num);
cpsw_ale_port_state(priv, slave_port, ALE_PORT_STATE_FORWARD);
- cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << slave_port);
+ cpsw_ale_add_mcast(priv, net_bcast_ethaddr, 1 << slave_port);
priv->phy_mask |= 1 << slave->data->phy_addr;
}
@@ -773,7 +774,7 @@ static int cpsw_init(struct eth_device *dev, bd_t *bis)
cpsw_ale_add_ucast(priv, priv->dev->enetaddr, priv->host_port,
ALE_SECURE);
- cpsw_ale_add_mcast(priv, NetBcastAddr, 1 << priv->host_port);
+ cpsw_ale_add_mcast(priv, net_bcast_ethaddr, 1 << priv->host_port);
for_active_slave(slave, priv)
cpsw_slave_init(slave, priv);
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index 4de9d41642..d1c6f4ca2e 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -342,10 +342,10 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
DM9000_iow(DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
printf("MAC: %pM\n", dev->enetaddr);
- if (!is_valid_ether_addr(dev->enetaddr)) {
+ if (!is_valid_ethaddr(dev->enetaddr)) {
#ifdef CONFIG_RANDOM_MACADDR
printf("Bad MAC address (uninitialized EEPROM?), randomizing\n");
- eth_random_addr(dev->enetaddr);
+ net_random_ethaddr(dev->enetaddr);
printf("MAC: %pM\n", dev->enetaddr);
#else
printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c
index cd4422215f..6a2e0d2928 100644
--- a/drivers/net/e1000.c
+++ b/drivers/net/e1000.c
@@ -1197,7 +1197,7 @@ e1000_read_mac_addr(struct eth_device *nic)
nic->enetaddr[5] ^= 1;
#ifdef CONFIG_E1000_FALLBACK_MAC
- if (!is_valid_ether_addr(nic->enetaddr)) {
+ if (!is_valid_ethaddr(nic->enetaddr)) {
unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index b57247032f..1146d3b8a1 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -357,7 +357,7 @@ static int fec_get_hwaddr(struct eth_device *dev, int dev_id,
unsigned char *mac)
{
imx_get_mac_from_fuse(dev_id, mac);
- return !is_valid_ether_addr(mac);
+ return !is_valid_ethaddr(mac);
}
static int fec_set_hwaddr(struct eth_device *dev)
diff --git a/drivers/net/ftmac110.c b/drivers/net/ftmac110.c
index 98c4f09629..aef89a299e 100644
--- a/drivers/net/ftmac110.c
+++ b/drivers/net/ftmac110.c
@@ -425,7 +425,7 @@ int ftmac110_initialize(bd_t *bis)
dev->recv = ftmac110_recv;
if (!eth_getenv_enetaddr_by_index("eth", card_nr, dev->enetaddr))
- eth_random_addr(dev->enetaddr);
+ net_random_ethaddr(dev->enetaddr);
/* allocate tx descriptors (it must be 16 bytes aligned) */
chip->txd = dma_alloc_coherent(
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 170ff0646f..1fe408ce70 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -595,7 +595,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
}
/* update the ethaddr */
- if (is_valid_ether_addr(netdev->enetaddr)) {
+ if (is_valid_ethaddr(netdev->enetaddr)) {
macb_write_hwaddr(netdev);
} else {
printf("%s: mac address is not valid\n", netdev->name);
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 55f383f133..0d81b441b7 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -117,7 +117,7 @@ static int refresh_settings_from_env(void)
void NcStart(void)
{
refresh_settings_from_env();
- if (!output_packet_len || memcmp(nc_ether, NetEtherNullAddr, 6)) {
+ if (!output_packet_len || memcmp(nc_ether, net_null_ethaddr, 6)) {
/* going to check for input packet */
net_set_udp_handler(nc_handler);
NetSetTimeout(net_timeout, nc_timeout);
@@ -180,7 +180,7 @@ static void nc_send_packet(const char *buf, int len)
if (eth == NULL)
return;
- if (!memcmp(nc_ether, NetEtherNullAddr, 6)) {
+ if (!memcmp(nc_ether, net_null_ethaddr, 6)) {
if (eth->state == ETH_STATE_ACTIVE)
return; /* inside net loop */
output_packet = buf;
diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c
index 6bca34dcf5..78b469ffa0 100644
--- a/drivers/usb/eth/smsc95xx.c
+++ b/drivers/usb/eth/smsc95xx.c
@@ -355,7 +355,7 @@ static int smsc95xx_init_mac_address(struct eth_device *eth,
/* try reading mac address from EEPROM */
if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
eth->enetaddr) == 0) {
- if (is_valid_ether_addr(eth->enetaddr)) {
+ if (is_valid_ethaddr(eth->enetaddr)) {
/* eeprom values are valid so use them */
debug("MAC address read from EEPROM\n");
return 0;
diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
index 7e3b3ed859..516e356df4 100644
--- a/drivers/usb/gadget/ether.c
+++ b/drivers/usb/gadget/ether.c
@@ -1645,13 +1645,13 @@ static int eth_start_xmit (struct sk_buff *skb, struct net_device *net)
if (!eth_is_promisc (dev)) {
u8 *dest = skb->data;
- if (is_multicast_ether_addr(dest)) {
+ if (is_multicast_ethaddr(dest)) {
u16 type;
/* ignores USB_CDC_PACKET_TYPE_MULTICAST and host
* SET_ETHERNET_MULTICAST_FILTERS requests
*/
- if (is_broadcast_ether_addr(dest))
+ if (is_broadcast_ethaddr(dest))
type = USB_CDC_PACKET_TYPE_BROADCAST;
else
type = USB_CDC_PACKET_TYPE_ALL_MULTICAST;
@@ -1942,7 +1942,7 @@ static int is_eth_addr_valid(char *str)
}
/* Now check the contents. */
- return is_valid_ether_addr(ea);
+ return is_valid_ethaddr(ea);
}
return 0;
}
@@ -1971,7 +1971,7 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
num |= (nibble(*str++));
dev_addr[i] = num;
}
- if (is_valid_ether_addr(dev_addr))
+ if (is_valid_ethaddr(dev_addr))
return 0;
}
return 1;
diff --git a/include/net.h b/include/net.h
index 494930cf07..8a3e5ffe7a 100644
--- a/include/net.h
+++ b/include/net.h
@@ -477,8 +477,8 @@ extern char net_nis_domain[32]; /* Our IS domain */
extern char net_hostname[32]; /* Our hostname */
extern char net_root_path[64]; /* Our root path */
/** END OF BOOTP EXTENTIONS **/
-extern uchar NetOurEther[6]; /* Our ethernet address */
-extern uchar NetServerEther[6]; /* Boot server enet address */
+extern u8 net_ethaddr[6]; /* Our ethernet address */
+extern u8 net_server_ethaddr[6]; /* Boot server enet address */
extern struct in_addr net_ip; /* Our IP addr (0 = unknown) */
extern struct in_addr net_server_ip; /* Server IP addr (0 = unknown) */
extern uchar *NetTxPacket; /* THE transmit packet */
@@ -490,8 +490,8 @@ extern uchar *NetRxPackets[PKTBUFSRX]; /* Receive packets */
extern uchar *NetRxPacket; /* Current receive packet */
extern int NetRxPacketLen; /* Current rx packet length */
extern unsigned NetIPID; /* IP ID (counting) */
-extern uchar NetBcastAddr[6]; /* Ethernet boardcast address */
-extern uchar NetEtherNullAddr[6];
+extern const u8 net_bcast_ethaddr[6]; /* Ethernet broadcast address */
+extern const u8 net_null_ethaddr[6];
#define VLAN_NONE 4095 /* untagged */
#define VLAN_IDMASK 0x0fff /* mask of valid vlan id */
@@ -528,11 +528,11 @@ extern ushort CDPApplianceVLAN; /* CDP returned appliance VLAN */
/*
* Check for a CDP packet by examining the received MAC address field
*/
-static inline int is_cdp_packet(const uchar *et_addr)
+static inline int is_cdp_packet(const uchar *ethaddr)
{
- extern const uchar NetCDPAddr[6];
+ extern const u8 net_cdp_ethaddr[6];
- return memcmp(et_addr, NetCDPAddr, 6) == 0;
+ return memcmp(ethaddr, net_cdp_ethaddr, 6) == 0;
}
#endif
@@ -559,7 +559,7 @@ int NetStartAgain(void);
int NetEthHdrSize(void);
/* Set ethernet header; returns the size of the header */
-int NetSetEther(uchar *, uchar *, uint);
+int NetSetEther(uchar *xet, const uchar *dest_ethaddr, uint prot);
int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot);
/* Set IP header */
@@ -722,42 +722,42 @@ static inline void NetCopyLong(ulong *to, ulong *from)
}
/**
- * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
+ * is_zero_ethaddr - Determine if give Ethernet address is all zeros.
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is all zeroes.
*/
-static inline int is_zero_ether_addr(const u8 *addr)
+static inline int is_zero_ethaddr(const u8 *addr)
{
return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
}
/**
- * is_multicast_ether_addr - Determine if the Ethernet address is a multicast.
+ * is_multicast_ethaddr - Determine if the Ethernet address is a multicast.
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is a multicast address.
* By definition the broadcast address is also a multicast address.
*/
-static inline int is_multicast_ether_addr(const u8 *addr)
+static inline int is_multicast_ethaddr(const u8 *addr)
{
return 0x01 & addr[0];
}
/*
- * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
+ * is_broadcast_ethaddr - Determine if the Ethernet address is broadcast
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is the broadcast address.
*/
-static inline int is_broadcast_ether_addr(const u8 *addr)
+static inline int is_broadcast_ethaddr(const u8 *addr)
{
return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) ==
0xff;
}
/*
- * is_valid_ether_addr - Determine if the given Ethernet address is valid
+ * is_valid_ethaddr - Determine if the given Ethernet address is valid
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
@@ -765,21 +765,21 @@ static inline int is_broadcast_ether_addr(const u8 *addr)
*
* Return true if the address is valid.
*/
-static inline int is_valid_ether_addr(const u8 *addr)
+static inline int is_valid_ethaddr(const u8 *addr)
{
/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
* explicitly check for it here. */
- return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
+ return !is_multicast_ethaddr(addr) && !is_zero_ethaddr(addr);
}
/**
- * eth_random_addr - Generate software assigned random Ethernet address
+ * net_random_ethaddr - Generate software assigned random Ethernet address
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Generate a random Ethernet address (MAC) that is not multicast
* and has the local assigned bit set.
*/
-static inline void eth_random_addr(uchar *addr)
+static inline void net_random_ethaddr(uchar *addr)
{
int i;
unsigned int seed = get_timer(0);
diff --git a/net/arp.c b/net/arp.c
index 4971a53612..c613609b2d 100644
--- a/net/arp.c
+++ b/net/arp.c
@@ -60,7 +60,7 @@ void arp_raw_request(struct in_addr source_ip, const uchar *targetEther,
pkt = NetArpTxPacket;
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_ARP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_ARP);
pkt += eth_hdr_size;
arp = (struct arp_hdr *) pkt;
@@ -71,7 +71,7 @@ void arp_raw_request(struct in_addr source_ip, const uchar *targetEther,
arp->ar_pln = ARP_PLEN;
arp->ar_op = htons(ARPOP_REQUEST);
- memcpy(&arp->ar_sha, NetOurEther, ARP_HLEN); /* source ET addr */
+ memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN); /* source ET addr */
net_write_ip(&arp->ar_spa, source_ip); /* source IP addr */
memcpy(&arp->ar_tha, targetEther, ARP_HLEN); /* target ET addr */
net_write_ip(&arp->ar_tpa, target_ip); /* target IP addr */
@@ -93,7 +93,7 @@ void ArpRequest(void)
net_arp_wait_reply_ip = net_arp_wait_packet_ip;
}
- arp_raw_request(net_ip, NetEtherNullAddr, net_arp_wait_reply_ip);
+ arp_raw_request(net_ip, net_null_ethaddr, net_arp_wait_reply_ip);
}
void ArpTimeoutCheck(void)
@@ -168,7 +168,7 @@ void ArpReceive(struct ethernet_hdr *et, struct ip_udp_hdr *ip, int len)
arp->ar_op = htons(ARPOP_REPLY);
memcpy(&arp->ar_tha, &arp->ar_sha, ARP_HLEN);
net_copy_ip(&arp->ar_tpa, &arp->ar_spa);
- memcpy(&arp->ar_sha, NetOurEther, ARP_HLEN);
+ memcpy(&arp->ar_sha, net_ethaddr, ARP_HLEN);
net_copy_ip(&arp->ar_spa, &net_ip);
#ifdef CONFIG_CMD_LINK_LOCAL
diff --git a/net/bootp.c b/net/bootp.c
index 9251e91bf6..9b27d4cb53 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -147,7 +147,8 @@ static void BootpCopyNetParams(struct Bootp_t *bp)
net_copy_ip(&tmp_ip, &bp->bp_siaddr);
if (tmp_ip.s_addr != 0)
net_copy_ip(&net_server_ip, &bp->bp_siaddr);
- memcpy(NetServerEther, ((struct ethernet_hdr *)NetRxPacket)->et_src, 6);
+ memcpy(net_server_ethaddr, ((struct ethernet_hdr *)NetRxPacket)->et_src,
+ 6);
if (strlen(bp->bp_file) > 0)
copy_filename(net_boot_file_name, bp->bp_file,
sizeof(net_boot_file_name));
@@ -693,7 +694,7 @@ BootpRequest(void)
pkt = NetTxPacket;
memset((void *)pkt, 0, PKTSIZE);
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_IP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_IP);
pkt += eth_hdr_size;
/*
@@ -719,7 +720,7 @@ BootpRequest(void)
net_write_ip(&bp->bp_yiaddr, zero_ip);
net_write_ip(&bp->bp_siaddr, zero_ip);
net_write_ip(&bp->bp_giaddr, zero_ip);
- memcpy(bp->bp_chaddr, NetOurEther, 6);
+ memcpy(bp->bp_chaddr, net_ethaddr, 6);
copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file));
/* Request additional information from the BOOTP/DHCP server */
@@ -734,10 +735,10 @@ BootpRequest(void)
* Bootp ID is the lower 4 bytes of our ethernet address
* plus the current time in ms.
*/
- BootpID = ((ulong)NetOurEther[2] << 24)
- | ((ulong)NetOurEther[3] << 16)
- | ((ulong)NetOurEther[4] << 8)
- | (ulong)NetOurEther[5];
+ BootpID = ((ulong)net_ethaddr[2] << 24)
+ | ((ulong)net_ethaddr[3] << 16)
+ | ((ulong)net_ethaddr[4] << 8)
+ | (ulong)net_ethaddr[5];
BootpID += get_timer(0);
BootpID = htonl(BootpID);
bootp_add_id(BootpID);
@@ -896,7 +897,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer)
pkt = NetTxPacket;
memset((void *)pkt, 0, PKTSIZE);
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_IP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_IP);
pkt += eth_hdr_size;
iphdr = pkt; /* We'll need this later to set proper pkt size */
@@ -918,7 +919,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer)
zero_ip.s_addr = 0;
net_write_ip(&bp->bp_giaddr, zero_ip);
- memcpy(bp->bp_chaddr, NetOurEther, 6);
+ memcpy(bp->bp_chaddr, net_ethaddr, 6);
/*
* ID is the id of the OFFER packet
diff --git a/net/cdp.c b/net/cdp.c
index 2d8fa03a7e..e8e7a67010 100644
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -18,7 +18,7 @@
#include "cdp.h"
/* Ethernet bcast address */
-const uchar NetCDPAddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
+const u8 net_cdp_ethaddr[6] = { 0x01, 0x00, 0x0c, 0xcc, 0xcc, 0xcc };
#define CDP_DEVICE_ID_TLV 0x0001
#define CDP_ADDRESS_TLV 0x0002
@@ -124,8 +124,8 @@ CDPSendTrigger(void)
/* NOTE: trigger sent not on any VLAN */
/* form ethernet header */
- memcpy(et->et_dest, NetCDPAddr, 6);
- memcpy(et->et_src, NetOurEther, 6);
+ memcpy(et->et_dest, net_cdp_ethaddr, 6);
+ memcpy(et->et_src, net_ethaddr, 6);
pkt += ETHER_HDR_SIZE;
@@ -145,7 +145,7 @@ CDPSendTrigger(void)
#ifdef CONFIG_CDP_DEVICE_ID
*s++ = htons(CDP_DEVICE_ID_TLV);
*s++ = htons(CONFIG_CDP_DEVICE_ID);
- sprintf(buf, CONFIG_CDP_DEVICE_ID_PREFIX "%pm", NetOurEther);
+ sprintf(buf, CONFIG_CDP_DEVICE_ID_PREFIX "%pm", net_ethaddr);
memcpy((uchar *)s, buf, 16);
s += 16 / 2;
#endif
diff --git a/net/dns.c b/net/dns.c
index 6f8b1f2596..0ff2b75ecc 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -89,7 +89,7 @@ DnsSend(void)
DnsOurPort = random_port();
- NetSendUDPPacket(NetServerEther, net_dns_server, DNS_SERVICE_PORT,
+ NetSendUDPPacket(net_server_ethaddr, net_dns_server, DNS_SERVICE_PORT,
DnsOurPort, n);
debug("DNS packet sent\n");
}
@@ -203,7 +203,7 @@ DnsStart(void)
net_set_udp_handler(dns_handler);
/* Clear a previous MAC address, the server IP might have changed. */
- memset(NetServerEther, 0, sizeof(NetServerEther));
+ memset(net_server_ethaddr, 0, sizeof(net_server_ethaddr));
DnsSend();
}
diff --git a/net/eth.c b/net/eth.c
index f06fdb2743..3f5cb7ec99 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -32,7 +32,7 @@ void eth_parse_enetaddr(const char *addr, uchar *enetaddr)
int eth_getenv_enetaddr(char *name, uchar *enetaddr)
{
eth_parse_enetaddr(getenv(name), enetaddr);
- return is_valid_ether_addr(enetaddr);
+ return is_valid_ethaddr(enetaddr);
}
int eth_setenv_enetaddr(char *name, const uchar *enetaddr)
@@ -369,7 +369,7 @@ static int eth_write_hwaddr(struct udevice *dev)
/* seq is valid since the device is active */
if (eth_get_ops(dev)->write_hwaddr && !eth_mac_skip(dev->seq)) {
- if (!is_valid_ether_addr(pdata->enetaddr)) {
+ if (!is_valid_ethaddr(pdata->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
dev->name, pdata->enetaddr);
return -EINVAL;
@@ -470,8 +470,8 @@ static int eth_post_probe(struct udevice *dev)
eth_get_ops(dev)->read_rom_hwaddr(dev);
eth_getenv_enetaddr_by_index("eth", dev->seq, env_enetaddr);
- if (!is_zero_ether_addr(env_enetaddr)) {
- if (!is_zero_ether_addr(pdata->enetaddr) &&
+ if (!is_zero_ethaddr(env_enetaddr)) {
+ if (!is_zero_ethaddr(pdata->enetaddr) &&
memcmp(pdata->enetaddr, env_enetaddr, 6)) {
printf("\nWarning: %s MAC addresses don't match:\n",
dev->name);
@@ -483,11 +483,11 @@ static int eth_post_probe(struct udevice *dev)
/* Override the ROM MAC address */
memcpy(pdata->enetaddr, env_enetaddr, 6);
- } else if (is_valid_ether_addr(pdata->enetaddr)) {
+ } else if (is_valid_ethaddr(pdata->enetaddr)) {
eth_setenv_enetaddr_by_index("eth", dev->seq, pdata->enetaddr);
printf("\nWarning: %s using MAC address from ROM\n",
dev->name);
- } else if (is_zero_ether_addr(pdata->enetaddr)) {
+ } else if (is_zero_ethaddr(pdata->enetaddr)) {
printf("\nError: %s address not set.\n",
dev->name);
return -EINVAL;
@@ -608,8 +608,8 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
eth_getenv_enetaddr_by_index(base_name, eth_number, env_enetaddr);
- if (!is_zero_ether_addr(env_enetaddr)) {
- if (!is_zero_ether_addr(dev->enetaddr) &&
+ if (!is_zero_ethaddr(env_enetaddr)) {
+ if (!is_zero_ethaddr(dev->enetaddr) &&
memcmp(dev->enetaddr, env_enetaddr, 6)) {
printf("\nWarning: %s MAC addresses don't match:\n",
dev->name);
@@ -620,19 +620,19 @@ int eth_write_hwaddr(struct eth_device *dev, const char *base_name,
}
memcpy(dev->enetaddr, env_enetaddr, 6);
- } else if (is_valid_ether_addr(dev->enetaddr)) {
+ } else if (is_valid_ethaddr(dev->enetaddr)) {
eth_setenv_enetaddr_by_index(base_name, eth_number,
dev->enetaddr);
printf("\nWarning: %s using MAC address from net device\n",
dev->name);
- } else if (is_zero_ether_addr(dev->enetaddr)) {
+ } else if (is_zero_ethaddr(dev->enetaddr)) {
printf("\nError: %s address not set.\n",
dev->name);
return -EINVAL;
}
if (dev->write_hwaddr && !eth_mac_skip(eth_number)) {
- if (!is_valid_ether_addr(dev->enetaddr)) {
+ if (!is_valid_ethaddr(dev->enetaddr)) {
printf("\nError: %s address %pM illegal value\n",
dev->name, dev->enetaddr);
return -EINVAL;
diff --git a/net/link_local.c b/net/link_local.c
index 6d92c555fb..2bca7de12a 100644
--- a/net/link_local.c
+++ b/net/link_local.c
@@ -139,7 +139,7 @@ static void link_local_timeout(void)
nprobes++;
debug_cond(DEBUG_LL_STATE, "probe/%u %s@%pI4\n",
nprobes, eth_get_name(), &ip);
- arp_raw_request(zero_ip, NetEtherNullAddr, ip);
+ arp_raw_request(zero_ip, net_null_ethaddr, ip);
timeout_ms = PROBE_MIN * 1000;
timeout_ms += random_delay_ms(PROBE_MAX - PROBE_MIN);
} else {
@@ -148,7 +148,7 @@ static void link_local_timeout(void)
nclaims = 0;
debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n",
nclaims, eth_get_name(), &ip);
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
}
break;
@@ -160,7 +160,7 @@ static void link_local_timeout(void)
nclaims = 0;
debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n",
nclaims, eth_get_name(), &ip);
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
break;
case ANNOUNCE:
@@ -171,7 +171,7 @@ static void link_local_timeout(void)
nclaims++;
debug_cond(DEBUG_LL_STATE, "announce/%u %s@%pI4\n",
nclaims, eth_get_name(), &ip);
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
timeout_ms = ANNOUNCE_INTERVAL * 1000;
} else {
/* Switch to monitor state */
@@ -268,11 +268,9 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
source_ip_conflict = 0;
target_ip_conflict = 0;
- if (memcmp(&arp->ar_spa, &ip, ARP_PLEN) == 0
- && memcmp(&arp->ar_sha, NetOurEther, ARP_HLEN) != 0
- ) {
+ if (memcmp(&arp->ar_spa, &ip, ARP_PLEN) == 0 &&
+ memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) != 0)
source_ip_conflict = 1;
- }
/*
* According to RFC 3927, section 2.2.1:
@@ -284,7 +282,7 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
if (arp->ar_op == htons(ARPOP_REQUEST) &&
memcmp(&arp->ar_spa, &null_ip, ARP_PLEN) == 0 &&
memcmp(&arp->ar_tpa, &ip, ARP_PLEN) == 0 &&
- memcmp(&arp->ar_sha, NetOurEther, ARP_HLEN) != 0) {
+ memcmp(&arp->ar_sha, net_ethaddr, ARP_HLEN) != 0) {
target_ip_conflict = 1;
}
@@ -318,7 +316,7 @@ void link_local_receive_arp(struct arp_hdr *arp, int len)
debug("monitor conflict -- defending\n");
state = DEFEND;
timeout_ms = DEFEND_INTERVAL * 1000;
- arp_raw_request(ip, NetOurEther, ip);
+ arp_raw_request(ip, net_ethaddr, ip);
}
break;
case DEFEND:
diff --git a/net/net.c b/net/net.c
index bfa326e565..6db2b9c08e 100644
--- a/net/net.c
+++ b/net/net.c
@@ -129,9 +129,9 @@ struct in_addr net_mcast_addr;
/** END OF BOOTP EXTENTIONS **/
/* Our ethernet address */
-uchar NetOurEther[6];
+u8 net_ethaddr[6];
/* Boot server enet address */
-uchar NetServerEther[6];
+u8 net_server_ethaddr[6];
/* Our IP addr (0 = unknown) */
struct in_addr net_ip;
/* Server IP addr (0 = unknown) */
@@ -143,8 +143,8 @@ int NetRxPacketLen;
/* IP packet ID */
unsigned NetIPID;
/* Ethernet bcast address */
-uchar NetBcastAddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
-uchar NetEtherNullAddr[6];
+const u8 net_bcast_ethaddr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
+const u8 net_null_ethaddr[6];
#ifdef CONFIG_API
void (*push_packet)(void *, int len) = 0;
#endif
@@ -274,7 +274,7 @@ static void NetInitLoop(void)
env_changed_id = env_id;
}
if (eth_get_dev())
- memcpy(NetOurEther, eth_get_ethaddr(), 6);
+ memcpy(net_ethaddr, eth_get_ethaddr(), 6);
return;
}
@@ -728,7 +728,7 @@ int NetSendUDPPacket(uchar *ether, struct in_addr dest, int dport, int sport,
/* if broadcast, make the ether address a broadcast and don't do ARP */
if (dest.s_addr == 0xFFFFFFFF)
- ether = NetBcastAddr;
+ ether = (uchar *)net_bcast_ethaddr;
pkt = (uchar *)NetTxPacket;
@@ -738,7 +738,7 @@ int NetSendUDPPacket(uchar *ether, struct in_addr dest, int dport, int sport,
pkt_hdr_size = eth_hdr_size + IP_UDP_HDR_SIZE;
/* if MAC address was not discovered yet, do an ARP request */
- if (memcmp(ether, NetEtherNullAddr, 6) == 0) {
+ if (memcmp(ether, net_null_ethaddr, 6) == 0) {
debug_cond(DEBUG_DEV_PKT, "sending ARP for %pI4\n", &dest);
/* save the ip and eth addr for the packet to send after arp */
@@ -1279,7 +1279,7 @@ common:
case CDP:
case DHCP:
case LINKLOCAL:
- if (memcmp(NetOurEther, "\0\0\0\0\0\0", 6) == 0) {
+ if (memcmp(net_ethaddr, "\0\0\0\0\0\0", 6) == 0) {
int num = eth_get_dev_index();
switch (num) {
@@ -1320,7 +1320,7 @@ NetEthHdrSize(void)
}
int
-NetSetEther(uchar *xet, uchar * addr, uint prot)
+NetSetEther(uchar *xet, const uchar *dest_ethaddr, uint prot)
{
struct ethernet_hdr *et = (struct ethernet_hdr *)xet;
ushort myvlanid;
@@ -1329,8 +1329,8 @@ NetSetEther(uchar *xet, uchar * addr, uint prot)
if (myvlanid == (ushort)-1)
myvlanid = VLAN_NONE;
- memcpy(et->et_dest, addr, 6);
- memcpy(et->et_src, NetOurEther, 6);
+ memcpy(et->et_dest, dest_ethaddr, 6);
+ memcpy(et->et_src, net_ethaddr, 6);
if ((myvlanid & VLAN_IDMASK) == VLAN_NONE) {
et->et_protlen = htons(prot);
return ETHER_HDR_SIZE;
@@ -1350,7 +1350,7 @@ int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot)
ushort protlen;
memcpy(et->et_dest, addr, 6);
- memcpy(et->et_src, NetOurEther, 6);
+ memcpy(et->et_src, net_ethaddr, 6);
protlen = ntohs(et->et_protlen);
if (protlen == PROT_VLAN) {
struct vlan_ethernet_hdr *vet =
diff --git a/net/nfs.c b/net/nfs.c
index 1e5c1c350a..23a9cc340e 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -211,7 +211,7 @@ rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen)
else
sport = NfsSrvNfsPort;
- NetSendUDPPacket(NetServerEther, nfs_server_ip, sport, NfsOurPort,
+ NetSendUDPPacket(net_server_ethaddr, nfs_server_ip, sport, NfsOurPort,
pktlen);
}
@@ -788,7 +788,7 @@ NfsStart(void)
NfsOurPort = 1000;
/* zero out server ether in case the server ip has changed */
- memset(NetServerEther, 0, 6);
+ memset(net_server_ethaddr, 0, 6);
NfsSend();
}
diff --git a/net/ping.c b/net/ping.c
index 4918a1cb36..e4e3086e19 100644
--- a/net/ping.c
+++ b/net/ping.c
@@ -50,7 +50,7 @@ static int ping_send(void)
net_arp_wait_packet_ip = net_ping_ip;
- eth_hdr_size = NetSetEther(NetTxPacket, NetEtherNullAddr, PROT_IP);
+ eth_hdr_size = NetSetEther(NetTxPacket, net_null_ethaddr, PROT_IP);
pkt = (uchar *)NetTxPacket + eth_hdr_size;
set_icmp_header(pkt, net_ping_ip);
diff --git a/net/rarp.c b/net/rarp.c
index 3e1c74cdcc..2f5c104d11 100644
--- a/net/rarp.c
+++ b/net/rarp.c
@@ -46,7 +46,7 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
net_copy_ip(&net_ip, &arp->ar_data[16]);
if (net_server_ip.s_addr == 0)
net_copy_ip(&net_server_ip, &arp->ar_data[6]);
- memcpy(NetServerEther, &arp->ar_data[0], 6);
+ memcpy(net_server_ethaddr, &arp->ar_data[0], 6);
debug_cond(DEBUG_DEV_PKT, "Got good RARP\n");
net_auto_load();
}
@@ -77,7 +77,7 @@ void RarpRequest(void)
printf("RARP broadcast %d\n", ++RarpTry);
pkt = NetTxPacket;
- eth_hdr_size = NetSetEther(pkt, NetBcastAddr, PROT_RARP);
+ eth_hdr_size = NetSetEther(pkt, net_bcast_ethaddr, PROT_RARP);
pkt += eth_hdr_size;
rarp = (struct arp_hdr *)pkt;
@@ -87,10 +87,10 @@ void RarpRequest(void)
rarp->ar_hln = 6;
rarp->ar_pln = 4;
rarp->ar_op = htons(RARPOP_REQUEST);
- memcpy(&rarp->ar_data[0], NetOurEther, 6); /* source ET addr */
+ memcpy(&rarp->ar_data[0], net_ethaddr, 6); /* source ET addr */
memcpy(&rarp->ar_data[6], &net_ip, 4); /* source IP addr */
/* dest ET addr = source ET addr ??*/
- memcpy(&rarp->ar_data[10], NetOurEther, 6);
+ memcpy(&rarp->ar_data[10], net_ethaddr, 6);
/* dest IP addr set to broadcast */
memset(&rarp->ar_data[16], 0xff, 4);
diff --git a/net/sntp.c b/net/sntp.c
index 3e45a8342a..b99aa3ed67 100644
--- a/net/sntp.c
+++ b/net/sntp.c
@@ -37,7 +37,7 @@ SntpSend(void)
SntpOurPort = 10000 + (get_timer(0) % 4096);
sport = NTP_SERVICE_PORT;
- NetSendUDPPacket(NetServerEther, net_ntp_server, sport, SntpOurPort,
+ NetSendUDPPacket(net_server_ethaddr, net_ntp_server, sport, SntpOurPort,
pktlen);
}
@@ -85,7 +85,7 @@ SntpStart(void)
NetSetTimeout(SNTP_TIMEOUT, SntpTimeout);
net_set_udp_handler(sntp_handler);
- memset(NetServerEther, 0, sizeof(NetServerEther));
+ memset(net_server_ethaddr, 0, sizeof(net_server_ethaddr));
SntpSend();
}
diff --git a/net/tftp.c b/net/tftp.c
index bafc35458e..8ddc7be365 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -435,7 +435,7 @@ TftpSend(void)
break;
}
- NetSendUDPPacket(NetServerEther, tftp_remote_ip, TftpRemotePort,
+ NetSendUDPPacket(net_server_ethaddr, tftp_remote_ip, TftpRemotePort,
TftpOurPort, len);
}
@@ -816,7 +816,7 @@ void TftpStart(enum proto_t protocol)
TftpBlock = 0;
/* zero out server ether in case the server ip has changed */
- memset(NetServerEther, 0, 6);
+ memset(net_server_ethaddr, 0, 6);
/* Revert TftpBlkSize to dflt */
TftpBlkSize = TFTP_BLOCK_SIZE;
#ifdef CONFIG_MCAST_TFTP
@@ -861,7 +861,7 @@ TftpStartServer(void)
net_set_udp_handler(tftp_handler);
/* zero out server ether in case the server ip has changed */
- memset(NetServerEther, 0, 6);
+ memset(net_server_ethaddr, 0, 6);
}
#endif /* CONFIG_CMD_TFTPSRV */