linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Is there any docs or design guides for adding hotplugablity to drivers?
@ 2002-07-01 21:00 Mark Atwood
  2002-07-02  2:23 ` Is there any docs or design guides for adding hotplugablity to David Brownell
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Mark Atwood @ 2002-07-01 21:00 UTC (permalink / raw)
  To: linux-hotplug


Other than just reading the source, of course.

I'm working on a Linux appliance, and I feel that using hotplug events
to signal things like moving in range of an 802.11 access point,
getting carrier on an ethernet port, and someone plugging a cable into
the serial port, would make a lot of stuff much much easier.

I suspect that a lot of this would be useful out in the "regular
linux" world as well. Especially the ethernet carrier detect. (Windows
can do it, and will invoke DHCP when you plug in an ethernet cable, it
would be nice if Linux can do the same.)

-- 
Mark Atwood   | Well done is better than well said.
mra@pobox.com | 
http://www.pobox.com/~mra


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is there any docs or design guides for adding hotplugablity to
  2002-07-01 21:00 Is there any docs or design guides for adding hotplugablity to drivers? Mark Atwood
@ 2002-07-02  2:23 ` David Brownell
  2002-07-02  2:32 ` Is there any docs or design guides for adding hotplugablity to drivers? Chris Hanson
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: David Brownell @ 2002-07-02  2:23 UTC (permalink / raw)
  To: linux-hotplug

Mark Atwood wrote:
> Other than just reading the source, of course.

Start there, and then ask questions.  The docs that exist
are on the http://linux-hotplug.sf.net website, and in the
source code for the various subsystems that do hotplugging.

Inside the kernel, one basically invokes the program identified
by /proc/sys/kernel/hotplug, using a simple convention (only
argv[1] is standard) with call_usermodehelper() to report those
events.  Normally one wants the events to be reported by some
subsystem/framework code, rather than individual drivers, since
it's a lose to expect every driver be changed.


> I'm working on a Linux appliance, and I feel that using hotplug events
> to signal things like moving in range of an 802.11 access point,
> getting carrier on an ethernet port, and someone plugging a cable into
> the serial port, would make a lot of stuff much much easier.
> 
> I suspect that a lot of this would be useful out in the "regular
> linux" world as well. Especially the ethernet carrier detect. (Windows
> can do it, and will invoke DHCP when you plug in an ethernet cable, it
> would be nice if Linux can do the same.)

I agree that carrier detect would be good to report through hotplug,
since that's actually the relevant event.  Since the network drivers
don't actually agree on an initialization model (some register
before going "up", others don't -- see the special casing in
the /etc/hotplug/net.agent script for a start), some of the basic
issues there relate to the networking stack.

Last I looked, the network stack didn't actually treat carrier
detect as an interesting event, which makes such changes be unduly
complex.  If you're interested in updating the 2.5 stack to do
such things, I'd suggest discussing this on the netdev list and
shipping code before the planned feature freeze on Hallowe'en... :)

- Dave







-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Is there any docs or design guides for adding hotplugablity to drivers?
  2002-07-01 21:00 Is there any docs or design guides for adding hotplugablity to drivers? Mark Atwood
  2002-07-02  2:23 ` Is there any docs or design guides for adding hotplugablity to David Brownell
@ 2002-07-02  2:32 ` Chris Hanson
  2002-07-02  3:37 ` Brad Hards
  2002-07-02  4:52 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Chris Hanson @ 2002-07-02  2:32 UTC (permalink / raw)
  To: linux-hotplug

   Date: 01 Jul 2002 14:00:19 -0700
   From: Mark Atwood <mra@pobox.com>

   Other than just reading the source, of course.

   I'm working on a Linux appliance, and I feel that using hotplug events
   to signal things like moving in range of an 802.11 access point,
   getting carrier on an ethernet port, and someone plugging a cable into
   the serial port, would make a lot of stuff much much easier.

   I suspect that a lot of this would be useful out in the "regular
   linux" world as well. Especially the ethernet carrier detect. (Windows
   can do it, and will invoke DHCP when you plug in an ethernet cable, it
   would be nice if Linux can do the same.)

I'm working on this.  I've already implemented code to do carrier
detect, although this only works on NICs that support MII.
(Unfortunately the Lucent Prism II doesn't support MII; if anyone
knows how to do carrier detect on non-MII NICs, I'd appreciate
learning how.)  See the Debian package "laptop-net" for details:

	http://packages.debian.org/unstable/admin/laptop-net.html

This package also handles configuration and so forth.

