[quagga-dev 1503] Re: link detection on NetBSD

David Young dyoung at pobox.com
Tue Sep 14 12:30:24 BST 2004

On Mon, Sep 13, 2004 at 06:46:51PM -0400, Miles Nordin wrote:
> >>>>> "ao" == Andre Oppermann <opi at nrg4u.com> writes:
> >>>>> "pj" == Paul Jakma <paul at clubi.ie> writes:
>     ao> At least in FreeBSD I implemented this at the MII level.
> This is the state of NetBSD as well, and it is not adequate:
>  * some popular chips, like tulip 21143, are 100Mbit/s Ethernet with
>    _no MII_.
>     ``The 21143 adds support for 100Mb/s speeds with a built-in PCS
>       function.  Support for 100BASE-TX and 100BASE-T4 is provided by
>       a built-in scrambler.  Support for 100BASE-FX is possible with
>       an appropriate PMD connected to the 100BASE PCS.
>     ``The 21142 and 21143 include a general purpose I/O facility,
>       . . .  select the output path of the chip (e.g. connect the UTP
>       port on the board to the PHY, built-in serial interface, or
>       built-in 100BASE-T PMD), . . .''
>    I have no clue what is a scrambler, PMD, or PCS, but there is no
>    MII for my 21143, and indeed for NetBSD link-detect loses on this
>    chip because they only implemented it for MII.
>  * 10Mbit/s Ethernet.  People do still use this, for example on
>    embedded devices.  WAN ports of linksys routers, soekris?
>  * Wireless infrastructure-mode-station (though I think David may have
>    already taken care of it)

Yes, see src/sys/net80211/ieee80211_proto.c:ieee80211_newstate, which
changes if_link_state according to the condition of the 802.11 state
machine: in RUN state, if_link_state <- UP, and in all other states,
if_link_state <- DOWN.  Before the interface is first initialized,
if_link_state = UNKNOWN.  On transitions (UP->DOWN, DOWN->UP,
UNKNOWN->{UP,DOWN}), rt_ifmsg is called to give notice on routing sockets.

> The common types of non-Ethernet interfaces are tunnels and ppp, and
> AFAICT for those there is no such thing as link state apart from
> UPness/DOWNness.

For PPP, do Carrier Detect or presence/absence of a PPP daemon count
as UP/DOWN?  In the abstract, DOWN indicates any condition where packets
(for example, OSPF Hellos) absolutely *cannot* be received.  In all
other conditions, the OS should indicate UP or UNKNOWN.  If the modem
is not connected, that is clearly DOWN.  If there is no device/process
attached to the ppp interface, that is DOWN.  Make sense?


David Young             OJC Technologies
dyoung at ojctech.com      Urbana, IL * (217) 278-3933

More information about the Quagga-dev mailing list