]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net: cosmetic: Name ethaddr variables consistently
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 8 Apr 2015 06:41:04 +0000 (01:41 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:12:27 +0000 (22:12 +0200)
Use "_ethaddr" at the end of variables and drop CamelCase.
Make constant values actually 'const'.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
72 files changed:
arch/arm/mach-davinci/misc.c
arch/powerpc/cpu/mpc8260/ether_fcc.c
arch/powerpc/cpu/mpc8xx/fec.c
board/BuR/common/common.c
board/ait/cam_enc_4xx/cam_enc_4xx.c
board/alphaproject/ap_sh4a_4a/ap_sh4a_4a.c
board/bct-brettl2/bct-brettl2.c
board/bf518f-ezbrd/bf518f-ezbrd.c
board/bf526-ezbrd/bf526-ezbrd.c
board/bf527-ezkit/bf527-ezkit.c
board/bf537-minotaur/bf537-minotaur.c
board/bf537-pnav/bf537-pnav.c
board/bf537-srv1/bf537-srv1.c
board/bf537-stamp/bf537-stamp.c
board/birdland/bav335x/board.c
board/buffalo/lsxl/lsxl.c
board/cm-bf527/cm-bf527.c
board/cm-bf537e/cm-bf537e.c
board/cm-bf537u/cm-bf537u.c
board/compulab/cm_fx6/cm_fx6.c
board/compulab/cm_t335/cm_t335.c
board/compulab/cm_t35/cm_t35.c
board/compulab/cm_t3517/cm_t3517.c
board/compulab/cm_t54/cm_t54.c
board/davinci/da8xxevm/da850evm.c
board/dnp5370/dnp5370.c
board/gumstix/pepper/board.c
board/ifm/ac14xx/ac14xx.c
board/ip04/ip04.c
board/isee/igep0033/board.c
board/karo/tx28/tx28.c
board/karo/tx48/tx48.c
board/karo/tx51/tx51.c
board/karo/tx53/tx53.c
board/karo/tx6/tx6qdl.c
board/karo/txa5/txa5.c
board/phytec/pcm051/board.c
board/renesas/r0p7734/r0p7734.c
board/siemens/common/factoryset.c
board/siemens/pxm2/board.c
board/silica/pengwyn/board.c
board/tcm-bf518/tcm-bf518.c
board/tcm-bf537/tcm-bf537.c
board/ti/am335x/board.c
board/ti/am43xx/board.c
board/ti/beagle_x15/board.c
board/ti/dra7xx/evm.c
board/ti/ti814x/evm.c
doc/README.enetaddr
drivers/net/cpsw.c
drivers/net/dm9000x.c
drivers/net/e1000.c
drivers/net/fec_mxc.c
drivers/net/ftmac110.c
drivers/net/macb.c
drivers/net/netconsole.c
drivers/usb/eth/smsc95xx.c
drivers/usb/gadget/ether.c
include/net.h
net/arp.c
net/bootme.c
net/bootp.c
net/cdp.c
net/dns.c
net/eth.c
net/link_local.c
net/net.c
net/nfs.c
net/ping.c
net/rarp.c
net/sntp.c
net/tftp.c

index e18bdfc729b7ad3ae0b57a01f3b1f76edfd033cb..e699d61874976c1ead937e1e26fb2351c2e1158f 100644 (file)
@@ -49,7 +49,7 @@ int dvevm_read_mac_address(uint8_t *buf)
                goto i2cerr;
 
        /* Check that MAC address is valid. */
                goto i2cerr;
 
        /* Check that MAC address is valid. */
-       if (!is_valid_ether_addr(buf))
+       if (!is_valid_ethaddr(buf))
                goto err;
 
        return 1; /* Found */
                goto err;
 
        return 1; /* Found */
index f777ba14cc6aefd5589671946bbc438457a4f96b..240e7aedf3a1fbd2ff748130828f15c5654a2367 100644 (file)
@@ -637,7 +637,7 @@ eth_loopback_test (void)
 
        puts ("FCC Ethernet External loopback test\n");
 
 
        puts ("FCC Ethernet External loopback test\n");
 
-       eth_getenv_enetaddr("ethaddr", NetOurEther);
+       eth_getenv_enetaddr("ethaddr", net_ethaddr);
 
        /*
         * global initialisations for all FCC channels
 
        /*
         * 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);
                                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;
 
                }
                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
                 */
                 * 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 */
                /*
 
                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, \
                                                        &ecp->rxbufs[i][0];
 
                                                ours = memcmp (ehp->et_src, \
-                                                       NetOurEther, 6);
+                                                       net_ethaddr, 6);
 
                                                prot = swap16 (ehp->et_protlen);
                                                tb = prot & 0x8000;
 
                                                prot = swap16 (ehp->et_protlen);
                                                tb = prot & 0x8000;
index 22b8ec752bc3bc0d8c22b288016a3faf96d83642..454e77af992cf9e5083e3e5f773a82419346e3aa 100644 (file)
@@ -252,9 +252,9 @@ static int fec_recv (struct eth_device *dev)
                        length -= 4;
 
 #if defined(CONFIG_CMD_CDP)
                        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
                        /*
                                rx = NULL;
 #endif
                        /*
index ccaa9c6845053dcc2e72a91e4b45f76c879c105c..13f23fd7cec2c9c1da25f0c9c0ae0ec23760eacc 100644 (file)
@@ -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);
 
        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;
                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 ... ");
                #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;
                }
 
                                mac = (const char *)mac_addr;
                }
 
index 290dc1984ab3a9508e2dc3a2b6c0e393838691c3..c5687bab7dd8f9bbe5fc4b03615d3ec4647106e9 100644 (file)
@@ -70,7 +70,7 @@ static int cam_enc_4xx_check_network(void)
        if (!s)
                return -EINVAL;
 
        if (!s)
                return -EINVAL;
 
-       if (!is_valid_ether_addr((const u8 *)s))
+       if (!is_valid_ethaddr((const u8 *)s))
                return -EINVAL;
 
        s = getenv("ipaddr");
                return -EINVAL;
 
        s = getenv("ipaddr");
index b81a68d63d19d0c970602183732e14f24499192c..e65befc3ba0405d4fb5625d07927a3aba92b868f 100644 (file)
@@ -167,7 +167,7 @@ int board_late_init(void)
        /* Read MAC address */
        i2c_read(0x50, 0x0, 0, mac, 6);
 
        /* 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;
                eth_setenv_enetaddr("ethaddr", mac);
 
        return 0;
index 6be9b180159e53a815087c937acfa00f393b6f8e..1f0dfb4d403e6dc97194ff4ad3f97fb49d89885a 100644 (file)
@@ -32,7 +32,7 @@ int checkboard(void)
 static void board_init_enetaddr(uchar *mac_addr)
 {
        puts("Warning: Generating 'random' MAC address\n");
 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);
 }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
 }
 
index 3a94a572eb24f6f2909808e44ab03b93a7b8136e..8ecfbb28c9a98466ffdad9a7b23318a5f9b852ff 100644 (file)
@@ -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 (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;
                }
                        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");
 
        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index 368d6be25fb7193dbbbc6e33fd9c66c23b883947..0a88491e902f8ffcfc360e7ca77931efc7e8e864 100644 (file)
@@ -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 (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;
                }
                        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");
 
        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index 88e18690e031aec12ef451a0f352972113844e12..257775f3c87e9ff01b58fbd9dc9b25781c5a6a0b 100644 (file)
@@ -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];
 
                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");
                        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index ca61ef97b860768065ac6ecf8a50621ea148b8bf..71b4293ad62240474036224fbb6df9bbc9acc385 100644 (file)
@@ -26,7 +26,7 @@ int checkboard(void)
 static void board_init_enetaddr(uchar *mac_addr)
 {
        puts("Warning: Generating 'random' MAC address\n");
 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);
 }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
 }
 
index df0011026a63a52926cf826a5dff33a4602adc82..93522df56c35542b79a6dff1bc09821f03c95603 100644 (file)
@@ -26,7 +26,7 @@ int checkboard(void)
 static void board_init_enetaddr(uchar *mac_addr)
 {
        puts("Warning: Generating 'random' MAC address\n");
 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);
 }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
 }
 
index 725296a41636c6524570f4b378fa3bbd7d96b2d4..6581028294fc743775a0a872abf71eab6ced1a3b 100644 (file)
@@ -26,7 +26,7 @@ int checkboard(void)
 static void board_init_enetaddr(uchar *mac_addr)
 {
        puts("Warning: Generating 'random' MAC address\n");
 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);
 }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
 }
 
index 32045a9e47cb44651062a9041a6038d4a5c4aaca..66e54925daefa66d53d519b1c79d5364f6231502 100644 (file)
@@ -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 (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;
                }
                        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");
 
        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index d1e1c8cbd399bbff69bae9c4c617335dca783b7a..32ff7a4f9ea80058a92d5a92ec6dcc12b8a0eba7 100644 (file)
@@ -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) &&
        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);
        }
 
                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 (!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);
        }
 
                        eth_setenv_enetaddr("ethaddr", mac_addr);
        }
 
index b0d49c4ee6b8ac266588d63c81b8ef3094097346..487875c23a15e96f1d4e18d15ec05021e5cd68f3 100644 (file)
@@ -232,7 +232,7 @@ static void rescue_mode(void)
        printf("Entering rescue mode..\n");
 #ifdef CONFIG_RANDOM_MACADDR
        if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
        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);
                if (eth_setenv_enetaddr("ethaddr", enetaddr)) {
                        printf("Failed to set ethernet address\n");
                                set_led(LED_ALARM_BLINKING);
index 1533eb9c7a878378b7b4576726d1f178ce13b385..2871fa2d6a7307ac10c16b8aa61cad810b641d4a 100644 (file)
@@ -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];
 
                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");
                        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index e79f90f95bceeee4177f4f57436405da50a79653..902611ec016aa25e7d89b4eea6aa542666d9aff2 100644 (file)
@@ -31,7 +31,7 @@ static void board_init_enetaddr(char *var)
                return;
 
        printf("Warning: %s: generating 'random' MAC address\n", var);
                return;
 
        printf("Warning: %s: generating 'random' MAC address\n", var);
-       eth_random_addr(enetaddr);
+       net_random_ethaddr(enetaddr);
        eth_setenv_enetaddr(var, enetaddr);
 }
 
        eth_setenv_enetaddr(var, enetaddr);
 }
 
index 632cbda5c06f3c6706591dd5dc991df3cc1433ca..69bffd76de892765c7e7c1d8eff43af3ebfbc6fd 100644 (file)
@@ -31,7 +31,7 @@ static void board_init_enetaddr(char *var)
                return;
 
        printf("Warning: %s: generating 'random' MAC address\n", var);
                return;
 
        printf("Warning: %s: generating 'random' MAC address\n", var);
-       eth_random_addr(enetaddr);
+       net_random_ethaddr(enetaddr);
        eth_setenv_enetaddr(var, enetaddr);
 }
 
        eth_setenv_enetaddr(var, enetaddr);
 }
 
index ae6945ba9c9ca2b7f5f86f7f61bee3f310634eb0..7a1bbafaa5565c0a5a3e6f9ff1a3979dde762116 100644 (file)
@@ -425,7 +425,7 @@ static int handle_mac_address(char *env_var, uint eeprom_bus)
        if (rc)
                return rc;
 
        if (rc)
                return rc;
 
-       if (!is_valid_ether_addr(enetaddr))
+       if (!is_valid_ethaddr(enetaddr))
                return -1;
 
        return eth_setenv_enetaddr(env_var, enetaddr);
                return -1;
 
        return eth_setenv_enetaddr(env_var, enetaddr);
index 592ef3d30fcd01f4bc0c3241b418095e2d1fc2ea..428aee6d242ff707c1fdc2db2e793ed46967cb4f 100644 (file)
@@ -114,7 +114,7 @@ static int handle_mac_address(void)
        if (rv)
                get_efuse_mac_addr(enetaddr);
 
        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);
                return -1;
 
        return eth_setenv_enetaddr("ethaddr", enetaddr);
index c4ea8ea875f533f21a4d0bec13bf8795026658b9..374edbcffc6a990462cc69bc29505eb59ef45df9 100644 (file)
@@ -441,7 +441,7 @@ static int handle_mac_address(void)
        if (rc)
                return rc;
 
        if (rc)
                return rc;
 
-       if (!is_valid_ether_addr(enetaddr))
+       if (!is_valid_ethaddr(enetaddr))
                return -1;
 
        return eth_setenv_enetaddr("ethaddr", enetaddr);
                return -1;
 
        return eth_setenv_enetaddr("ethaddr", enetaddr);
index 624cf4c03463f472b2a3b164cec1c92c0f20c63c..03b2badd02882edbe59c9aebfd932c4de8a96f47 100644 (file)
@@ -132,7 +132,7 @@ static int am3517_get_efuse_enetaddr(u8 *enetaddr)
        enetaddr[4] = (u8)((lsb >> 8)  & 0xff);
        enetaddr[5] = (u8)(lsb & 0xff);
 
        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)
 }
 
 static inline int cm_t3517_init_emac(bd_t *bis)
@@ -170,7 +170,7 @@ static int cm_t3517_handle_mac_address(void)
                        return ret;
        }
 
                        return ret;
        }
 
-       if (!is_valid_ether_addr(enetaddr))
+       if (!is_valid_ethaddr(enetaddr))
                return -1;
 
        return eth_setenv_enetaddr("ethaddr", enetaddr);
                return -1;
 
        return eth_setenv_enetaddr("ethaddr", enetaddr);
index fdea909ff74a0109ac42282c11a1130e468033d8..fad05514989d344ad55789540f932f2dc6e4b7bf 100644 (file)
@@ -166,10 +166,10 @@ static int handle_mac_address(void)
                return 0;
 
        ret = cl_eeprom_read_mac_addr(enetaddr, CONFIG_SYS_I2C_EEPROM_BUS);
                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);
 
                generate_mac_addr(enetaddr);
 
-       if (!is_valid_ether_addr(enetaddr))
+       if (!is_valid_ethaddr(enetaddr))
                return -1;
 
        return eth_setenv_enetaddr("usbethaddr", enetaddr);
                return -1;
 
        return eth_setenv_enetaddr("usbethaddr", enetaddr);
index b9ca38e9293dd8b2e0c1fbe244833691cc2cc09f..b82385a9182ef0f9bc175637cd9a8714570a06c9 100644 (file)
@@ -145,7 +145,7 @@ int misc_init_r(void)
         */
        if (!enetaddr_found) {
                if (!spi_mac_read) {
         */
        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");
                                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
                 */
                 * 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");
                        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");
index df721c9944aa8d8a871685c490c1c9b0634df3fb..655fcace2b8f0e9e1a6db89590b60824de028c05 100644 (file)
@@ -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 (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;
                }
                        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");
 
        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index f644f8188bc9d9b948716da68a8fcfefc44bcb5a..beb2fac374594fe0d32fb03bf97ce2376affaf39 100644 (file)
@@ -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;
                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);
        }
 
                        eth_setenv_enetaddr("ethaddr", mac_addr);
        }
 
