diff options
author | Wolfgang Denk <wd@denx.de> | 2010-05-04 22:57:37 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2010-05-04 22:57:37 +0200 |
commit | 679ec154620eaf377143ba429124abc91abed0eb (patch) | |
tree | f61ddb23bb663722a42728f641663ff0f9fd857d /net | |
parent | 900a1fe8c8c7acda1d8903af02c2d0d993b770d8 (diff) | |
parent | 4324dc72df5879e5b614c4a3f326884723ede9b7 (diff) | |
download | u-boot-imx-679ec154620eaf377143ba429124abc91abed0eb.zip u-boot-imx-679ec154620eaf377143ba429124abc91abed0eb.tar.gz u-boot-imx-679ec154620eaf377143ba429124abc91abed0eb.tar.bz2 |
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'net')
-rw-r--r-- | net/eth.c | 18 | ||||
-rw-r--r-- | net/net.c | 6 |
2 files changed, 20 insertions, 4 deletions
@@ -1,5 +1,5 @@ /* - * (C) Copyright 2001-2004 + * (C) Copyright 2001-2010 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * * See file CREDITS for list of people who contributed to this @@ -60,6 +60,14 @@ int eth_getenv_enetaddr_by_index(int index, uchar *enetaddr) return eth_getenv_enetaddr(enetvar, enetaddr); } +static int eth_mac_skip(int index) +{ + char enetvar[15]; + char *skip_state; + sprintf(enetvar, index ? "eth%dmacskip" : "ethmacskip", index); + return ((skip_state = getenv(enetvar)) != NULL); +} + #ifdef CONFIG_NET_MULTI /* @@ -173,7 +181,8 @@ int eth_register(struct eth_device* dev) } #endif } else { - for (d=eth_devices; d->next!=eth_devices; d=d->next); + for (d=eth_devices; d->next!=eth_devices; d=d->next) + ; d->next = dev; } @@ -241,6 +250,11 @@ int eth_initialize(bd_t *bis) memcpy(dev->enetaddr, env_enetaddr, 6); } + if (dev->write_hwaddr && + !eth_mac_skip(eth_number) && + is_valid_ether_addr(dev->enetaddr)) { + dev->write_hwaddr(dev); + } eth_number++; dev = dev->next; @@ -1872,11 +1872,13 @@ void copy_filename (char *dst, char *src, int size) #if defined(CONFIG_CMD_NFS) || defined(CONFIG_CMD_SNTP) || defined(CONFIG_CMD_DNS) /* - * make port a little random, but use something trivial to compute + * make port a little random (1024-17407) + * This keeps the math somewhat trivial to compute, and seems to work with + * all supported protocols/clients/servers */ unsigned int random_port(void) { - return 1024 + (get_timer(0) % 0x8000);; + return 1024 + (get_timer(0) % 0x4000); } #endif |