Rfkill and rfkill in Linux

Source: Internet
Author: User

Rfkill and rfkill in Linux

Rfkill

 

Rfkill, in which rf is Radio frequency (rf), which is mainly used to manage the switch subsystem, for example, you can easily switch Airplane/BT/WiFi/Data/GPS on the notification bar of your Android phone, which is very convenient to use. However, this is the unified implementation of the upper layer of the Android system. The corresponding Linux kernel has not been uniformly implemented before. As this situation increases, there are dedicated subsystems to implement this function in a centralized manner. This is exactly the work of rfkill.

In the above control examples, each of their functions may be a revolution when invented, and the principle or even configuration may be quite complex, but for the end users, the most commonly used is the "Switch 」.

 

Use this example to listen to the hardware changes of the wireless network adapter:

 

$ Rfkill

Usage: rfkill [options] command

Options:

-- Version show version (0.4-1ubuntu3 (Ubuntu ))

Commands:

Help

Event

List [IDENTIFIER]

Block IDENTIFIER

Unblock IDENTIFIER

Where IDENTIFIER is the index no. of an rfkill switch or one:

<Idx> all Wi-Fi wlan bluetooth uwb ultrawideband wimax wwan gps fm

$ Rfkill event

1412007426.882932: idx 0 type 1 op 0 soft 0 hard 0

1412007465.911313: idx 0 type 1 op 2 soft 0 hard 1

1412007605.911553: idx 0 type 1 op 2 soft 0 hard 0

1412007705.911463: idx 0 type 1 op 2 soft 0 hard 1

1412007715.911449: idx 0 type 1 op 2 soft 0 hard 0

$

 

After implementing the complex feature-driven driver, it is better to improve the rfkill driver. Rfkill is just a class in the new sys file system. In/sys/class/rfkill /. Because of its small size, there are not so many things to be mentioned, but it has caused a series of experiences that are worrying about and focuses on writing them down.

 

Written below:

 

The source of this study was a strange phenomenon when a BT driver was transplanted. Because only the system version is upgraded (from Android4.2 to Android4.4), you can determine that the hardware is in good condition. The corresponding driver is configured first, and the BT test is normal after the system is burned. Out of the "don't confuse" mentality, I decided to test it. After removing the BT option in the kernel, the test result BT is indeed unavailable; after adding the driver configuration, it was unexpectedly discovered that it still could not be enabled normally. Then immediately roll back the version and test the kernel. the device is successfully turned on. I started to think about it. Why is the configuration of BT IC broken by my software? In the case of such a strange incident, the answer is generally in the toilet or on the way to the toilet. I have to look for it and wash my face by the way. The probability is higher.

 

The toilet gave me some advice. First, check whether there is any problem with the BT hardware IC and burn the system back to Android4.2 completely. The test result is normal. I was relieved, and then I used the second server to re-test the strange events and burned the previous system images in sequence. The phenomenon is the same as that of the first server. This is the time to be clever: once an image without a BT driver is run, then, the driver cannot be opened normally when the driver is installed with the BT driver. The BT chip has not been reset !!! This is my guess. I immediately got a power failure and got the power on again. The system image that contains the BT driver could not be opened normally.

 

Start with the previous verification results. When I re-burn the system image, I directly press the "restart key" (the hardware is called the reset key) to restart the system, it is found to cause a problem. Why didn't BT reset when I pressed the reset key? This is just an assumption that the multimeter is waiting! Regardless of how the circuit is connected, test the reset pin of BT directly. When the reset key is pressed, the voltage does not change from high to low. After this is confirmed, view the schematic diagram and find that the original reset pin of BT is not connected to the primary key, but to a GPIO of the CPU, then, based on the GPIO name, we can find out that the core driver of Android4.2 needs to be registered as the BT reset pin in rfkill. All problems can be solved after you do so.

 

I used to think that the reset pins of all the IC on a circuit board are all connected to the user's reset switch! I have known rfkill for a long time. The original bt ic has not been powered off and RESET, resulting in no way to enable it normally.


What is rfkill in linux?

This module is used to manage the wireless Nic switch of a notebook. It usually has a switch in the notebook to control the wireless Nic in the notebook. It can be enabled when necessary and disabled when not needed, saving power.

In linux, what is the difference between Ctrl + c and kill-9 and kill-15?

Ctrl + c is the command or script to terminate the current operation in the terminal window,
Kill-9 pid is force termination regardless of the consequences (If your speed is fast enough, sometimes it is the same as ctrl + c)
Kill-15 pid: first shut down the program related to it, and then shut it down

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.