summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrafulla Wadaskar <prafulla@marvell.com>2009-08-10 19:43:06 +0530
committerBen Warren <biggerbadderben@gmail.com>2009-08-10 14:58:13 -0700
commit9fd38a01cbc0ce4a8db41f72677103ed04b23db5 (patch)
treeb156f0b28495b6a932576c6d2b71ef0f3f1b4ed5
parentecbd2078a1f56c85b6c56afaaed862bf92ccd3f3 (diff)
downloadu-boot-imx-9fd38a01cbc0ce4a8db41f72677103ed04b23db5.zip
u-boot-imx-9fd38a01cbc0ce4a8db41f72677103ed04b23db5.tar.gz
u-boot-imx-9fd38a01cbc0ce4a8db41f72677103ed04b23db5.tar.bz2
net: kirkwood: updates: used eth_setenv_enetaddr api
eth_setenv_enetaddr is avaible by upper layer using this saves 204 bytes on total image size used Local OUI instead of Marvell OUI for random MAC address generation logic Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
-rw-r--r--drivers/net/kirkwood_egiga.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c
index 701812b..f31fefc 100644
--- a/drivers/net/kirkwood_egiga.c
+++ b/drivers/net/kirkwood_egiga.c
@@ -592,7 +592,7 @@ int kirkwood_egiga_initialize(bd_t * bis)
struct kwgbe_device *dkwgbe;
struct eth_device *dev;
int devnum;
- char *s, buf[NAMESIZE * 2];
+ char *s;
u8 used_ports[MAX_KWGBE_DEVS] = CONFIG_KIRKWOOD_EGIGA_PORTS;
for (devnum = 0; devnum < MAX_KWGBE_DEVS; devnum++) {
@@ -650,11 +650,14 @@ int kirkwood_egiga_initialize(bd_t * bis)
}
while (!eth_getenv_enetaddr(s, dev->enetaddr)) {
- /* Generate Ramdom MAC addresses if not set */
- sprintf(buf, "00:50:43:%02x:%02x:%02x",
- get_random_hex(), get_random_hex(),
- get_random_hex());
- setenv(s, buf);
+ /* Generate Random Private MAC addr if not set */
+ dev->enetaddr[0] = 0x02;
+ dev->enetaddr[1] = 0x50;
+ dev->enetaddr[2] = 0x43;
+ dev->enetaddr[3] = get_random_hex();
+ dev->enetaddr[4] = get_random_hex();
+ dev->enetaddr[5] = get_random_hex();
+ eth_setenv_enetaddr(s, dev->enetaddr);
}
dev->init = (void *)kwgbe_init;