1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 08:42:12 +02:00

net: Implement random ethaddr fallback in eth.c

Implement the random ethaddr fallback in eth.c so it is in a common
place and not reimplemented in each board or driver that wants this
behavior.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Joe Hershberger
2015-05-04 14:55:13 -05:00
parent abbfcbe58e
commit bef1014b31
4 changed files with 24 additions and 1 deletions

View File

@@ -37,6 +37,8 @@ Correct flow of setting up the MAC address (summarized):
environment variable will be used unchanged.
If the environment variable is not set, it will be initialized from
eth_device->enetaddr, and a warning will be printed.
If both are invalid and CONFIG_NET_RANDOM_ETHADDR is defined, a random,
locally-assigned MAC is written to eth_device->enetaddr.
4. Program the address into hardware if the following conditions are met:
a) The relevant driver has a 'write_addr' function
b) The user hasn't set an 'ethmacskip' environment variable