diff options
author | Markus Klotzbuecher <mk@denx.de> | 2008-08-04 17:18:14 (GMT) |
---|---|---|
committer | Markus Klotzbuecher <mk@denx.de> | 2008-08-04 17:18:14 (GMT) |
commit | 0f2b5d8ec0969a5b0992f5031bf3c61117a41d59 (patch) | |
tree | fc05bf5db93e5a9c1712d24a5efdff94685063c2 /drivers/net | |
parent | ab06bddb04ed4be50a8f9ad5f94fa23953a734e3 (diff) | |
parent | 81091f58f0c58ecd26c5b05de2ae20ca6cdb521c (diff) | |
download | u-boot-0f2b5d8ec0969a5b0992f5031bf3c61117a41d59.tar.xz |
Merge branch 'master' of git://www.denx.de/git/u-boot
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/e1000.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index 060b518..c8b4e98 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -513,9 +513,11 @@ e1000_read_mac_addr(struct eth_device *nic) nic->enetaddr[5] += 1; } #ifdef CONFIG_E1000_FALLBACK_MAC - if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 ) - for ( i=0; i < NODE_ADDRESS_SIZE; i++ ) - nic->enetaddr[i] = (CONFIG_E1000_FALLBACK_MAC >> (8*(5-i))) & 0xff; + if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 ) { + unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC; + + memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE); + } #endif #else /* @@ -531,10 +533,9 @@ e1000_read_mac_addr(struct eth_device *nic) DEBUGFUNC(); s = getenv ("ethaddr"); - if (s == NULL){ + if (s == NULL) { return -E1000_ERR_EEPROM; - } - else{ + } else { for(ii = 0; ii < 6; ii++) { nic->enetaddr[ii] = s ? simple_strtoul (s, &e, 16) : 0; if (s){ |