Many computer systems contain radio transmissions, including Wi-Fi, Bluetooth, and 3G devices. These devices consume power and are wasteful when they are not used.
Rfkill is a subsystem in the Linux kernel that provides an interface to query, activate, and deactivate radio transmissions in the computer system. When you deactivate a transfer, you can leave it in a state that can be reactivated by the software (a soft lock) or place it in a location where the software cannot be reactivated (hard lock).
The Rfkill kernel provides an application programming interface (API) for subsystems. Kernel drivers are designed to support Rfkill use this API to register the kernel and include methods to enable and disable this device. In addition, the Rfkill kernel provides a way for users to interpret notifications and to query the transmission status of user programs.
The Rfkill interface is located in/dev/rfkill, which contains the current state of all radio transmissions in the system. Each device registers the current Rfkill state in Sysfs. In addition, Rfkill emits uevents whenever the status changes in a Rfkill-enabled device.
Rfkill is a command-line tool that you can use to query and change Rfkill-enabled devices in your system. To obtain this tool, install the Rfkill package.
Hardware environment: Freescale IMX6Q Development Board
System Environment: linux-3.14.52
Cross-compilation tool: ARM-LINUX-GNUEABIHF-GCC version 4.9.2
Command installation process:
1. Kernel configuration
Make Menuconfig Arch=arm
1.1 Networking Support->
1.2 Networking SUPPORT->RF Switch subsystem support
1.3 At this point, the Linux system will automatically generate/dev/rfkill this virtual device file when it starts.
2. BusyBox Configuration
2.1Miscellaneous utilities->
2.2 This will generate the Rfkill command
3. Use command Rfkill
List gets the device listing, each containing the index number associated with it, starting at 0. You can use this index number to let Rfkill stop using or use a device, for example:
Rfkill Block 0
Deactivate the first Rfkill-enabled device in the system.
You can also use Rfkill to block a certain type of device, or all Rfkill enabled devices. For example:
Rfkill Block WiFi
Deactivate all Wi-Fi devices in the system. To deactivate all Rfkill enabled devices, run:
Rfkill Block All
To reuse your device, run Rfkill
unblock, not rfkill.
Block To obtain a list of complete device categories that Rfkill can deactivate, run Rfkill
Help