index 5d2ab2fad3ca0218261c3987d9d09f795accf5bc..72932ca69f92788e4dafd1134409ded4f56087cf 100644 (file)
@@ -225,7 +225,7 @@ int mac_read_from_eeprom(void)
                break;
        }
 
                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");
                eth_setenv_enetaddr("ethaddr", mac);
                if (mac_diag) {
                        mac_txt = getenv("ethaddr");
index ae526334267bdaff8b3b97413640ca31dee70944..d20500f4df53aed084f47b7a539e22a90d18669f 100644 (file)
@@ -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");
        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);
        }
 
                eth_setenv_enetaddr("ethaddr", enetaddr);
        }
 
index 9f8fcf2c1cfcc29eaede937af3f4690bb8c7c8c7..5fea7ffaef15508464b33d1646c3a3af2565694c 100644 (file)
@@ -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;
                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);
        }
 
                        eth_setenv_enetaddr("ethaddr", mac_addr);
        }
 
index 2e7ec77a1057fa15228f3d1afbdf5259eb499d82..9a60d2939d7b607647bcf91b84249fa75e609fea 100644 (file)
@@ -241,7 +241,7 @@ static int fec_get_mac_addr(int index)
                        val = readl(&cust[index * 8 + i]);
                mac[i] = val >> shift;
        }
                        val = readl(&cust[index * 8 + i]);
                mac[i] = val >> shift;
        }
