public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address
@ 2009-05-11  6:39 Jean-Christophe PLAGNIOL-VILLARD
  2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
                   ` (2 more replies)
  0 siblings, 3 replies; 37+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-05-11  6:39 UTC (permalink / raw)
  To: u-boot

init it at the eth_initialize

this will allow to add later a hook to update the enetadd hw storage
when it's updated in env or when the env is saved

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Ben Warren <biggerbadderben@gmail.com>
---
 include/net.h |    2 ++
 net/eth.c     |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/include/net.h b/include/net.h
index 5a1d36e..2ed6263 100644
--- a/include/net.h
+++ b/include/net.h
@@ -93,6 +93,7 @@ enum eth_state_t {
 };
 
 struct eth_device {
+	int num;
 	char name[NAMESIZE];
 	unsigned char enetaddr[6];
 	int iobase;
@@ -105,6 +106,7 @@ struct eth_device {
 #ifdef CONFIG_MCAST_TFTP
 	int (*mcast) (struct eth_device*, u32 ip, u8 set);
 #endif
+	int  (*set_hw_enetaddr) (struct eth_device*, bd_t*);
 	struct eth_device *next;
 	void *priv;
 };
diff --git a/net/eth.c b/net/eth.c
index c6fa5b9..99bb6c2 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -217,6 +217,8 @@ int eth_initialize(bd_t *bis)
 			if (eth_number)
 				puts (", ");
 
+			dev->num = eth_number;
+
 			printf("%s", dev->name);
 
 			if (ethprime && strcmp (dev->name, ethprime) == 0) {
@@ -240,6 +242,8 @@ int eth_initialize(bd_t *bis)
 				}
 
 				memcpy(dev->enetaddr, env_enetaddr, 6);
+				if(dev->set_hw_enetaddr)
+					dev->set_hw_enetaddr(dev, bis);
 			}
 
 			eth_number++;
-- 
1.6.1.3

^ permalink raw reply related	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2009-05-15 14:42 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-11  6:39 [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Jean-Christophe PLAGNIOL-VILLARD
2009-05-11  6:39 ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Jean-Christophe PLAGNIOL-VILLARD
2009-05-11  6:39   ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Jean-Christophe PLAGNIOL-VILLARD
2009-05-11  6:39     ` [U-Boot] [PATCH 4/4] at91/macb: remove reset_phy callback Jean-Christophe PLAGNIOL-VILLARD
2009-05-12  0:31       ` Ben Warren
2009-05-11 18:02     ` [U-Boot] [PATCH 3/4] net/dm9000: move the CONFIG_NET_MULTI api Mike Frysinger
2009-05-11 23:58       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12  0:37         ` Mike Frysinger
2009-05-12  0:30     ` Ben Warren
2009-05-11  9:13   ` [U-Boot] [PATCH 2/4] macb: add set_hw_enetaddr support Haavard Skinnemoen
2009-05-12  0:29   ` Ben Warren
2009-05-11  7:48 ` [U-Boot] [PATCH 1/4] net: extend the netdev to have a common way to set the hw mac address Mike Frysinger
2009-05-11 12:08   ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 13:26     ` Wolfgang Denk
2009-05-11 14:24       ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:01         ` Wolfgang Denk
2009-05-11 16:30           ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:24         ` Mike Frysinger
2009-05-11 16:37           ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-11 16:56             ` Mike Frysinger
2009-05-12  0:04               ` Jean-Christophe PLAGNIOL-VILLARD
2009-05-12  0:36                 ` Mike Frysinger
2009-05-12  8:48                   ` Detlev Zundel
2009-05-12 12:26                     ` Mike Frysinger
2009-05-12 14:18                       ` Detlev Zundel
2009-05-12 16:21                         ` Daniel Stenberg
2009-05-12 22:06                         ` Mike Frysinger
2009-05-13  8:41                           ` Detlev Zundel
2009-05-13 18:07                             ` Mike Frysinger
2009-05-15 14:42                               ` Detlev Zundel
2009-05-12 16:59                     ` Scott Wood
2009-05-13  8:39                       ` Detlev Zundel
2009-05-12 17:02                 ` Scott Wood
2009-05-11 17:49             ` Wolfgang Denk
2009-05-11 17:24           ` Mike Frysinger
2009-05-11 17:54             ` Wolfgang Denk
2009-05-12  0:28 ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox