Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111720
b: refs/heads/master
c: bed7aac
h: refs/heads/master
v: v3
  • Loading branch information
Henrique de Moraes Holschuh authored and John W. Linville committed Sep 15, 2008
1 parent 67b335e commit 228b475
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e35cc4ddcc4c3b11006bcabe8ce28aa7e18da318
refs/heads/master: bed7aac9416f50425d2200df32bcc9bf248ff8cb
32 changes: 28 additions & 4 deletions trunk/Documentation/rfkill.txt
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ key that does nothing by itself, as well as any hot key that is type-specific
3.1 Guidelines for wireless device drivers
------------------------------------------

(in this text, rfkill->foo means the foo field of struct rfkill).

1. Each independent transmitter in a wireless device (usually there is only one
transmitter per device) should have a SINGLE rfkill class attached to it.

Expand All @@ -363,10 +365,32 @@ This rule exists because users of the rfkill subsystem expect to get (and set,
when possible) the overall transmitter rfkill state, not of a particular rfkill
line.

5. During suspend, the rfkill class will attempt to soft-block the radio
through a call to rfkill->toggle_radio, and will try to restore its previous
state during resume. After a rfkill class is suspended, it will *not* call
rfkill->toggle_radio until it is resumed.
5. The wireless device driver MUST NOT leave the transmitter enabled during
suspend and hibernation unless:

5.1. The transmitter has to be enabled for some sort of functionality
like wake-on-wireless-packet or autonomous packed forwarding in a mesh
network, and that functionality is enabled for this suspend/hibernation
cycle.

AND

5.2. The device was not on a user-requested BLOCKED state before
the suspend (i.e. the driver must NOT unblock a device, not even
to support wake-on-wireless-packet or remain in the mesh).

In other words, there is absolutely no allowed scenario where a driver can
automatically take action to unblock a rfkill controller (obviously, this deals
with scenarios where soft-blocking or both soft and hard blocking is happening.
Scenarios where hardware rfkill lines are the only ones blocking the
transmitter are outside of this rule, since the wireless device driver does not
control its input hardware rfkill lines in the first place).

6. During resume, rfkill will try to restore its previous state.

7. After a rfkill class is suspended, it will *not* call rfkill->toggle_radio
until it is resumed.


Example of a WLAN wireless driver connected to the rfkill subsystem:
--------------------------------------------------------------------
Expand Down
16 changes: 2 additions & 14 deletions trunk/net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,21 +512,9 @@ static void rfkill_release(struct device *dev)
#ifdef CONFIG_PM
static int rfkill_suspend(struct device *dev, pm_message_t state)
{
struct rfkill *rfkill = to_rfkill(dev);

if (dev->power.power_state.event != state.event) {
if (state.event & PM_EVENT_SLEEP) {
/* Stop transmitter, keep state, no notifies */
update_rfkill_state(rfkill);

mutex_lock(&rfkill->mutex);
rfkill->toggle_radio(rfkill->data,
RFKILL_STATE_SOFT_BLOCKED);
mutex_unlock(&rfkill->mutex);
}

/* mark class device as suspended */
if (dev->power.power_state.event != state.event)
dev->power.power_state = state;
}

return 0;
}
Expand Down

0 comments on commit 228b475

Please sign in to comment.