-       if (!is_valid_ether_addr(mac)) {
+       if (!is_valid_ethaddr(mac)) {
                if (index == 0)
                        printf("No valid MAC address programmed\n");
                return 0;
                if (index == 0)
                        printf("No valid MAC address programmed\n");
                return 0;
index da17a32f54c4dd1d0dea5f6edf2e8fd46bc5f971..95a98a92362a7528805bcc14fc752a29705b2065 100644 (file)
@@ -954,7 +954,7 @@ static void tx48_init_mac(void)
        mac_addr[4] = mac_lo & 0xFF;
        mac_addr[5] = (mac_lo & 0xFF00) >> 8;
 
        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("No valid MAC address programmed\n");
                return;
        }
                printf("No valid MAC address programmed\n");
                return;
        }
index 6bb463243ac89598475a3baba80e31f02ed45b6d..dc8204d1c0b4887b9cc9a655258da5d4cd8e746b 100644 (file)
@@ -1034,7 +1034,7 @@ static void tx51_init_mac(void)
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(0, mac);
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(0, mac);
-       if (!is_valid_ether_addr(mac)) {
+       if (!is_valid_ethaddr(mac)) {
                printf("No valid MAC address programmed\n");
                return;
        }
                printf("No valid MAC address programmed\n");
                return;
        }
