From: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
To: Tony Vroon <tony@linx.net>
Cc: Ivo van Doorn <ivdoorn@gmail.com>,
linux-acpi@vger.kernel.org, jwoithe@physics.adelaide.edu.au,
Peter Gruber <nokos@gmx.net>
Subject: Re: Fuijtsu Lifebook RFKILL support
Date: Fri, 12 Dec 2008 17:53:31 -0200 [thread overview]
Message-ID: <20081212195331.GA12679@khazad-dum.debian.net> (raw)
In-Reply-To: <1229046602.4030.13.camel@localhost>
On Fri, 12 Dec 2008, Tony Vroon wrote:
> On Thu, 2008-12-11 at 17:47 -0200, Henrique de Moraes Holschuh
> wrote:
> > I don't think so if you mean Gnome knowing what to do with EV_SW
> > SW_RFKILL_ALL. That is not a report that radios got rfkilled, but
> > rather a COMMAND to rfkill all radios.
>
> Right, so are we talking across purposes here?
Probably. You still need to generate that SW_RFKILL_ALL input event
anyway, btw, so that the rest of rfkill can know when the user wants
all radios killed.
> I want to report radio status to userland so NetworkManager can stop
> helplessly flailing around asking me for a WPA2 password in a loop
> if I kill the radios.
That is a bug somewhere, and at first glance it looks to be either in
the wireless network driver, wpa_supplicant, or network manager. It
needs to be fixed, not worked around.
What is the WLAN driver involved? Is it rfkill-aware?
> What I have is an event-driven report that includes radio killswitch
> status, HARD_BLOCKED or UNBLOCKED in rfkill terminology. There is no
> SOFT_BLOCKED as I have no ability to turn individual radios on/off
> in software.
Whatever WLAN driver you use (which is not your Fujitsu Lifebook
platform driver) should just get complete rfkill support, and Network
Manager and wpa_supplicant have to do nonbraindamaged things when the
radio is rfkilled. So let's ignore it.
Just to make a point clear, you CAN ask HAL people to provide an OSD
notification keyed on uevents sent by rfkill-input. It is completely
correct to say "Radio kill switch active" and "Radio kill switch
inactive" from some uevents rfkill-input generates (or will generate,
I will check if I sent the patch already). It would still not mean
all devices have been rfkilled, but at least it shows the truth from
the point of view of the rfkill core and that has a higher chance of
being true than keying OSD on input events that nobody might be
listening to.
I hope the above takes care of the "I want user feedback when the
rfkill switch changes state" side. That leaves your question about
attaching rfkill classes to phantom BT and WWAN devices inside your
platform driver.
BT and WWAN rfkilling are basically implemented in two possible ways,
AFAIK:
WARNING: THE STUFF BELOW IS FOR PLATFORM DRIVERS, NOT NETWORK DEVICE
DRIVERS. NETWORK DEVICE DRIVERS DO IT SLIGHTLY DIFFERENT.
1. rfkill actualy is/looks like a hotplug/hotunplug operation
1a. You can do it at will (or you can do it at will except when the
hardware switch is enforcing that they remain rfkilled):
Attach rfkill classes to platform devices if you know this is
the best way to software-command this functionality.
Most notebooks go here for Bluetooth and WWAN. It is a pity
Fujitsu Lifebooks don't.
1b. You cannot do it at will
Attaching it to the rfkill core simply is not supported, and
even if you force the issue with a weird toggle_radio(), you'd
end up with a device that causes annoying behaviour every time
you want to change its rfkill state. So, I cannot recommend
it.
The user knows if the radios are around or not from whatever
hotplug subsystem they are tied to (PCI, USB), and that's what
should be issuing events the user can see (only they will be of
the "hardware connected/disconnected" sort, and not of the
"radio killed" sort.
2. rfkill doesn't mess with the device existence, it just disables
energy output:
2a. You can do it at will (or you can do it at will except when the
hardware switch is enforcing that they remain rfkilled):
You attach it to the rfkill core using a rfkill class, unless
there is a better place to do it. Usually, there isn't.
This is rare, as BT and WWAN are usually of type 1a, and WLAN
is usually of type 2b.
2b. You cannot do it at will
The rfkill class is to be attached to the device driver for that
device, i.e. something in the bluetooth subsystem, USB subsystem
or a wireless network driver.
> Should I be creating individual Bluetooth/WLAN/WWAN rfkills that flip
> between HARD_BLOCKED & UNBLOCKED with force status and return failure
> for a radio state change attempt?
Like I said, that's probably quite not nice for the user, and might
cause very annoying behaviour on userspace applications. The rfkill
core won't care for it either, but it won't break.
However do NOT do it for WLAN. Almost every WLAN device knows quite
well if it is being rfkilled or not by a hardware rfkill line, and it
is their business to report it. And the wireless network drivers are
being ported to connect to the rfkill core.
> But perhaps code talks, let me just attach what I have right now. Both
Not really in this case, no. It is not a case of coding it right,
after all... I will look over the input device stuff in a separate
reply.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
next prev parent reply other threads:[~2008-12-12 19:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-11 1:05 Fuijtsu Lifebook RFKILL support Tony Vroon
2008-12-11 1:20 ` Jonathan Woithe
2008-12-11 1:31 ` Tony Vroon
2008-12-11 1:44 ` Jonathan Woithe
2008-12-11 16:52 ` Henrique de Moraes Holschuh
2008-12-11 17:33 ` Tony Vroon
2008-12-11 19:47 ` Henrique de Moraes Holschuh
2008-12-12 1:50 ` Tony Vroon
2008-12-12 19:53 ` Henrique de Moraes Holschuh [this message]
2008-12-12 20:33 ` Len Brown
2008-12-13 12:47 ` Tony Vroon
2008-12-13 13:28 ` Henrique de Moraes Holschuh
2008-12-13 17:57 ` Matthew Garrett
2008-12-13 20:55 ` Tony Vroon
2008-12-13 21:24 ` Matthew Garrett
2008-12-14 3:13 ` Henrique de Moraes Holschuh
2008-12-14 17:05 ` Dan Williams
2008-12-15 11:53 ` Henrique de Moraes Holschuh
[not found] ` <20081215115336.GD17648-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2008-12-15 15:19 ` Dan Williams
2008-12-15 17:14 ` Tony Vroon
2008-12-15 17:59 ` Dan Williams
2008-12-16 13:50 ` Tony Vroon
2008-12-16 15:23 ` Dan Williams
2008-12-15 23:42 ` Jonathan Woithe
2008-12-15 23:48 ` Tony Vroon
2008-12-16 0:02 ` Jonathan Woithe
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=20081212195331.GA12679@khazad-dum.debian.net \
--to=hmh@hmh.eng.br \
--cc=ivdoorn@gmail.com \
--cc=jwoithe@physics.adelaide.edu.au \
--cc=linux-acpi@vger.kernel.org \
--cc=nokos@gmx.net \
--cc=tony@linx.net \
/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