From: Ivo van Doorn <ivdoorn@gmail.com>
To: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Cc: "Stephen Hemminger" <shemminger@linux-foundation.org>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
"John Linville" <linville@tuxdriver.com>,
"Jiri Benc" <jbenc@suse.cz>,
"Lennart Poettering" <lennart@poettering.net>,
"Johannes Berg" <johannes@sipsolutions.net>,
"Larry Finger" <Larry.Finger@lwfinger.net>
Subject: Re: [RFC] rfkill - Add support for input key to control wireless radio
Date: Sat, 31 Mar 2007 14:49:39 +0200 [thread overview]
Message-ID: <200703311449.40022.IvDoorn@gmail.com> (raw)
In-Reply-To: <d120d5000703301137m7ba7e3e4xb18aad1d1fc7c052@mail.gmail.com>
> > Well in drivers/net are the network drivers but not the irda and bluetooth drivers,
> > those are located in different folders in drivers/ so I think misc would be the most
> > suitable location.
>
> We could also consider the ./net itself. rfkill is not a driver, it is
> a facility.
True, in that case ./net would be good.
> > > Does this make sense?
> >
> > Yes, but what if the user loads both modules or has them both compiled in?
> > Shouldn't there be some protection against that, since both handlers should not
> > be active at the same time.
>
> Why not? evdev is just a delivery transport for input events to
> userspace. Even if user wants the kernel to control state of RF
> switches (which I expect most users woudl want) there still could be
> applications interested in knowing that used turned off wireless. And
> if userspace really wishes to control switch all by itself it can
> "claim" it.
Right, I forgot about that user_claim thingy. ;)
> I guess what you are missing is that input event generated by a device
> is pushed through every handler bound to the device so there is no way
> for a "wrong" handler to "steals" an event from "right" handler. They
> all work simultaneously.
>
> > > > personally I would prefer enforcing drivers to call
> > > > allocate()
> > > > register()
> > > > unregister()
> > > > free()
> > > >
> > > > Especially with unregister() doing the same steps as free() (put_device)
> > > > might be somwhat confusing. But might be just me. ;)
> > > >
> > >
> > > I know but for refcounted objects you can't really tell when they will
> > > actually be freed. It depends when their last user drops off.
> >
> > Then perhaps rfkill_register could call put_device() when it fails, and free()
> > can be removed entirely. That way it would we prevent some driver
> > to call free() anyway.
> >
>
> That would make error handling in ->probe() methods a bit unwieldy I
> think - if you are using the standard "goto err_xxx; goto err_yyy;"
> technique then you have to conditionally call rfkill_free(). Hovewer
> if register simply fails and does not free anything and you call
> rfkill_register() last (which you need to do because driver has to be
> almost fully functional to be able to serve toggle_radio calls) you
> can always call rfkill_free() if something fails.
Ok.
Well that would mean rfkill would be ready to applied to one of the kernel trees right? :)
The first user of rfkill would be rt2x00, which is in wireless-dev as well as -mm.
The second user could be the driver from Lennart, but I haven't heard from him quite a while
(although he is on the CC list) so I am not sure if his MSI driver can be fixed to use rfkill. His MSI
driver is already in the linus' tree.
A third user could be bcm43xx but I don't know how far they are with hardware key detection and
status reading (to make it work with rfkill), perhaps Larry could give more information about that.
Ivo
next prev parent reply other threads:[~2007-03-31 12:50 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-03 18:36 [RFC] rfkill - Add support for input key to control wireless radio Ivo van Doorn
2006-12-03 19:18 ` Arjan van de Ven
2006-12-03 22:03 ` Ivo van Doorn
2006-12-03 19:20 ` Arjan van de Ven
2006-12-03 22:05 ` Ivo van Doorn
2006-12-03 22:28 ` Ivo van Doorn
2006-12-05 0:18 ` Randy Dunlap
2006-12-05 21:20 ` Ivo van Doorn
2006-12-03 19:44 ` Dan Williams
2006-12-03 22:16 ` Ivo van Doorn
2006-12-04 8:53 ` Marcel Holtmann
2006-12-04 22:15 ` Dmitry Torokhov
2006-12-04 23:27 ` Ivo van Doorn
2006-12-06 14:37 ` Dmitry Torokhov
2006-12-06 15:18 ` Dan Williams
2006-12-06 15:24 ` Dmitry Torokhov
2006-12-06 19:31 ` Ivo van Doorn
2006-12-06 20:18 ` Dmitry Torokhov
2006-12-06 21:41 ` Ivo van Doorn
2006-12-06 22:04 ` Dmitry Torokhov
2006-12-07 21:53 ` Ivo van Doorn
2006-12-12 5:12 ` Dmitry Torokhov
2006-12-12 7:47 ` Ivo Van Doorn
2006-12-17 17:43 ` Ivo van Doorn
2007-01-30 16:33 ` Ivo van Doorn
2006-12-07 13:22 ` Dan Williams
2006-12-07 21:58 ` Ivo van Doorn
2006-12-06 22:05 ` Jiri Benc
2006-12-06 22:10 ` Dmitry Torokhov
2006-12-05 10:32 ` Christoph Hellwig
2006-12-05 21:21 ` Ivo van Doorn
2007-01-31 3:40 ` Stephen Hemminger
2007-01-31 10:39 ` Ivo van Doorn
2007-01-31 11:20 ` Ivo van Doorn
2007-03-30 5:27 ` Dmitry Torokhov
2007-03-30 5:29 ` Dmitry Torokhov
2007-03-30 14:59 ` Ivo van Doorn
2007-03-30 15:28 ` Dmitry Torokhov
2007-03-30 17:13 ` Ivo van Doorn
2007-03-30 18:37 ` Dmitry Torokhov
2007-03-31 12:49 ` Ivo van Doorn [this message]
2007-04-02 4:38 ` Dmitry Torokhov
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=200703311449.40022.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=dmitry.torokhov@gmail.com \
--cc=jbenc@suse.cz \
--cc=johannes@sipsolutions.net \
--cc=lennart@poettering.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.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).