index 299a647b1690588f0a55965eaab76ad9122cf6c1..8d0c647785bfde3eaa5921a74a9922aac9432285 100644 (file)
@@ -1321,7 +1321,7 @@ static void tx53_init_mac(void)
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(0, mac);
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(0, mac);
-       if (!is_valid_ether_addr(mac)) {
+       if (!is_valid_ethaddr(mac)) {
                printf("No valid MAC address programmed\n");
                return;
        }
                printf("No valid MAC address programmed\n");
                return;
        }
index 1d09de4ac675bb30f50cad15a0555780452bdef9..1a5026dc5172509af30578d447f23c58005e7eff 100644 (file)
@@ -625,7 +625,7 @@ static void tx6_init_mac(void)
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(-1, mac);
        u8 mac[ETH_ALEN];
 
        imx_get_mac_from_fuse(-1, mac);
-       if (!is_valid_ether_addr(mac)) {
+       if (!is_valid_ethaddr(mac)) {
                printf("No valid MAC address programmed\n");
                return;
        }
                printf("No valid MAC address programmed\n");
                return;
        }
index ce40c1cc28e073532960c7a49dc8b77a7fdeb49e..dd5ba89529e727c4e3189b6d9e1ee78a6212098e 100644 (file)
@@ -272,7 +272,7 @@ static void txa5_init_mac(void)
        mac_addr[4] = mac_lo & 0xFF;
        mac_addr[5] = (mac_lo >> 8) & 0xFF;
 
        mac_addr[4] = mac_lo & 0xFF;
        mac_addr[5] = (mac_lo >> 8) & 0xFF;
 
-       if (!is_valid_ether_addr(mac_addr)) {
+       if (!is_valid_ethaddr(mac_addr)) {
                printf("No valid MAC address programmed\n");
                return;
        }
                printf("No valid MAC address programmed\n");
                return;
        }
index 1071662ea9e2220fdcbf439dc7673b4caaa5b658..1bf9d730e5b4eb4f50a5e946c2541b4a7455922c 100644 (file)
@@ -228,7 +228,7 @@ int board_eth_init(bd_t *bis)
                mac_addr[4] = mac_lo & 0xFF;
                mac_addr[5] = (mac_lo & 0xFF00) >> 8;
 
                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;
                        eth_setenv_enetaddr("ethaddr", mac_addr);
                else
                        goto try_usbether;
