public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] link loss/detection at runtime
@ 2005-07-26 12:04 Will Wagner
  2005-07-26 16:42 ` Steve Strublic
  0 siblings, 1 reply; 3+ messages in thread
From: Will Wagner @ 2005-07-26 12:04 UTC (permalink / raw)
  To: eCos Discussion

Hi All,

Are there any examples of ethernet drivers that cope with link 
loss/detection after the drivers have been initialised? I am using an 
MPC860 with AMD PHY. I have hunted through the source but can't find any 
examples of this.

If not can anyone point me to what needs to be done in the bsd stack to 
bring an interface up/down following a change in link status.

Thanks,

Will


-- 
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] 3+ messages in thread

* Re: [ECOS] link loss/detection at runtime
  2005-07-26 12:04 [ECOS] link loss/detection at runtime Will Wagner
@ 2005-07-26 16:42 ` Steve Strublic
  2005-07-26 17:44   ` Will Wagner
  0 siblings, 1 reply; 3+ messages in thread
From: Steve Strublic @ 2005-07-26 16:42 UTC (permalink / raw)
  To: will_wagner; +Cc: ecos-discuss





We had a similar issue at my company.  We ended up hooking FEC_ETH_PHY_INT, writing an ISR/DSR
combination, and running a thread to allow calls to phy_read().  In the thread, we read the contents
of the link status register when notified by the DSR that the status has changed.  This also allowed
us to have multiple notifiers execute upon link status change.

Something like:

phy_ok = phy_read(PHY_BMSR2, FEC_ETH_PHY, &mii_reg17);

if (mii_reg17 & PHY_BMSR2_LINK)
      link_up_status=true;
else
      link_up_status=false;

(pfn_proc_link_status)(link_up_status) ;

There may be (probably is) an easier solution, but this one worked for us.

HTH,

Steve

--------

"A chicken doesn't stop scratching just because the worms are scarce." - Grandma Soderquist's
Conclusion



                                                                                                    
             will_wagner@carallon.com                                                               
             Sent by:                                                                               
             ecos-discuss-owner@ecos.sou                                                         To 
             rceware.org                         ecos-discuss@ecos.sourceware.org                   
                                                                                                 cc 
                                                                                                    
             07/26/2005 05:07 AM                                                            Subject 
                                                 [ECOS] link loss/detection at runtime              
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    
                                                                                                    




Hi All,

Are there any examples of ethernet drivers that cope with link
loss/detection after the drivers have been initialised? I am using an
MPC860 with AMD PHY. I have hunted through the source but can't find any
examples of this.

If not can anyone point me to what needs to be done in the bsd stack to
bring an interface up/down following a change in link status.

Thanks,

Will


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




-- 
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] 3+ messages in thread

* Re: [ECOS] link loss/detection at runtime
  2005-07-26 16:42 ` Steve Strublic
@ 2005-07-26 17:44   ` Will Wagner
  0 siblings, 0 replies; 3+ messages in thread
From: Will Wagner @ 2005-07-26 17:44 UTC (permalink / raw)
  To: Steve Strublic; +Cc: ecos-discuss

Thanks Steve.

Thats exactly where I had just got to, can't see a better way of doing it.

Could you give an example of what's in your pfn_proc_link_status. I am 
assuming I can copy code snippets out of the dhcp code to work out how 
to bring the interface up and down.

Cheers,

Will

Steve Strublic wrote:
> 
> 
> 
> We had a similar issue at my company.  We ended up hooking FEC_ETH_PHY_INT, writing an ISR/DSR
> combination, and running a thread to allow calls to phy_read().  In the thread, we read the contents
> of the link status register when notified by the DSR that the status has changed.  This also allowed
> us to have multiple notifiers execute upon link status change.
> 
> Something like:
> 
> phy_ok = phy_read(PHY_BMSR2, FEC_ETH_PHY, &mii_reg17);
> 
> if (mii_reg17 & PHY_BMSR2_LINK)
>       link_up_status=true;
> else
>       link_up_status=false;
> 
> (pfn_proc_link_status)(link_up_status) ;
> 
> There may be (probably is) an easier solution, but this one worked for us.
> 
> HTH,
> 
> Steve
> 
> --------
> 
> "A chicken doesn't stop scratching just because the worms are scarce." - Grandma Soderquist's
> Conclusion
> 
> 
> 
>                                                                                                     
>              will_wagner@carallon.com                                                               
>              Sent by:                                                                               
>              ecos-discuss-owner@ecos.sou                                                         To 
>              rceware.org                         ecos-discuss@ecos.sourceware.org                   
>                                                                                                  cc 
>                                                                                                     
>              07/26/2005 05:07 AM                                                            Subject 
>                                                  [ECOS] link loss/detection at runtime              
>                                                                                                     
>                                                                                                     
>                                                                                                     
>                                                                                                     
>                                                                                                     
>                                                                                                     
> 
> 
> 
> 
> Hi All,
> 
> Are there any examples of ethernet drivers that cope with link
> loss/detection after the drivers have been initialised? I am using an
> MPC860 with AMD PHY. I have hunted through the source but can't find any
> examples of this.
> 
> If not can anyone point me to what needs to be done in the bsd stack to
> bring an interface up/down following a change in link status.
> 
> Thanks,
> 
> Will
> 
> 
> --
> Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
> and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
> 
> 
> 
> 


-- 
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] 3+ messages in thread

end of thread, other threads:[~2005-07-26 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-26 12:04 [ECOS] link loss/detection at runtime Will Wagner
2005-07-26 16:42 ` Steve Strublic
2005-07-26 17:44   ` Will Wagner

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).