Re: [PATCH 7/8] rfkill: add an "any radio" switch type andfunctionality

From: Henrique de Moraes Holschuh
Date: Sun Apr 13 2008 - 13:40:25 EST


On Sat, 12 Apr 2008, Pavel Machek wrote:
> On Fri 2008-04-11 17:37:23, Henrique de Moraes Holschuh wrote:
> > Add a RFKILL_TYPE_ANY switch. This switch can control more than one type
> > of radio, and it is always subject to toggling by any type of rfkill-input
> > event. It is suitable to implement kill-all-radios functionality when
> > coupled with input event EV_SW SW_RADIO.
>
> Hmm, how does that work with pcmcia ethernet card plugged in?

I assume you mean PCMCIA WLAN card.

1. The hardware switch can't kill the WLAN card directly (so, unless
software does something, the radio in the PCMCIA card ignores the
switch).

2. But the hardware switch it is a master switch, so it will issue an
input event, which, IF THE USER WANTS IT TO WORK will be either acted
upon by rfkill-input or userspace.

3. rfkill-input or userspace will tell rfkill to switch all WLAN cards
on or off, because of that input event.

4. The WLAN driver bound to the pcmcia WLAN device gets that command and
changes the radio state.

So, from the user PoV, the PCMCIA WLAN card ends up responding to the
hardware switch, which is better behaviour even than what Windows could
do :p

> How does userspace know which radios this controls?

It doesn't. Not even the hardware knows :) let alone the drivers...

Which is why we shall try to make all master switches of a given type
control all radios of the same type, so you can at least have some idea
of what happens... and then the answer becomes "all radios of the same
type/class", except for those whose drivers didn't implement an rfkill
interface.

--
"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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/