Commit 621cac85 authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

rfkill: remove user_claim stuff



Almost all drivers do not support user_claim, so remove it
completely and always report -EOPNOTSUPP to userspace. Since
userspace cannot really drive rfkill _anyway_ (due to the
odd restrictions imposed by the documentation) having this
code is just pointless.

Signed-off-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c1c6b14b
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -521,16 +521,12 @@ status of the system.
Input devices may issue events that are related to rfkill.  These are the
various KEY_* events and SW_* events supported by rfkill-input.c.

******IMPORTANT******
When rfkill-input is ACTIVE, userspace is NOT TO CHANGE THE STATE OF AN RFKILL
SWITCH IN RESPONSE TO AN INPUT EVENT also handled by rfkill-input, unless it
has set to true the user_claim attribute for that particular switch.  This rule
is *absolute*; do NOT violate it.
******IMPORTANT******

Userspace must not assume it is the only source of control for rfkill switches.
Their state CAN and WILL change due to firmware actions, direct user actions,
and the rfkill-input EPO override for *_RFKILL_ALL.
Userspace may not change the state of an rfkill switch in response to an
input event, it should refrain from changing states entirely.

Userspace cannot assume it is the only source of control for rfkill switches.
Their state can change due to firmware actions, direct user actions, and the
rfkill-input EPO override for *_RFKILL_ALL.

When rfkill-input is not active, userspace must initiate a rfkill status
change by writing to the "state" attribute in order for anything to happen.
+0 −1
Original line number Diff line number Diff line
@@ -1267,7 +1267,6 @@ static int ath_init_sw_rfkill(struct ath_softc *sc)
	sc->rf_kill.rfkill->data = sc;
	sc->rf_kill.rfkill->toggle_radio = ath_sw_toggle_radio;
	sc->rf_kill.rfkill->state = RFKILL_STATE_UNBLOCKED;
	sc->rf_kill.rfkill->user_claim_unsupported = 1;

	return 0;
}
+0 −1
Original line number Diff line number Diff line
@@ -139,7 +139,6 @@ void b43_rfkill_init(struct b43_wldev *dev)
	rfk->rfkill->state = RFKILL_STATE_UNBLOCKED;
	rfk->rfkill->data = dev;
	rfk->rfkill->toggle_radio = b43_rfkill_soft_toggle;
	rfk->rfkill->user_claim_unsupported = 1;

	rfk->poll_dev = input_allocate_polled_device();
	if (!rfk->poll_dev) {
+0 −1
Original line number Diff line number Diff line
@@ -142,7 +142,6 @@ void b43legacy_rfkill_init(struct b43legacy_wldev *dev)
	rfk->rfkill->state = RFKILL_STATE_UNBLOCKED;
	rfk->rfkill->data = dev;
	rfk->rfkill->toggle_radio = b43legacy_rfkill_soft_toggle;
	rfk->rfkill->user_claim_unsupported = 1;

	rfk->poll_dev = input_allocate_polled_device();
	if (!rfk->poll_dev) {
+0 −1
Original line number Diff line number Diff line
@@ -91,7 +91,6 @@ int iwl_rfkill_init(struct iwl_priv *priv)
	priv->rfkill->data = priv;
	priv->rfkill->state = RFKILL_STATE_UNBLOCKED;
	priv->rfkill->toggle_radio = iwl_rfkill_soft_rf_kill;
	priv->rfkill->user_claim_unsupported = 1;

	priv->rfkill->dev.class->suspend = NULL;
	priv->rfkill->dev.class->resume = NULL;
Loading