mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Nico Schümann" <dev@nico22.de>
To: linux-kernel@vger.kernel.org
Subject: Network link detection
Date: Thu, 3 Mar 2011 20:30:06 +0100	[thread overview]
Message-ID: <20110303193006.GA29129@svh.nico22.de> (raw)

Dear kernel developers,

currently I'm looking for a way to find out whether a network link went 
down or up. Of course there is mii-tool, which can watch devices, too.

So for now, I created a small program that polls the MII_LINK_OK
flag with the SIOCGMIIREG ioctl - the same thing that mii-tools does. 
But polling that often for a link change that occurs maybe once in a 
month sounds like waste of energy.

Unfortunately, I was not able to find out a way to be notified about 
link status changes asynchronously. Is there a way? I'm looking for 
something like "inotify for link states".

There are some debug outputs as in drivers/net/natsemi.c:1672
                        printk(KERN_NOTICE "%s: link up.\n", dev->name);
so it would be quite easy to insert a notification.

If there is no way yet to get these notifications asynchronosly, would 
there be real use for it or am I just missing something?

Thanks,

Nico

             reply	other threads:[~2011-03-03 19:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 19:30 Nico Schümann [this message]
2011-03-03 20:03 ` Jesper Juhl
2011-03-03 20:45   ` richard -rw- weinberger
2011-03-03 21:38 ` Chris Friesen
2011-03-03 22:01   ` David Miller
2011-03-03 22:29     ` Nico Schümann
2011-03-07 19:49       ` Dan Williams
2011-03-03 23:54     ` Chris Friesen
2011-03-03 22:07 ` Stephen Hemminger
2011-03-04  6:35   ` Nico Schümann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110303193006.GA29129@svh.nico22.de \
    --to=dev@nico22.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®