From: Chris Friesen <cfriesen@nortelnetworks.com>
To: "David L. Parsley" <parsley@roanoke.edu>
Cc: Andi Kleen <ak@suse.de>, Stefan Rompf <srompf@isg.de>,
linux-kernel@vger.kernel.org
Subject: Re: Interface operative status detection
Date: Tue, 12 Feb 2002 10:58:24 -0500 [thread overview]
Message-ID: <3C693BA0.43104E47@nortelnetworks.com> (raw)
In-Reply-To: <3C498CC9.6FAED2AF@isg.de.suse.lists.linux.kernel> <p73g0525je4.fsf@oldwotan.suse.de> <3C692C1C.7090107@roanoke.edu>
"David L. Parsley" wrote:
> Is there a good way for a dhcp daemon to find out whether the laptop is
> connected to the network or not? It'd be really sweet if dhcpcd could:
>
> - down the interface and remove routes whenever the network cable was
> unplugged
> - wait for the interface to get link beat again, and send a new request
>
> This would greatly enhance desktop usability. I'd be happy to do the
> dhcpcd hacking if the right kernel interfaces were available.
If the network driver supports querying of the MII registers (usually done with
the private ioctl stuff) then you can query the link beat from userspace.
Depending on the driver/chip this may be a very fast query, or it may take
upwards of 100us with interrupts disabled.
I can post example code if you like...
Now what I would *really* like to see would be a way to get asynchronous
notification of userspace processes on link beat change. Of course, depending
on NIC this would require an interrupt handler or a kernel thread periodically
checking the link state, as well as some way to pass that information to the
user (netlink socket, interrupt...not sure what the best would be).
Chris
--
Chris Friesen | MailStop: 043/33/F10
Nortel Networks | work: (613) 765-0557
3500 Carling Avenue | fax: (613) 765-2986
Nepean, ON K2H 8E9 Canada | email: cfriesen@nortelnetworks.com
next prev parent reply other threads:[~2002-02-12 15:51 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3C498CC9.6FAED2AF@isg.de.suse.lists.linux.kernel>
2002-01-19 17:40 ` Interface operative status detection Andi Kleen
2002-01-20 0:51 ` Stefan Rompf
2002-02-12 14:52 ` David L. Parsley
2002-02-12 15:58 ` Chris Friesen [this message]
2002-02-12 16:08 ` Stefan Rompf
2002-01-19 15:12 Stefan Rompf
2002-01-19 15:29 ` Jeff Garzik
2002-01-19 18:34 ` Roberto Nibali
2002-02-08 10:16 ` Jeff Garzik
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=3C693BA0.43104E47@nortelnetworks.com \
--to=cfriesen@nortelnetworks.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=parsley@roanoke.edu \
--cc=srompf@isg.de \
/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