[U-Boot] NetLoop() code ordering

Ben Warren biggerbadderben at gmail.com
Thu Dec 11 18:53:38 CET 2008


Hi Curtis,

Please copy the U-boot mailing list on all correspondence.

Curtis Wald wrote:
>
> Hi,
>
> As you’re listed as the custodian for the U-Boot Network Library I had 
> a question:
>
> Looking in net/net.c NetLoop() starting at line 322:
>
> eth_halt();
>
> #ifdef CONFIG_NET_MULTI
>
> eth_set_current();
>
> #endif
>
>
>
> Since eth_halt() makes calls to eth_current members, should the code 
> flow be:
>
> #ifdef CONFIG_NET_MULTI
>
> eth_set_current();
>
> #endif
>
> eth_halt();
>
> Moving eth_halt() after the CONFIG_NET_MULTI stanza would setup 
> eth_current before trying to use.
>
This initialization sequence is meant to ensure that everything's in a 
happy, known state. Calling eth_halt() first ensures that whatever 
device is currently being pointed to gets wound down in an orderly 
manner. The subsequent call to eth_init() turns up the active interface 
before using it.
>
> -- 
> Sincerely,
>
> *Curtis Wald*
> /Senior Software Engineer/
> WatchGuard Video
>
regards,
Ben


More information about the U-Boot mailing list