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>
diff --git a/doc/README.enetaddr b/doc/README.enetaddr
index 0fafd2c..82c9cd5 100644
--- a/doc/README.enetaddr
+++ b/doc/README.enetaddr
@@ -37,6 +37,8 @@
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