powerpc: Only use eth_getenv_enetaddr() if networking is enabled
--- lib_ppc/board.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
lib_ppc/board.c +2 -0
@@ -888,8 +888,10 @@ void board_init_r (gd_t *id, ulong dest_addr) bd->bi_ethspeed =0xFFFF ;#endif +#ifdef CONFIG_CMD_NET /* kept around for legacy kernels only ... ignore the next section */ eth_getenv_enetaddr ("ethaddr" , bd->bi_enetaddr); +#endif #ifdef CONFIG_HAS_ETH1 eth_getenv_enetaddr ("eth1addr" , bd->bi_enet1addr);#endif
Signature · 1 line
1.6.1.3
Dear Stefan Roese,
Quoted 10 lines · In message <[email protected]> you wrote:
Signed-off-by Stefan Roese <[email protected]>--- lib_ppc/board.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)lib_ppc/board.c +0
-0
lib_ppc/board.c void board_init_r (gd_t *id, ulong dest_addr) · line 897
Quoted 10 lines
lib_ppc/board.c +2
-0@@ -888,8 +888,10 @@ void board_init_r (gd_t *id, ulong dest_addr) bd->bi_ethspeed =0xFFFF ;#endif +#ifdef CONFIG_CMD_NET /* kept around for legacy kernels only ... ignore the next section */ eth_getenv_enetaddr ("ethaddr" , bd->bi_enetaddr); +#endif #ifdef CONFIG_HAS_ETH1 eth_getenv_enetaddr ("eth1addr" , bd->bi_enet1addr);#endif
Should that #ifdef not include the code for "eth1addr" etc., too?
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de The Gates in my computer are AND, OR and NOT; they are not Bill.
Quoted 5 lines · Wolfgang Denk
Quoted 5 lines
+++
b/lib_ppc/board.clib_ppc/board.c +0
-0@@ -888,8 +888,10 @@ void board_init_r (gd_t *id, ulong dest_addr) bd->bi_ethspeed =0xFFFF ;#endif
Quoted 9 lines
lib_ppc/board.c void board_init_r (gd_t *id, ulong dest_addr) · line 897
Quoted 7 lines
lib_ppc/board.c +2
-0+#ifdef CONFIG_CMD_NET /* kept around for legacy kernels only ... ignore the next section */ eth_getenv_enetaddr ("ethaddr" , bd->bi_enetaddr); +#endif #ifdef CONFIG_HAS_ETH1 eth_getenv_enetaddr ("eth1addr" , bd->bi_enet1addr);#endif Should that #ifdef not include the code for "eth1addr" etc., too?
I don't think this is needed. If a board has a 2nd (or 3rd...) ethernet interface, it sets CONFIG_HAS_ETH1. I can't think of a board setting this define and not enabling CONFIG_CMD_NET.
But if you prefer it, I could change the patch to include all eth interfaces in the #ifdef CONFIG_CMD_NET part. Just let me know.
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
Dear Stefan Roese,
Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 2 lines
Should that #ifdef not include the code for "eth1addr" etc., too?
I don't think this is needed. If a board has a 2nd (or 3rd...) ethernet interface, it sets
CONFIG_HAS_ETH1. I can't think of a board setting this define and not enablingCONFIG_CMD_NET.
Well, I can see such problems happen by accident - for example, when you usualy have Ethernet enabled and just disable it for a test or to shrink the image size or ...
Quoted 2 lines
But if you prefer it, I could change the patch to include all eth interfaces in the #ifdef
CONFIG_CMD_NETpart. Just let me know.
I think it would be cleaner, so please do. Thanks.
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "The POP3 server service depends on the SMTP server service, which failed to start because of the following error: The operation comple- ted successfully." -- Windows NT Server v3.51