···99Introduction1010============11111212-The rfkill subsystem provides a generic interface to disabling any radio1212+The rfkill subsystem provides a generic interface for disabling any radio1313transmitter in the system. When a transmitter is blocked, it shall not1414radiate any power.1515···4545 * the rfkill drivers.46464747The rfkill core provides API for kernel drivers to register their radio4848-transmitter with the kernel, methods for turning it on and off and, letting4848+transmitter with the kernel, methods for turning it on and off, and letting4949the system know about hardware-disabled states that may be implemented on5050the device.5151···5454section below.55555656When the device is hard-blocked (either by a call to rfkill_set_hw_state()5757-or from query_hw_block) set_block() will be invoked for additional software5757+or from query_hw_block), set_block() will be invoked for additional software5858block, but drivers can ignore the method call since they can use the return5959value of the function rfkill_set_hw_state() to sync the software state6060instead of keeping track of calls to set_block(). In fact, drivers should···6565Kernel API6666==========67676868-6968Drivers for radio transmitters normally implement an rfkill driver.70697170Platform drivers might implement input devices if the rfkill button is just···74757576For some platforms, it is possible that the hardware state changes during7677suspend/hibernation, in which case it will be necessary to update the rfkill7777-core with the current state is at resume time.7878+core with the current state at resume time.78797980To create an rfkill driver, driver's Kconfig needs to have::80818182 depends on RFKILL || !RFKILL82838384to ensure the driver cannot be built-in when rfkill is modular. The !RFKILL8484-case allows the driver to be built when rfkill is not configured, which8585+case allows the driver to be built when rfkill is not configured, in which8586case all rfkill API can still be used but will be provided by static inlines8687which compile to almost nothing.8788···9091assign the poll_hw_block() callback (then the rfkill core will poll the9192device). Don't do this unless you cannot get the event in any other way.92939393-RFKill provides per-switch LED triggers, which can be used to drive LEDs9494+rfkill provides per-switch LED triggers, which can be used to drive LEDs9495according to the switch state (LED_FULL when blocked, LED_OFF otherwise).95969697···113114hotplugged devices.114115115116After an application opens /dev/rfkill, it can read the current state of all116116-devices. Changes can be either obtained by either polling the descriptor for117117+devices. Changes can be obtained by either polling the descriptor for117118hotplug or state change events or by listening for uevents emitted by the118119rfkill core framework.119120···126127 RFKILL_STATE127128 RFKILL_TYPE128129129129-The contents of these variables corresponds to the "name", "state" and130130+The content of these variables corresponds to the "name", "state" and130131"type" sysfs files explained above.131131-132132133133For further details consult Documentation/ABI/stable/sysfs-class-rfkill.