index 5687ad476625a22d7086a210aaff23e8c8503e5d..2e31ba673162dcf15a39f1179207465626042b87 100644 (file)
@@ -55,7 +55,7 @@ int board_late_init(void)
        /* Read MAC address */
        i2c_read(0x50, 0x10, 0, mac, 6);
 
        /* 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;
                eth_setenv_enetaddr("ethaddr", mac);
 
        return 0;
index 7baac3dda6da55777e01b5413d593c11a7cc7628..d81f5481a7cfd022ff55b0275eeda53c176d2ecf 100644 (file)
@@ -271,7 +271,7 @@ static int factoryset_mac_setenv(void)
        uint8_t mac_addr[6];
 
        debug("FactorySet: Set mac address\n");
        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;
                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;
                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;
                }
                        printf("Warning: ethaddr not set by FactorySet or E-fuse. Set <ethaddr> variable to overcome this.\n");
                        return -1;
                }
index 264ba025b70987779a1ed8774fbe7b609f87d507..4d8ba3cd800c83a24d6bc00d194fd7cb2b91fa5a 100644 (file)
@@ -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;
        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);
                printf("Error: no valid mac address\n");
        else
                eth_setenv_enetaddr("ethaddr", factory_dat.mac);
index ee88b6f39908641b6c403e7c0cdbcb82c7e0e897..815c9a7d15cd2fe3547e3d2a023721ab01f0aa2c 100644 (file)
@@ -189,7 +189,7 @@ int board_eth_init(bd_t *bis)
                mac_addr[4] = mac_lo & 0xFF;
                mac_addr[5] = (mac_lo & 0xFF00) >> 8;
 
                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;
                        eth_setenv_enetaddr("ethaddr", mac_addr);
                else
                        return n;
index 5d25fcd0a913629c48eb0723fbb7f31f98b26b32..3fa7d972eafa25b1d3094ec96217e6d782a85e39 100644 (file)
@@ -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];
 
                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");
                        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);
        }
 
        eth_setenv_enetaddr("ethaddr", mac_addr);
index a4f0f7121b19d58dc758475b738c241795e44e45..2531a4433640d70a6df73179f5a069fd4af90b58 100644 (file)
@@ -31,7 +31,7 @@ static void board_init_enetaddr(char *var)
                return;
 
        printf("Warning: %s: generating 'random' MAC address\n", var);
                return;
 
        printf("Warning: %s: generating 'random' MAC address\n", var);
-       eth_random_addr(enetaddr);
+       net_random_ethaddr(enetaddr);
        eth_setenv_enetaddr(var, enetaddr);
 }
 
        eth_setenv_enetaddr(var, enetaddr);
 }
 
index 0739e6021a21e71d7d0f5c840b793ce7fdf98fae..96245a3306a5683e4a6f98e1fa7a15701d58428f 100644 (file)
@@ -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 (!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);
        }
 
                        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")) {
        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);
        }
 
                        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))
 #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);
                eth_setenv_enetaddr("usbnet_devaddr", mac_addr);
 
        rv = usb_eth_initialize(bis);
index ddf4c5fc13db9a8afd780a529a2eb81ffe264d18..4aae2306086bda50724e227543857d9837768648 100644 (file)
@@ -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 (!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);
        }
 
                        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")) {
        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);
        }
 
                        eth_setenv_enetaddr("eth1addr", mac_addr);
        }
 
index ac0d22c9ed6f612291fb31b08909645e7b55666f..ffcd53185bf270d0faeb133f9c83054231254379 100644 (file)
@@ -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 (!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);
        }
 
                        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")) {
        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);
        }
 
                        eth_setenv_enetaddr("eth1addr", mac_addr);
        }
 
index 3089fa23342cb20c22f7bb033336ebbedfea3509..c1019289ba9dce27279c1cda8a63621733555a3d 100644 (file)
@@ -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 (!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);
        }
 
                        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")) {
        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);
        }
 
                        eth_setenv_enetaddr("eth1addr", mac_addr);
        }
 
index 54b3dfb82c5487e8e4634c2271bcd176612afefa..e406dabfc0d8c53f921bc199fd84f096992ad8a7 100644 (file)
@@ -178,7 +178,7 @@ int board_eth_init(bd_t *bis)
                mac_addr[4] = mac_lo & 0xFF;
                mac_addr[5] = (mac_lo & 0xFF00) >> 8;
 
                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");
                        eth_setenv_enetaddr("ethaddr", mac_addr);
                else
                        printf("Unable to read MAC address. Set <ethaddr>\n");
index 1eaeaf9416efb5c76a81a202390f4bf110b11adc..0fafd2cdcd5f575796c69fc3fe97c085d4a666b4 100644 (file)
@@ -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,
 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)) {
 to determine address validity.
 uchar enetaddr[6];
 if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
index 725108d0ea392f15f7e09c178093a9eb6eb9db91..36bfaa965d3a56daae766ae76dffb4d61afa4cc8 100644 (file)
@@ -304,7 +304,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);
 }
 
                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;
 
 {
        int i;
 
@@ -336,7 +336,7 @@ static int cpsw_ale_write(struct cpsw_priv *priv, int idx, u32 *ale_entry)
        return idx;
 }
 
        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;
 {
        u32 ale_entry[ALE_ENTRY_WORDS];
        int type, idx;
@@ -389,7 +389,7 @@ static int cpsw_ale_find_ageable(struct cpsw_priv *priv)
        return -ENOENT;
 }
 
        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};
                              int port, int flags)
 {
        u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
@@ -414,7 +414,8 @@ static int cpsw_ale_add_ucast(struct cpsw_priv *priv, u8 *addr,
        return 0;
 }
 
        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;
 {
        u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
        int idx, mask;
@@ -676,7 +677,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);
 
        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;
 }
 
        priv->phy_mask |= 1 << slave->data->phy_addr;
 }
@@ -833,7 +834,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_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);
 
        for_active_slave(slave, priv)
                cpsw_slave_init(slave, priv);
index 4de9d41642e8474d266cd3636655c8f50064980f..d1c6f4ca2e0663a9e69213ed73cba8d7009a3d3f 100644 (file)
@@ -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);
        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");
 #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");
                printf("MAC: %pM\n", dev->enetaddr);
 #else
                printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
index cd4422215fb0fbbd43c4aefb09e0f0652df01867..6a2e0d2928363767199f4bcd444b3327f3e1698a 100644 (file)
@@ -1197,7 +1197,7 @@ e1000_read_mac_addr(struct eth_device *nic)
                nic->enetaddr[5] ^= 1;
 
 #ifdef CONFIG_E1000_FALLBACK_MAC
                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);
                unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
 
                memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);
index 7e732d4df487ea39bd984f9908d42504b539e2d1..6fb0486e893b34fe8979e48b8bdfa516303261fb 100644 (file)
@@ -361,7 +361,7 @@ static int fec_get_hwaddr(struct eth_device *dev, int dev_id,
                                                unsigned char *mac)
 {
        imx_get_mac_from_fuse(dev_id, mac);
                                                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)
 }
 
 static int fec_set_hwaddr(struct eth_device *dev)
index 98c4f09629bdcd4fc5380822ededcb4a9152e1bd..aef89a299e564b2b9189aa6a1d4ec87ce684260d 100644 (file)
@@ -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))
        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(
 
        /* allocate tx descriptors (it must be 16 bytes aligned) */
        chip->txd = dma_alloc_coherent(
index f6d388a29f5d370c36ab6a68983912c4fd170eef..d535897f684c1fa8c03cff2a967abbe4863b47d8 100644 (file)
@@ -606,7 +606,7 @@ static int macb_init(struct eth_device *netdev, bd_t *bd)
        }
 
        /* update the ethaddr */
        }
 
        /* 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);
                macb_write_hwaddr(netdev);
        } else {
                printf("%s: mac address is not valid\n", netdev->name);
index 55f383f13391b51bfcceee65a1fe469aff5eb4da..0d81b441b70e2f88fc4c6e616dfb3ed7fbf66e08 100644 (file)
@@ -117,7 +117,7 @@ static int refresh_settings_from_env(void)
 void NcStart(void)
 {
        refresh_settings_from_env();
 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);
                /* 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 (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;
                if (eth->state == ETH_STATE_ACTIVE)
                        return; /* inside net loop */
                output_packet = buf;
