Re: Detecting link up

From: Coywolf Qi Hunt
Date: Wed May 18 2005 - 10:17:20 EST


On 5/18/05, Max Kellermann <max@xxxxxxxxxxx> wrote:
> On 2005/05/18 13:40, Martin Zwickel <martin.zwickel@xxxxxxxxxxxxxx> wrote:
> > On Wed, 18 May 2005 11:35:12 +0100
> > Filipe Abrantes <fla@xxxxxxxxxxxxx> bubbled:
> > > I need to detect when an interface (wired ethernet) has link up/down.
> > > Is there a system signal which is sent when this happens? What is the
> > > best way to this programatically?
> >
> > mii-tool?
>
> A thought on a related topic:
>
> When a NIC driver knows that there is no link, why does it even try to
> transmit a packet? It could return immediately with an error code,
> without applications having to wait for a timeout.
>
> (I had a quick peek at two drivers, and they don't check the link
> status)

An NIC driver doesn't know if there's other links or not. One NIC
driver is for one type of NIC. And there's also interface lo.
--
Coywolf Qi Hunt
http://sosdg.org/~coywolf/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/