summaryrefslogtreecommitdiff
path: root/drivers/net/smc911x.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2009-04-08 13:23:37 +0200
committerBen Warren <biggerbadderben@gmail.com>2009-06-07 21:24:16 -0700
commit2c0234fa79122a5aa77c4e17c33eb2fe184b61a7 (patch)
tree5ab6fba8c2579d760ff67d27b5eef8e902eefd78 /drivers/net/smc911x.c
parent3bc8556f9b24af60dba2b55a0abb1182dff45ecc (diff)
smc911x: write back the manually set MAC address
If the MAX address is given by the environment, write it back to the hardware. Signed-off-by: Daniel Mack <daniel@caiaq.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r--drivers/net/smc911x.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 30f2dc266b..8c9a2a8a05 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -41,8 +41,13 @@ static int smx911x_handle_mac_address(bd_t *bd)
unsigned long addrh, addrl;
uchar m[6];
- /* if the environment has a valid mac address then use it */
- if (!eth_getenv_enetaddr("ethaddr", m)) {
+ if (eth_getenv_enetaddr("ethaddr", m)) {
+ /* if the environment has a valid mac address then use it */
+ addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24);
+ addrh = m[4] | (m[5] << 8);
+ smc911x_set_mac_csr(ADDRL, addrl);
+ smc911x_set_mac_csr(ADDRH, addrh);
+ } else {
/* if not, try to get one from the eeprom */
addrh = smc911x_get_mac_csr(ADDRH);
addrl = smc911x_get_mac_csr(ADDRL);