This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: possible bug in if_fcc ethernet driver?


Gary,

See my comments below:

--- Gary Thomas <gary@mlbassoc.com> wrote:
> On Mon, 2004-06-14 at 09:46, agyhoo wrote:
> > In my eCos configuration, I've chosen to initialize
> > the eth0 interface manually. My initialization routine
> > (called from within my application routine), tries to
> > get params via bootp first. If that fails, it then
> > sets up a bootp record (using data from flash) and
> > then initializes the network calling the init_net fn.
> > 
> > However, I dont even get to my application's main
> routine.
> > The code seems to "hang" in the cyg_net_init function
> where
> > the alarm thread and the background network threads are
> > created.
> 
> How do you know that it doesn't get to your code?
[AG]: I set a break point at my application main.
I also have other routines in my main function that 
I put breakpoints on but I never get there. I am using
a POSIX style main function btw.

> Does it work properly if the network is plugged in?
[AG]: Yes. I tried this with both my networking code
(ie., bootp and static ip initialization fallback) compiled
in and compiled out. When the network cable is plugged
in, it works fine.

I also tried making the fcc_eth_init return false. When
I do this, the application executes correctly. Hence,
my suspicions....

- Anunoy
> 
> The network threads that you mention don't do any network
> I/O
> without an application first doing something, plus they
> should
> never "hang".  I think there must be some other problem
> here.
> 
> > 
> > - Anunoy
> > 
> > --- Gary Thomas <gary@mlbassoc.com> wrote:
> > > On Mon, 2004-06-14 at 09:15, agyhoo wrote:
> > > > Hi,
> > > > 
> > > > In the if_fcc ethernet driver, the fcc_eth_init
> routine
> > > > returns "false" if there is no LINK detected (ie,
> > > network
> > > > cable is unplugged). However, there is a compile
> switch
> > > > around the return false statement (CYGPKG_REDBOOT).
> > > > Therefore, when I run my eCos application, it hangs
> > > when
> > > > the network cable is unplugged. I think this is
> because
> > > the
> > > > network alarm thread and the background thread
> think
> > > the
> > > > device status is available and try to access it.
> > > > 
> > > > Am I missing something? Can someone tell me why the
> > > compile
> > > > switch is present?
> > > 
> > > We explicitly want RedBoot to not try and use the
> network
> > > if there
> > > is no cable in place (it just wastes time).  In the
> case
> > > of eCos,
> > > I doubt that your program "hangs", but rather it is
> > > waiting to
> > > get an ethernet IP address via DHCP (the default
> > > behaviour).  If
> > > the network is unplugged, this process will take
> quite a
> > > long time
> > > (more than 30 seconds), waiting for the network to
> come
> > > available.
> > > Eventually, the DHCP will timeout and your code will
> > > continue,
> > > but if it needs the network, it will probably have
> other
> > > problems.
> > > 
> > > -- 
> > > Gary Thomas <gary@mlbassoc.com>
> > > MLB Associates
> > > 
> > > 
> > 
> > 
> > 
> > 	
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Friends.  Fun.  Try the all-new Yahoo! Messenger.
> > http://messenger.yahoo.com/
> -- 
> Gary Thomas <gary@mlbassoc.com>
> MLB Associates
> 
> 



	
		
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]