Program net device MAC addresses after initializing

Add a new function to the eth_device struct for programming a network
controller's hardware address.

After all network devices have been initialized and the proper MAC address
for each has been determined, make a device driver call to program the
address into the device.  Only device instances with valid unicast addresses
will be programmed.

Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Acked-by: Detlev Zundel <dzu@denx.de>
Tested-by: Prafulla Wadaskar <prafulla@marvell.com>
Tested-by: Heiko Schocher <hs@denx.de>
Tested-by: Thomas Chou <thomas@wytron.com.tw>
This commit is contained in:
Ben Warren 2010-04-26 11:11:46 -07:00
parent c960b13ed2
commit ecee9324d7
5 changed files with 31 additions and 5 deletions

View file

@ -105,6 +105,7 @@ struct eth_device {
#ifdef CONFIG_MCAST_TFTP
int (*mcast) (struct eth_device*, u32 ip, u8 set);
#endif
int (*write_hwaddr) (struct eth_device*);
struct eth_device *next;
void *priv;
};