index 6bca34dcf57df80387514f5c0842a0086a380542..78b469ffa0918b8fe07b907064780b104359937d 100644 (file)
@@ -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) {
        /* 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;
                        /* eeprom values are valid so use them */
                        debug("MAC address read from EEPROM\n");
                        return 0;
index 7e3b3ed859560ecc27ec8a373431a400ce63eddf..516e356df4b9128115de047b8000b39293c46d7c 100644 (file)
@@ -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 (!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
                         */
                        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;
                                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. */
                }
 
                /* Now check the contents. */
-               return is_valid_ether_addr(ea);
+               return is_valid_ethaddr(ea);
        }
        return 0;
 }
        }
        return 0;
 }
@@ -1971,7 +1971,7 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
                        num |= (nibble(*str++));
                        dev_addr[i] = num;
                }
                        num |= (nibble(*str++));
                        dev_addr[i] = num;
                }
-               if (is_valid_ether_addr(dev_addr))
+               if (is_valid_ethaddr(dev_addr))
                        return 0;
        }
        return 1;
                        return 0;
        }
        return 1;
index 0962aa40d0fcdf235d1020750c7d5862f2da4be6..19718c5bf4d7017b916c28c415efdeb48ed63ca5 100644 (file)
@@ -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 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 */
 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           *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 */
 
 #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
  */
 /*
  * 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
 
 }
 #endif
 
@@ -559,7 +559,7 @@ int NetStartAgain(void);
 int    NetEthHdrSize(void);
 
 /* Set ethernet header; returns the size of the header */
 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 */
 int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot);
 
 /* Set IP header */
