aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/rfkill.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/rfkill.txt')
-rw-r--r--Documentation/rfkill.txt25
1 files changed, 21 insertions, 4 deletions
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt
index 0843ed0163a5..6fcb3060dec5 100644
--- a/Documentation/rfkill.txt
+++ b/Documentation/rfkill.txt
@@ -363,6 +363,11 @@ This rule exists because users of the rfkill subsystem expect to get (and set,
363when possible) the overall transmitter rfkill state, not of a particular rfkill 363when possible) the overall transmitter rfkill state, not of a particular rfkill
364line. 364line.
365 365
3665. During suspend, the rfkill class will attempt to soft-block the radio
367through a call to rfkill->toggle_radio, and will try to restore its previous
368state during resume. After a rfkill class is suspended, it will *not* call
369rfkill->toggle_radio until it is resumed.
370
366Example of a WLAN wireless driver connected to the rfkill subsystem: 371Example of a WLAN wireless driver connected to the rfkill subsystem:
367-------------------------------------------------------------------- 372--------------------------------------------------------------------
368 373
@@ -390,9 +395,10 @@ rfkill lines are inactive, it must return RFKILL_STATE_SOFT_BLOCKED if its soft
390rfkill input line is active. Only if none of the rfkill input lines are 395rfkill input line is active. Only if none of the rfkill input lines are
391active, will it return RFKILL_STATE_UNBLOCKED. 396active, will it return RFKILL_STATE_UNBLOCKED.
392 397
393If it doesn't implement the get_state() hook, it must make sure that its calls 398Since the device has a hardware rfkill line, it IS subject to state changes
394to rfkill_force_state() are enough to keep the status always up-to-date, and it 399external to rfkill. Therefore, the driver must make sure that it calls
395must do a rfkill_force_state() on resume from sleep. 400rfkill_force_state() to keep the status always up-to-date, and it must do a
401rfkill_force_state() on resume from sleep.
396 402
397Every time the driver gets a notification from the card that one of its rfkill 403Every time the driver gets a notification from the card that one of its rfkill
398lines changed state (polling might be needed on badly designed cards that don't 404lines changed state (polling might be needed on badly designed cards that don't
@@ -422,13 +428,24 @@ of the hardware is unknown), or read-write (where the hardware can be queried
422about its current state). 428about its current state).
423 429
424The rfkill class will call the get_state hook of a device every time it needs 430The rfkill class will call the get_state hook of a device every time it needs
425to know the *real* current state of the hardware. This can happen often. 431to know the *real* current state of the hardware. This can happen often, but
432it does not do any polling, so it is not enough on hardware that is subject
433to state changes outside of the rfkill subsystem.
434
435Therefore, calling rfkill_force_state() when a state change happens is
436mandatory when the device has a hardware rfkill line, or when something else
437like the firmware could cause its state to be changed without going through the
438rfkill class.
426 439
427Some hardware provides events when its status changes. In these cases, it is 440Some hardware provides events when its status changes. In these cases, it is
428best for the driver to not provide a get_state hook, and instead register the 441best for the driver to not provide a get_state hook, and instead register the
429rfkill class *already* with the correct status, and keep it updated using 442rfkill class *already* with the correct status, and keep it updated using
430rfkill_force_state() when it gets an event from the hardware. 443rfkill_force_state() when it gets an event from the hardware.
431 444
445rfkill_force_state() must be used on the device resume handlers to update the
446rfkill status, should there be any chance of the device status changing during
447the sleep.
448
432There is no provision for a statically-allocated rfkill struct. You must 449There is no provision for a statically-allocated rfkill struct. You must
433use rfkill_allocate() to allocate one. 450use rfkill_allocate() to allocate one.
434 451