
On Monday 05 December 2011 19:04:33 Rob Herring wrote:
The env variable "ethaddr" may not be set, so get the address from the eth_device struct instead. This also enables pxe for secondary ethernet devices.
NAK: this won't work either ;). the API contract is that the env is the canonical storage, and eth_device->enetaddr is there only for the network device drivers themselves: they seed it during registration, and then use it when starting up as the common layer has taken care of syncing from the env.
what you probably want to do is update net/eth.c's eth_register() to see if dev->enetaddr is valid (is_valid_ether_addr), and if the env addr is not set for that device, and if not, set the env with it.
then you can assume in cmd_pxe.c that the env is setup. -mike