@@ -725,42 +725,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.
  */
  * @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]);
 }
 
 /**
 {
        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.
  */
  * @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];
 }
 
 /*
 {
        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.
  */
  * @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;
 }
 
 /*
 {
        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
  * @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
@@ -768,21 +768,21 @@ static inline int is_broadcast_ether_addr(const u8 *addr)
  *
  * Return true if the address is valid.
  */
  *
  * 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. */
 {
        /* 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.
  */
  * @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);
 {
        int i;
        unsigned int seed = get_timer(0);
index 4971a53612f2fdb0f42f915eb8b8ee070aac59f1..c613609b2d0162e3745ca6e57ce86dcaab3436d3 100644 (file)
--- 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;
 
 
        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;
        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);
 
        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 */
        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;
        }
 
                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)
 }
 
 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);
                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
                net_copy_ip(&arp->ar_spa, &net_ip);
 
 #ifdef CONFIG_CMD_LINK_LOCAL
index 7ac7c3932a4aeefe806790c0a6cc7312caeb5376..f56f7acd79f2b578d56e1a49ee9e8ed437db15da 100644 (file)
@@ -251,7 +251,7 @@ void BootmeStart(void)
                check_net_config();
 
        if (output_packet_len == 0 ||
                check_net_config();
 
        if (output_packet_len == 0 ||
-               is_valid_ether_addr(bootme_ether)) {
+               is_valid_ethaddr(bootme_ether)) {
                /* wait for incoming packet */
                net_set_udp_handler(bootme_handler);
                bootme_timed_out = 0;
                /* wait for incoming packet */
                net_set_udp_handler(bootme_handler);
                bootme_timed_out = 0;
index edb242e547ef81bcc25dd94bbbde1bd383f43bfe..0e0c19923a23c87df81834e9e46022b1e78bd53c 100644 (file)
@@ -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);
        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));
        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);
 
        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;
 
        /*
        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);
        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 */
        copy_filename(bp->bp_file, net_boot_file_name, sizeof(bp->bp_file));
 
        /* Request additional information from the BOOTP/DHCP server */
@@ -737,14 +738,14 @@ BootpRequest(void)
 #ifdef CONFIG_BOOTP_RANDOM_ID
        BootpID = rand();
 #else
 #ifdef CONFIG_BOOTP_RANDOM_ID
        BootpID = rand();
 #else
-       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);
        BootpID += get_timer(0);
        BootpID = htonl(BootpID);
-       bootp_add_id(BootpID);
 #endif
 #endif
+       bootp_add_id(BootpID);
        NetCopyLong(&bp->bp_id, &BootpID);
 
        /*
        NetCopyLong(&bp->bp_id, &BootpID);
 
        /*
@@ -900,7 +901,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer)
        pkt = NetTxPacket;
        memset((void *)pkt, 0, PKTSIZE);
 
        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 */
        pkt += eth_hdr_size;
 
        iphdr = pkt;    /* We'll need this later to set proper pkt size */
@@ -922,7 +923,7 @@ static void DhcpSendRequestPkt(struct Bootp_t *bp_offer)
        zero_ip.s_addr = 0;
        net_write_ip(&bp->bp_giaddr, zero_ip);
 
        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
 
        /*
         * ID is the id of the OFFER packet
index 2d8fa03a7e306d0b549a59ab8e25689496dcc1ac..e8e7a67010b181eef59dc45165c82807360ebcb0 100644 (file)
--- a/net/cdp.c
+++ b/net/cdp.c
@@ -18,7 +18,7 @@
 #include "cdp.h"
 
 /* Ethernet bcast address */
 #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
 
 #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 */
        /* 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;
 
 
        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);
 #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
        memcpy((uchar *)s, buf, 16);
        s += 16 / 2;
 #endif
index 6f8b1f2596cdbd1bf858be5acbdb4870400438f7..0ff2b75ecc306cd1bc72fc75a61b7772b657bfa3 100644 (file)
--- a/net/dns.c
+++ b/net/dns.c
@@ -89,7 +89,7 @@ DnsSend(void)
 
        DnsOurPort = random_port();
 
 
        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");
 }
                         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. */
        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();
 }
 
        DnsSend();
 }
index f06fdb27439ce2903ca9fb4f25c74b7d9aea7d69..3f5cb7ec991d409b6098e01a768e37a389564dd6 100644 (file)
--- 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);
 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)
 }
 
 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)) {
 
        /* 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;
                        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);
                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);
                    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);
 
                /* 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);
                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;
                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);
 
 
        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);
                    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);
                }
 
                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);
                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)) {
                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;
                        printf("\nError: %s address %pM illegal value\n",
                                 dev->name, dev->enetaddr);
                        return -EINVAL;
index 6d92c555fb0fa96f5a2409e11277de9ceb220660..2bca7de12ab4274fede6faf57b8c609e58d7b3ca 100644 (file)
@@ -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);
                        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 {
                        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);
                        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;
                        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);
                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:
                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);
                        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 */
                        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;
 
        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;
                source_ip_conflict = 1;
-       }
 
        /*
         * According to RFC 3927, section 2.2.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 &&
        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;
        }
 
                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;
                        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:
                }
                break;
        case DEFEND:
index b1461d515388847a1a259fbcca315bdb41ccaa3f..738d0fe0b19d276ca5efb0b8331d9b83b1071b1a 100644 (file)
--- 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 */
 /** END OF BOOTP EXTENTIONS **/
 
 /* Our ethernet address */
