From: Johannes Berg <johannes@sipsolutions.net>
To: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: "linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
Matthew Garrett <mjg@redhat.com>
Subject: Re: rfkill get_state
Date: Fri, 27 Mar 2009 22:16:03 +0100 [thread overview]
Message-ID: <1238188563.4452.21.camel@johannes.local> (raw)
In-Reply-To: <20090327150824.GC24288@khazad-dum.debian.net>
[-- Attachment #1: Type: text/plain, Size: 1793 bytes --]
On Fri, 2009-03-27 at 12:08 -0300, Henrique de Moraes Holschuh wrote:
> > It seems to me it'll only get called
> > * when you read sysfs
> > * on resume
> > * on epo
>
> Yes. It is mostly something that the rfkill core uses to get an up-to-date
> state when it knows it needs one, and it is not good for anything else.
Ouch, ok.
> > How do we ever react to a button press then to make a uevent?
>
> rfkill-related uevents exist to signal change in state of the rfkill
> switches, REGARDLESS of the reason. So they are NOT related to button
> presses, except in-so-far that a button press might have changed a rfkill
> switch state.
STOP WRITING ALL CAPS PLEASE. Look, I know that rfkill is related to the
button press, if that button affects the hw kill state.
> So, the short answer is: rfkill_force_state(). Call it when the radio
> rfkill state changed, and the core will generate uevents.
You do realise though that none of the platform drivers actually call
that, right?
> The core doesn't have any helpers for this, so if you need polling, for
> example, you do it in your driver and call rfkill_force_state() as needed.
OK -- IMHO the only reasonable thing is to actually add polling if
get_state is assigned -- anything else is pointless. I also don't see
how get_state is actually needed, drivers can just use force_state after
suspend/resume etc.
> Where does the button press enters the picture in your driver? Knowing
> that, I can illustrate how it would plug to rfkill core, or to the input
> device core (I am yet to see a case where it should be plugged to both).
I'm not actually interested in a driver. I need to integrate rfkill into
mac80211, and for that I need to rewrite it to have a usable API.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2009-03-27 21:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-27 13:40 rfkill get_state Johannes Berg
2009-03-27 15:08 ` Henrique de Moraes Holschuh
2009-03-27 21:16 ` Johannes Berg [this message]
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=1238188563.4452.21.camel@johannes.local \
--to=johannes@sipsolutions.net \
--cc=hmh@hmh.eng.br \
--cc=linux-wireless@vger.kernel.org \
--cc=mjg@redhat.com \
/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