From: Greg KH <greg@kroah.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: communicating with user login sessions
Date: Fri, 18 Apr 2003 22:40:08 +0000 [thread overview]
Message-ID: <marc-linux-hotplug-105070556306038@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-104977671310586@msgid-missing>
On Fri, Apr 18, 2003 at 01:39:05AM -0400, Havoc Pennington wrote:
> Alan was kind enough to explain some of how devices work to me last
> week. If I understand correctly, there are really two phases to
> hotplugging a device.
>
> There was just some discussion of this here:
> http://www.xfree86.org/pipermail/forum/2003-April/001307.html
> http://www.xfree86.org/pipermail/forum/2003-April/001328.html
> http://www.xfree86.org/pipermail/forum/2003-April/001329.html
>
> Specifically, the relevant bit of those mails is that there's a
> multi-phase process, and during that process there are two separate
> places we might want to kick out to userspace.
>
> In brief:
> a) we might first notify userspace that an unknown
> device has appeared on the USB or other bus
The kernel emits a hotplug event for this today, on 2.4 and 2.5.
> b) we might then notify userspace that a major/minor
> has been created, i.e. there is a new usable device
The kernel emits a hotplug event for this today for some devices on 2.5.
I'm working on making that happen for all devices by the time we make it
to 2.6.
> So my understanding is that for a), we pretty much just want some
> simple-as-possible low-overhead single process that loads the right
> driver for the given device. This driver then creates 0-N major/minor.
Yes.
> For b), lots of apps might want to know, and they might be running in
> a user login session. For example, that's the point where your desktop
> might want to display a camera icon if you plug in a camera.
Exactly.
> Please correct this if I'm confused, because I really am an
> Xlib-and-above programmer most of the time. ;-)
>
> It seems to me that D-BUS is really nice for b), where we want to tell
> the user session about a new usable device. This is kind of the
> canonical purpose of D-BUS. But I'm not sure it's all that useful for
> a).
>
> The one exception is that as part of a), you might sometimes want to
> ask the user what driver to load. So you could use D-BUS for that.
> "Is this a mass storage device?" etc. Or more simply, D-BUS could be
> used to show an error message: "I don't know what you just plugged in,
> but I'm ignoring it." That way you don't plug in an unknown device and
> just get silence, you have some indication that the device works even
> if there's no driver.
>
> When people say "hotplug" do they mean both a) and b) or only a)?
Both. Well, traditionally only for a), as that's all we had. The stuff
for b) will show up in 2.5.68 and beyond.
> I'm a bit unclear on why you want multiple handlers for a) as people
> have discussed recently - my simplistic understanding is that all you
> can do with a device in phase a) is load a driver for it - so I think
> I'm missing some data.
Multiple handlers is just an easy way for different programs to be run
when the hotplug event is generated. Right now we have the following
things to do when a) happens:
- try to load a driver
- run devlabel
- load firmware if needed
- send D-BUS event for other programs to listen to.
- lots of custom devices want a script run
All of those tasks today have to patch the existing hotplug scripts in
order to get run (or just point /proc/sys/kernel/hotplug to their
program. I'm just trying to provide a framework that all of the above
can be done without steping on other's toes. Running all of the
programs linked in a directory solves this issue (much like the init.d
stuff).
Does that help out?
> Anyway, I've been trying to get some notes together on how devices
> might appear to the applications/desktop layer of the OS. They aren't
> really presentable, but part of the notes are the appended sketch of
> "what happens when plugging in a camera" - I'd love comments on it.
That all looks great, and reasonable. Nice job.
Now to implement it all... :)
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
next prev parent reply other threads:[~2003-04-18 22:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-08 4:37 communicating with user login sessions Havoc Pennington
2003-04-08 5:20 ` Greg KH
2003-04-17 23:50 ` David Brownell
2003-04-18 0:13 ` David Brownell
2003-04-18 5:39 ` Havoc Pennington
2003-04-18 5:51 ` Havoc Pennington
2003-04-18 22:40 ` Greg KH [this message]
2003-04-18 23:45 ` David Brownell
2003-04-19 0:49 ` David Brownell
2003-04-19 1:24 ` Havoc Pennington
2003-04-19 1:30 ` Havoc Pennington
2003-04-19 1:43 ` Havoc Pennington
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=marc-linux-hotplug-105070556306038@msgid-missing \
--to=greg@kroah.com \
--cc=linux-hotplug@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;
as well as URLs for NNTP newsgroup(s).