However, there are N such Debian packages, each with a different set
of features and a different configuration interface.  What I'm
currently working on is an event daemon to allow the functionality in
these packages to be modularized.  I plan to use this to provide a
uniform event-signalling mechanism for all sorts of things, including
networking and APM.  The immediate application is a project underway
here at MIT to improve our laptop infrastructure.  But the mechanism
is general enough to handle any kind of event.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is there any docs or design guides for adding hotplugablity to drivers?
  2002-07-01 21:00 Is there any docs or design guides for adding hotplugablity to drivers? Mark Atwood
  2002-07-02  2:23 ` Is there any docs or design guides for adding hotplugablity to David Brownell
  2002-07-02  2:32 ` Is there any docs or design guides for adding hotplugablity to drivers? Chris Hanson
@ 2002-07-02  3:37 ` Brad Hards
  2002-07-02  4:52 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Brad Hards @ 2002-07-02  3:37 UTC (permalink / raw)
  To: linux-hotplug

On Tue, 2 Jul 2002 12:32, Chris Hanson wrote:
>    Date: 01 Jul 2002 14:00:19 -0700
>    From: Mark Atwood <mra@pobox.com>
>
>    Other than just reading the source, of course.
>
>    I'm working on a Linux appliance, and I feel that using hotplug events
>    to signal things like moving in range of an 802.11 access point,
>    getting carrier on an ethernet port, and someone plugging a cable into
>    the serial port, would make a lot of stuff much much easier.
>
>    I suspect that a lot of this would be useful out in the "regular
>    linux" world as well. Especially the ethernet carrier detect. (Windows
>    can do it, and will invoke DHCP when you plug in an ethernet cable, it
>    would be nice if Linux can do the same.)

> I'm working on this.  I've already implemented code to do carrier
> detect, although this only works on NICs that support MII.
> (Unfortunately the Lucent Prism II doesn't support MII; if anyone
> knows how to do carrier detect on non-MII NICs, I'd appreciate
> learning how.)  See the Debian package "laptop-net" for details:
The concept of carrier detect is a bit marginal on a non-wired links. Normally 
you need to associate to be considered on the link.

Note that most newish network cards do support carrier detect in some form. We 
even support it for most of the USB networking devices. You can see this 
using a proggie like ethtool (http://www.sf.net/projects/gkernel). 

The way it works is that the driver does whatever magic it needs, and then 
signals to the networking stack using netif_carrier_on() and 
netif_carrier_off. The trivial solution is to add a call_usermodehelper() to 
the netif_carrier_[off,on] routines (in <linux/netdevice.h>. Unfortunately 
the call_usermodehelper() needs process context, and you can't assume that 
for the netif_carrier_[on|off] calls.

Brad

-- 
http://conf.linux.org.au. 22-25Jan2003. Perth, Australia. Birds in Black.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Is there any docs or design guides for adding hotplugablity to drivers?
  2002-07-01 21:00 Is there any docs or design guides for adding hotplugablity to drivers? Mark Atwood
                   ` (2 preceding siblings ...)
  2002-07-02  3:37 ` Brad Hards
@ 2002-07-02  4:52 ` Greg KH
  3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2002-07-02  4:52 UTC (permalink / raw)
  To: linux-hotplug

On Mon, Jul 01, 2002 at 02:00:19PM -0700, Mark Atwood wrote:
> 
> Other than just reading the source, of course.

Read the docs on the web site.
There was an older article in Linux Journal that detailed the subsystem
quite well.  And there was a paper presented at the 2001 Ottawa Linux
Symposium that had much the same information.

> I'm working on a Linux appliance, and I feel that using hotplug events
> to signal things like moving in range of an 802.11 access point,
> getting carrier on an ethernet port, and someone plugging a cable into
> the serial port, would make a lot of stuff much much easier.
> 
> I suspect that a lot of this would be useful out in the "regular
> linux" world as well. Especially the ethernet carrier detect. (Windows
> can do it, and will invoke DHCP when you plug in an ethernet cable, it
> would be nice if Linux can do the same.)

Ethtool can do much of what you are looking for it sounds like.

Hope this helps,

greg k-h


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-07-02  4:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-01 21:00 Is there any docs or design guides for adding hotplugablity to drivers? Mark Atwood
2002-07-02  2:23 ` Is there any docs or design guides for adding hotplugablity to David Brownell
2002-07-02  2:32 ` Is there any docs or design guides for adding hotplugablity to drivers? Chris Hanson
2002-07-02  3:37 ` Brad Hards
2002-07-02  4:52 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).