From bef1014b31c5b33052bcaa865ba3618d73e906f0 Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Mon, 4 May 2015 14:55:13 -0500 Subject: 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 Reviewed-by: Simon Glass --- doc/README.enetaddr | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/README.enetaddr') diff --git a/doc/README.enetaddr b/doc/README.enetaddr index 0fafd2cdcd..82c9cd5fe5 100644 --- a/doc/README.enetaddr +++ b/doc/README.enetaddr @@ -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 -- cgit v1.2.3 From 92ac520821405e196c920d60921bdfa5ab6b878c Mon Sep 17 00:00:00 2001 From: Joe Hershberger Date: Mon, 4 May 2015 14:55:14 -0500 Subject: net: Remove all references to CONFIG_ETHADDR and friends We really don't want boards defining fixed MAC addresses in their config so we just remove the option to set it in a fixed way. If you must have a MAC address that was not provisioned, then use the random MAC address functionality. Signed-off-by: Joe Hershberger Reviewed-by: Simon Glass --- doc/README.enetaddr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/README.enetaddr') diff --git a/doc/README.enetaddr b/doc/README.enetaddr index 82c9cd5fe5..50e4899787 100644 --- a/doc/README.enetaddr +++ b/doc/README.enetaddr @@ -15,7 +15,7 @@ Here are the places where MAC addresses might be stored: - board-specific location (eeprom, dedicated flash, ...) Note: only used when mandatory due to hardware design etc... - - environment ("ethaddr", "eth1addr", ...) (see CONFIG_ETHADDR) + - environment ("ethaddr", "eth1addr", ...) Note: this is the preferred way to permanently store MAC addresses - ethernet data (struct eth_device -> enetaddr) -- cgit v1.2.3