* [ECOS] possible bug in if_fcc ethernet driver? @ 2004-06-14 15:15 agyhoo 2004-06-14 15:37 ` Gary Thomas 0 siblings, 1 reply; 8+ messages in thread From: agyhoo @ 2004-06-14 15:15 UTC (permalink / raw) To: ecos-discuss 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? Thanks. - Anunoy __________________________________ 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] possible bug in if_fcc ethernet driver? 2004-06-14 15:15 [ECOS] possible bug in if_fcc ethernet driver? agyhoo @ 2004-06-14 15:37 ` Gary Thomas 2004-06-14 15:46 ` agyhoo 2004-06-15 13:53 ` Peter Graf 0 siblings, 2 replies; 8+ messages in thread From: Gary Thomas @ 2004-06-14 15:37 UTC (permalink / raw) To: agyhoo; +Cc: eCos Discussion 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 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] possible bug in if_fcc ethernet driver? 2004-06-14 15:37 ` Gary Thomas @ 2004-06-14 15:46 ` agyhoo 2004-06-14 16:23 ` Gary Thomas 2004-06-15 13:53 ` Peter Graf 1 sibling, 1 reply; 8+ messages in thread From: agyhoo @ 2004-06-14 15:46 UTC (permalink / raw) To: Gary Thomas; +Cc: eCos Discussion 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. - 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/ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] possible bug in if_fcc ethernet driver? 2004-06-14 15:46 ` agyhoo @ 2004-06-14 16:23 ` Gary Thomas 2004-06-14 17:17 ` agyhoo 0 siblings, 1 reply; 8+ messages in thread From: Gary Thomas @ 2004-06-14 16:23 UTC (permalink / raw) To: agyhoo; +Cc: eCos Discussion 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? Does it work properly if the network is plugged in? 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 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] possible bug in if_fcc ethernet driver? 2004-06-14 16:23 ` Gary Thomas @ 2004-06-14 17:17 ` agyhoo 0 siblings, 0 replies; 8+ messages in thread From: agyhoo @ 2004-06-14 17:17 UTC (permalink / raw) To: Gary Thomas; +Cc: eCos Discussion 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 ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] possible bug in if_fcc ethernet driver? 2004-06-14 15:37 ` Gary Thomas 2004-06-14 15:46 ` agyhoo @ 2004-06-15 13:53 ` Peter Graf 2004-06-15 14:02 ` [ECOS] Enabling Second Eth interface causes system stop Rajeev Gaba 1 sibling, 1 reply; 8+ messages in thread From: Peter Graf @ 2004-06-15 13:53 UTC (permalink / raw) To: eCos Discussion Gary Thomas 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. > > > It might be a matter of timeout(s) length(s) around phy inialization. I vaguely remember I had to shorten them, so it recognizes the missing cable sooner. All the best Peter -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* [ECOS] Enabling Second Eth interface causes system stop 2004-06-15 13:53 ` Peter Graf @ 2004-06-15 14:02 ` Rajeev Gaba 0 siblings, 0 replies; 8+ messages in thread From: Rajeev Gaba @ 2004-06-15 14:02 UTC (permalink / raw) To: eCos Discussion Hi, We are using a Intel IXP 425 based board. In this if we remove the PHY device for second ethernet port it stops executing and says No Network Interfaces found. I'm very new to this and would require some useful tips for this problem. Regards, Rajeev Gaba -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [ECOS] possible bug in if_fcc ethernet driver? @ 2004-06-15 18:01 agyhoo 0 siblings, 0 replies; 8+ messages in thread From: agyhoo @ 2004-06-15 18:01 UTC (permalink / raw) To: ecos-discuss Thanks for your response Peter. I dont think that the PHY timeout is an issue in my case. The phy initialization and indeed the MAC initialization completes successfully. The hardware independent ethernet driver sets the state as ACTIVE so the FreeBSD stack thinks the device is ready to send/receive. I still haven't figured out where the problem is. All I know is that something goes wrong in the initialization code before my main routine kicks in. I suspect the alarm timeout network thread because it calls the ethdrv "tickle" API call that seems to do a send operation. - Anunoy __________________________________ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-06-15 18:01 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-06-14 15:15 [ECOS] possible bug in if_fcc ethernet driver? agyhoo 2004-06-14 15:37 ` Gary Thomas 2004-06-14 15:46 ` agyhoo 2004-06-14 16:23 ` Gary Thomas 2004-06-14 17:17 ` agyhoo 2004-06-15 13:53 ` Peter Graf 2004-06-15 14:02 ` [ECOS] Enabling Second Eth interface causes system stop Rajeev Gaba 2004-06-15 18:01 [ECOS] possible bug in if_fcc ethernet driver? agyhoo
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).