2

When installing a Ubuntu, Manjaro or other Graphical Linux distro on laptop, when press the airplane mode button on laptop, Airplane mode can be enabled.

How the concept of airplane mode works in Linux distro?

Is it just a set of rule toward Bluetooth, and wifi and other wireless stuff?

Does the implementation of airplane mode control appears in window manager, network manager or x11 or somewhere else?

Is there any one who can provide a explanation (high level) of the mechanism of airplane mode control in a specific system (KDE/Linux, Gnome/Linux or the other common system)?

  • What is the make, model, and serial number of your system? This issue is most likely extremely dependent on your hardware info. Without it, we can do very little to assist. – 0xSheepdog Apr 6 at 0:10
  • 1
    @0xSheepdog, I am just trying to figure out the high level (general) stuff instead of detailed hardware operation. I am focused on the structure of how the software works. – davmos Apr 6 at 0:18
3

Mostly, "Airplane mode" means to disconnect any radio ("wireless") connections, AND stop sending any active probes to find possible connections.

On most Linux systems, Wi-Fi network connections are managed through NetworkManager. Other wireless network connection managers are available.

Additionally, there is a concept called RFKILL. RFKILL means to cut off a certain radio transmitter. In some cases, higher layers such as a Wi-Fi driver might be aware of RFKILL, and return the specific error code ERFKILL, "Operation not possible due to RF-kill". For example the command iw dev wlp2s0 scan might return this error.

Airplane Mode in Gnome Shell, or other GUI systems, will activate RFKILL if the hardware supports it. However, your GUI might let you enable Airplane mode even if you do not have RFKILL controls for all your radios... Partly because the GUI cannot reliably tell the association between RFKILL controls and radio devices :-).

In Gnome Shell, the Airplane mode button on the keyboard is just a keyboard shortcut to toggle Airplane mode. When Airplane mode is enabled, I can also see a button in the corner menu which allows to turn it back off.

Some other GUIs use nm-applet to provide their GUI for NetworkManager. I think nm-applet had some way to disable Wi-Fi, but beyond that I am not sure exactly what features it provides.

Additionally, RFKILL might be a physical switch which the Operating System can only read, i.e. the hardware/firmware might not allow it to be overridden. This is called "hard rfkill". When the Operating System has control, it is called "soft rfkill".

As the link above explains, you can use the rfkill command. rfkill list, or simply rfkill, will let you see if a hard rfkill is active, and what the device name is.

You can also look in /sys/class/rfkill/. If you know how to inspect /sys/, you can find the name of the driver which exposes a given RFKILL control. E.g.

$ cd /sys/class/rfkill
$ ls
rfkill1  rfkill2  rfkill3  rfkill8
$ grep -H . */name
rfkill1/name:dell-wifi
rfkill2/name:dell-bluetooth
rfkill3/name:phy0
rfkill8/name:hci0
$ ls -l
total 0
lrwxrwxrwx. 1 root root 0 Apr  6 10:03 rfkill1 -> ../../devices/platform/dell-laptop/rfkill/rfkill1
lrwxrwxrwx. 1 root root 0 Apr  6 10:03 rfkill2 -> ../../devices/platform/dell-laptop/rfkill/rfkill2
lrwxrwxrwx. 1 root root 0 Apr  6 10:03 rfkill3 -> ../../devices/pci0000:00/0000:00:1c.3/0000:02:00.0/ieee80211/phy0/rfkill3
lrwxrwxrwx. 1 root root 0 Apr  6 15:53 rfkill8 -> ../../devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/rfkill8
$ readlink rfkill8
../../devices/pci0000:00/0000:00:1d.0/usb1/1-1/1-1.3/1-1.3:1.0/bluetooth/hci0/rfkill8
$ cd rfkill8
$ readlink device
../../hci0
$ cd device
$ readlink driver
$ cd device
$ readlink driver
../../../../../../../bus/usb/drivers/btusb
$ cd driver
$ readlink module
../../../../module/btusb

Bluetooth

Gnome one of the most integrated Linux GUI systems, and it includes support for Bluetooth. I can see that Airplane mode on my Gnome system activates RFKILL for Bluetooth. Optimistically, I guess that even if the Bluetooth device has no RFKILL control, Gnome's Airplane mode will stop any Bluetooth connections. (And also, stop sending any active probes to find possible Bluetooth connections). My system has a distinct process called bluetoothd, which I assume has some responsibility for managing Bluetooth devices. However this is all a bit mysterious to me.

Problem with "Airplane mode"

Historically, the most common problem with Airplane mode, or similar features, is that you accidentally activated it when you did not mean to, e.g. by pressing a keyboard button. Then your Wi-Fi does not work, and you might not know why or how to fix it. However, my current Gnome shell is pretty good about soft rfkill. If Airplane mode is enabled, the Wi-Fi menu shows "Wi-Fi off". Clicking on "select a network" in the Wi-Fi menu shows a big notice that Airplane mode is enabled, and gives you a button to immediately disable Airplane mode.

  • Beside, control the air mode via click the icon of applet, it can be also done via airmode key on keyboard. Is that just a simple mapping to the certain part of gui like Ctrl-C or Ctrl-V? – davmos Apr 9 at 22:10
  • @davmos Yes, if I understand your question correctly. Although volume keys might be a better comparison, assuming you have them :-). I tried to make it clear already - "In Gnome shell, the Airplane mode button on the keyboard is just a keyboard shortcut to toggle Airplane mode." – sourcejedi Apr 9 at 22:42
  • sorry about that. – davmos Apr 17 at 22:16
0

Is (Airplane mode) just a set of rule toward Bluetooth, and wifi and other wireless stuff?

Yes it just turns off networking. Read the Wikipedia artical.

Does the implementation of airmode control appears in window manager, network manager or x11 or somewhere else?

Desktop Environment.

If there is a problem in airmode control what part should I focus to figure out the problem?

It's a meta feature so you can ignore the issue and disable/enable networks directly.

Comments from Gnome, and KDE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.