From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20767 invoked by alias); 25 Sep 2009 01:23:14 -0000 Received: (qmail 20757 invoked by uid 22791); 25 Sep 2009 01:23:13 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from netic.com (HELO netic.com) (208.131.130.247) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Sep 2009 01:23:09 +0000 Received: from [120.18.74.197] ([120.18.74.197]) by netic.com (8.13.1/8.13.1) with ESMTP id n8P1MYKw021975; Thu, 24 Sep 2009 19:22:36 -0600 Cc: Grant Edwards , eCos discussion Message-Id: From: Laurie Gellatly To: Jonathan Larmour In-Reply-To: <4ABC0AA4.4040208@jifvik.org> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (iPhone Mail 7C144) Date: Fri, 25 Sep 2009 01:23:00 -0000 References: <6afa98b0909240334i7536f39drfce21817f2fe686c@mail.gmail.com> <4ABB9D9D.3080309@jifvik.org> <4ABC0AA4.4040208@jifvik.org> X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: connect ethernet cable at run-time X-SW-Source: 2009-09/txt/msg00237.txt.bz2 On 25/09/2009, at 10:11 AM, Jonathan Larmour wrote: > Grant Edwards wrote: >> On 2009-09-24, Jonathan Larmour wrote: >>> Grant Edwards wrote: >>> >>>> On 2009-09-24, Lars Dahlin wrote: >>>> >>>> >>>>> I want to be able to connect the ethernet cable and it >>>>> shouldn't be necesary to restart ecos. >> [...] >>>> Again, I've never seen that. We connect/disconnect Ethernet >>>> cables all the time, and never have to restart anything. >>>> We do have code in our Ethernet drivers that makes sure that >>>> the Ethernet MAC duplex setting is changed to match the PHY's >>>> negotiation results when a cable is plugged in, but I don't >>>> think that has anything to do with what you're talking about. >>> >>> I think the issue may be that if you start the device with it >>> disconnected, nothing _automatically_ will bring the interface >>> up using BOOTP/DHCP. >> If one calls init_all_network_interfaces() before the Ethernet >> link is up does the DHCP code give up and terminate? IOW, >> doesn't the DHCP client code retry if it doesn't get a >> response? That seems a bit odd. > > I don't believe it does retry at present. > > See for example in dhcp_prot.c that do_dhcp() calls no_lease(), > whicih disables and deletes the alarm. Without that the > needs_attention semaphore is not posted and the dhcp management > thread gets stuck waiting on it. That's my belief anyway. > > Jifl > -- > --["No sense being pessimistic, it wouldn't work anyway"]-- > Opinions==mine > > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos- > discuss > With my project I found some interesting things with DHCP and network cables. If the network cable was unplugged at startup then there is no IP address. I found that I could run out of file handles and that DHCPinit call would never return even if the cable was later inserted. I had to work around that and then regularly call init_all_network_interfaces in the main TCP listening task just after it also fed the watchdog if the IP address was 0.0.0.0. Switching in and out of DHCP or static addressing was also coded. ...Laurie:{) -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss