Nelson wrote:
>
> hi,
>
> just to make sure,
>
> what i actually need is the link state change detection.
> When the link is up or when the link goes down, would it be detected and
> triggered an interrupt?
There is an API in kernel 2.4 which allows drivers to report the loss of
carrier. The only driver which implements it at this time is
via-rhine. 3c59x could do so (later devices can generate an interrupt
on carrier state change).
Many other devices could implement it within their media selection
timer, but the latency would be large (up to one minute).
It looks like if you have a via-rhine the carrier status for the
interface may be queried from user space with ioctl(.., SIOCGIFFLAGS,
...). Use 'man netdevice'.
But having to poll the ioctl is sucky - it would be better if there were
a select()able interface for carrier transitions. rtnetlink is
appropriate, but it isn't done yet.
Of course, you could still have interface carrier, but the interface
isn't usable because something further away broke. This is one reason
why HA implementations resort to end-to-end heartbeat messaging.
Depending on what you're doing, you may find the 'heratbeat' application
useful. It lives at http://www.linux-ha.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]