From mboxrd@z Thu Jan 1 00:00:00 1970 From: Detlev Zundel Date: Wed, 14 Nov 2007 12:07:27 +0100 Subject: [U-Boot-Users] What if eth_init() fails? In-Reply-To: <13740586.post@talk.nabble.com> (Upakul Barkakaty's message of "Tue\, 13 Nov 2007 22\:21\:00 -0800 \(PST\)") References: <13740586.post@talk.nabble.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Upakul, > Hi all, I observed that when the Ethernet initialization fails, it is not > properly halting the operation and exiting. On walking through the Networking > files, I saw that the eth_init() in eth.c either returns a 0 or 1. Now, in the > NetLoop() in net.c file, from where the eth_init() gets called, checks the > condition if (eth_init(bd) < 0) { eth_halt(); return(-1); } which is thus never > true. Thus the network operation, never exits gracefully, if Ethernet init > fails. Any of you, have any clues about this?? I think your analysis is right and thus the code in NetLoop should be fixed. Feel free to send a patch and I am pretty sure Ben Warren will pick it up into the u-boot-net repo. Cheers Detlev -- Two monks went fishing in an electron river. The first monk drew out his network, and out flopped a hacker. The second monk cried, "The poor hacker! How can it live outside of the network?" The first monk said, "When you have learned to live outside the network, then you will know." -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de