-uchar          NetOurEther[6];
+u8 net_ethaddr[6];
 /* Boot server enet address */
 /* 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) */
 /* 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 */
 /* 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
 #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())
                env_changed_id = env_id;
        }
        if (eth_get_dev())
-               memcpy(NetOurEther, eth_get_ethaddr(), 6);
+               memcpy(net_ethaddr, eth_get_ethaddr(), 6);
 
        return;
 }
 
        return;
 }
@@ -734,7 +734,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)
 
        /* 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;
 
 
        pkt = (uchar *)NetTxPacket;
 
@@ -744,7 +744,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 */
        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 */
                debug_cond(DEBUG_DEV_PKT, "sending ARP for %pI4\n", &dest);
 
                /* save the ip and eth addr for the packet to send after arp */
@@ -1285,7 +1285,7 @@ common:
        case CDP:
        case DHCP:
        case LINKLOCAL:
        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) {
                        int num = eth_get_dev_index();
 
                        switch (num) {
@@ -1326,7 +1326,7 @@ NetEthHdrSize(void)
 }
 
 int
 }
 
 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;
 {
        struct ethernet_hdr *et = (struct ethernet_hdr *)xet;
        ushort myvlanid;
@@ -1335,8 +1335,8 @@ NetSetEther(uchar *xet, uchar * addr, uint prot)
        if (myvlanid == (ushort)-1)
                myvlanid = VLAN_NONE;
 
        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;
        if ((myvlanid & VLAN_IDMASK) == VLAN_NONE) {
                et->et_protlen = htons(prot);
                return ETHER_HDR_SIZE;
@@ -1356,7 +1356,7 @@ int net_update_ether(struct ethernet_hdr *et, uchar *addr, uint prot)
        ushort protlen;
 
        memcpy(et->et_dest, addr, 6);
        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 =
        protlen = ntohs(et->et_protlen);
        if (protlen == PROT_VLAN) {
                struct vlan_ethernet_hdr *vet =
index 1e5c1c350ad25ffc7948d66a505d0f4026734293..23a9cc340e2b4859768a6b3f74c4981f1b80b92d 100644 (file)
--- 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;
 
        else
                sport = NfsSrvNfsPort;
 
-       NetSendUDPPacket(NetServerEther, nfs_server_ip, sport, NfsOurPort,
+       NetSendUDPPacket(net_server_ethaddr, nfs_server_ip, sport, NfsOurPort,
                         pktlen);
 }
 
                         pktlen);
 }
 
@@ -788,7 +788,7 @@ NfsStart(void)
        NfsOurPort = 1000;
 
        /* zero out server ether in case the server ip has changed */
        NfsOurPort = 1000;
 
        /* zero out server ether in case the server ip has changed */
-       memset(NetServerEther, 0, 6);
+       memset(net_server_ethaddr, 0, 6);
 
        NfsSend();
 }
 
        NfsSend();
 }
index 4918a1cb36d3e2ebc7c888545ee9c0fc3d6c5c98..e4e3086e19a19f050d82eb7802f4af65865b5296 100644 (file)
@@ -50,7 +50,7 @@ static int ping_send(void)
 
        net_arp_wait_packet_ip = net_ping_ip;
 
 
        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);
        pkt = (uchar *)NetTxPacket + eth_hdr_size;
 
        set_icmp_header(pkt, net_ping_ip);
index 3e1c74cdcc5ee90a433fe9858529e2e7e8849b16..2f5c104d114a832a1ed2d156ef6f7c1c0ff57029 100644 (file)
@@ -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]);
                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();
        }
                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;
 
        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;
        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);
        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[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);
 
        /* dest IP addr set to broadcast */
        memset(&rarp->ar_data[16], 0xff,        4);
 
index 3e45a8342a36ba8e259607e701bc9870a86d6bdd..b99aa3ed676de69df29d32d9409a36f270b47b92 100644 (file)
@@ -37,7 +37,7 @@ SntpSend(void)
        SntpOurPort = 10000 + (get_timer(0) % 4096);
        sport = NTP_SERVICE_PORT;
 
        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);
 }
 
                         pktlen);
 }
 
@@ -85,7 +85,7 @@ SntpStart(void)
 
        NetSetTimeout(SNTP_TIMEOUT, SntpTimeout);
        net_set_udp_handler(sntp_handler);
 
        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();
 }
 
        SntpSend();
 }
index bafc35458ef876697e0bbe267b94500c00ca7c76..8ddc7be3653e51c10049e5a698ac995fc6fb6cae 100644 (file)
@@ -435,7 +435,7 @@ TftpSend(void)
                break;
        }
 
                break;
        }
 
-       NetSendUDPPacket(NetServerEther, tftp_remote_ip, TftpRemotePort,
+       NetSendUDPPacket(net_server_ethaddr, tftp_remote_ip, TftpRemotePort,
                         TftpOurPort, len);
 }
 
                         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 */
        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
        /* 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 */
        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 */
 
 }
 #endif /* CONFIG_CMD_TFTPSRV */