From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Thu, 11 Dec 2008 09:53:38 -0800 Subject: [U-Boot] NetLoop() code ordering In-Reply-To: <13F6A75BE29CE44F801B912901C3EF27F96F3B@wgv4.watchguardvideo.local> References: <13F6A75BE29CE44F801B912901C3EF27F96F3B@wgv4.watchguardvideo.local> Message-ID: <494153A2.6030107@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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