From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32180 invoked by alias); 24 Sep 2009 16:26:14 -0000 Received: (qmail 32171 invoked by uid 22791); 24 Sep 2009 16:26:13 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from virtual.bogons.net (HELO virtual.bogons.net) (193.178.223.136) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Sep 2009 16:26:10 +0000 Received: from jifvik.dyndns.org (jifvik.dyndns.org [85.158.45.40]) by virtual.bogons.net (8.10.2+Sun/8.11.2) with ESMTP id n8OGQ7427374; Thu, 24 Sep 2009 17:26:07 +0100 (BST) Received: from [172.31.1.126] (neelix.jifvik.org [172.31.1.126]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by jifvik.dyndns.org (Postfix) with ESMTP id E069A3FEB; Thu, 24 Sep 2009 17:26:06 +0100 (BST) Message-ID: <4ABB9D9D.3080309@jifvik.org> Date: Thu, 24 Sep 2009 16:26:00 -0000 From: Jonathan Larmour User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) MIME-Version: 1.0 To: haraxidix@gmail.com Cc: Grant Edwards , eCos discussion References: <6afa98b0909240334i7536f39drfce21817f2fe686c@mail.gmail.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00231.txt.bz2 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. > > > We've been using eCos for 10 years, and we've never found it > necessary to restart eCos (or the network stack, or anything > else) when the Ethernet link goes down/up. > > >>As far as I know (please correct me if i'm wrong) incoming ip >>and arp requests are handled by the thread cyg_netint. It >>seems that this thread is put to sleep if the network cable is >>not connected. > > > 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. Static IP should probably be ok. That's a different scenario to being up and then being disconnected and reconnected as the interface already has an IP address (as long as it's reconnected within the DHCP lease expiry time). I believe you should just be able to call init_all_network_interfaces() again, when your PHY spots the cable is inserted. If you don't have an interrupt for your PHY to detect that, you'll need to have a thread poll it. Note that init_all_network_interfaces needs to be run from a thread context in any case, not an ISR or DSR context. 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