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 <[email protected]>
Cc: Ben Warren <[email protected]>
---
 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

_______________________________________________
U-Boot mailing list
[email protected]
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to