Linux kernel wifi drivers

iwlwifi

iwlwifi is the wireless driver for Intel’s current wireless chips. Correct operation requires support from the kernel’s wifi stack and card specific firmware loaded at run time.

  • 1 Kernel
    • 1.1 IEEE 802.11
    • 1.2 Device driver iwlwifi
    • 2.1 When using built-in configuration
    • 2.2 Optional: savedconfig
    • 4.1 /sys file system
    • 4.2 ip command
    • 4.3 ifconfig command
    • 4.4 iw command
    • 4.5 modprobe and modinfo
    • 4.6 lspci
    • 4.7 dmesg
    • 5.1 Kernel not loaded
    • 5.2 Firmware issues
    • 5.3 Wireless not working
    • 5.4 No internet connection
    • 5.5 «Microcode SW error detected. Restarting 0x0» message in kernel logs

    Kernel

    To make it work some kernel configuration is needed. The driver supports 802.11a/b/g/n/ac (depending on the device), so IEEE 802.11 should be enabled.

    IEEE 802.11

    Activate at least cfg80211 ( CONFIG_CFG80211 ) and mac80211 ( CONFIG_MAC80211 ). For details see IEEE 802.11 section of Wi-Fi artice.

    Device driver iwlwifi

    Use this driver for Intel’s current wireless chips. Set it as a module as shown here. Also the correct DVM or MVM option according to the Module column of the firmware table is needed.

    Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> [*] Intel devices Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) Intel Wireless WiFi DVM Firmware support Intel Wireless WiFi MVM Firmware support

    Important
    In case the driver is built into the kernel ( ) instead as a module ( ), also the firmware needs to be built into the kernel. See the section When using built-in configuration.
    After changes on kernel configuration do not forget to rebuild the kernel.

    After rebuilding the kernel and rebooting with this kernel, the selected options can be verified as follows:

    Firmware

    Additional firmware for the individual device is needed as listed in this table. Contemporary firmware is always available in the sys-kernel/linux-firmware package. In case it is not in linux-firmware it might be found in device-specific sys-firmware/iwlxxxx-*ucode packages.

    Upstream Intel instructions recommend [1] adding all iwlwifi ucode to the kernel image. This is recommended for convenience, however it will bloat the kernel slightly.

    When using built-in configuration

    In case the driver is built into the kernel ( ) instead as a module ( ), also the firmware needs to be built into the kernel.

    Device Drivers ---> Generic Driver Options ---> Firmware loader ---> -*- Firmware loading facility (iwlwifi-xxxx.ucode) Build named firmware blobs into the kernel binary (/lib/firmware) Firmware blobs root directory [ ] Enable the firmware sysfs fallback mechanism

    In this case replace iwlwifi-xxxx.ucode with the exact firmware name. Some attention seems to be needed for FW_LOADER_USER_HELPER_FALLBACK .

    Optional: savedconfig

    The savedconfig USE flag could be set for Linux firmware in order to avoid unneeded stuff in /lib/firmware/ .

    As for example the Intel® Centrino® Advanced-N 6205 needs iwlwifi-6000g2a-ucode while anything else may be commented out or deleted.

    FILE /etc/portage/savedconfig/sys-kernel/linux-firmware Take care that version number is removed

     
    iwlwifi-6000g2a-5.ucode iwlwifi-6000g2a-6.ucode 

    In order to not lose these settings on next firmware update the version number needs to be removed:

    Network device names

    Network device names such as eth0 or wlan0 as provided by the kernel are normally changed on system boot (see dmesg ) by the /lib/udev/rules.d/80-net-name-slot.rules udev rule.

    To keep the classic naming this rule can be overwritten with an equally named empty file in the /etc/udev/rules.d directory:

    Testing

    After a reboot with the new kernel or after loading the modules, the device can be checked for availability by using following methods:

    /sys file system

    Get the device name by listing the /sys/class/net directory contents using ls -al or the tree command (provided by the app-text/tree package):

    /sys/class/net/ ├── enp2s14 -> ../../devices/pci0000:00/0000:00:1e.0/0000:02:0e.0/net/enp2s14 ├── lo -> ../../devices/virtual/net/lo ├── sit0 -> ../../devices/virtual/net/sit0 └── wlp8s0 -> ../../devices/pci0000:00/0000:00:1c.0/0000:08:00.0/net/wlp8s0

    ip command

    To obtain the device name and verify that the wireless card is detected, execute the following ip command:

    ifconfig command

    The ifconfig command is provided through the sys-apps/net-tools package. Use ifconfig -a to list all detected network cards, even those that are not enabled/active yet:

    A network card can be activated as follows:

    SIOCSIFFLAGS: Operation not possible due to RF-kill WARNING: at least one error occurred. (-1)

    In this example, enabling the wireless card failed as a radio frequency kill state is set (usually to keep power consumption at bay and not connect by accident to a wireless network).

    iw command

    If the wireless network card driver supports the nl80211 stack, then the iw command as offered by the net-wireless/iw package can show the detected wireless cards:

    phy#0 Interface wlan0 ifindex 4 type managed

    modprobe and modinfo

    modprobe should return nothing:

    Most information about the driver module can be obtained by modinfo iwlwifi :

    lspci

    lspci should display iwlwifi for both Kernel driver in use: and Kernel modules: .

    03:00.0 Network controller [0280]: Intel Corporation Centrino Advanced-N 6205 [Taylor Peak] [8086:0082] (rev 34) Subsystem: Intel Corporation Centrino Advanced-N 6205 AGN [8086:1321] Flags: bus master, fast devsel, latency 0, IRQ 33 Memory at f7d00000 (64-bit, non-prefetchable) [size=8K] Capabilities: [c8] Power Management version 3 Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+ Capabilities: [e0] Express Endpoint, MSI 00 Capabilities: [100] Advanced Error Reporting Capabilities: [140] Device Serial Number confidential Kernel driver in use: iwlwifi Kernel modules: iwlwifi

    The xx:xx.x identifier will be useful for grepping specific information from dmesg.

    dmesg

    Check the output of dmesg. Replace 03:00.0 with the identifier from lspci and wlp with the network interface name.

    [ 0.251986] pci 0000:03:00.0: [8086:0082] type 00 class 0x028000 [ 0.252146] pci 0000:03:00.0: reg 0x10: [mem 0xf7d00000-0xf7d01fff 64bit] [ 0.252863] pci 0000:03:00.0: PME# supported from D0 D3hot D3cold [ 3.621978] cfg80211: Loading compiled-in X.509 certificates for regulatory database [ 3.629362] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' [ 3.634986] iwlwifi 0000:03:00.0: enabling device (0100 -> 0102) [ 3.635111] iwlwifi 0000:03:00.0: can't disable ASPM; OS doesn't have ASPM control [ 3.644480] iwlwifi 0000:03:00.0: loaded firmware version 18.168.6.1 op_mode iwldvm [ 3.659269] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUG disabled [ 3.659270] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEBUGFS disabled [ 3.659271] iwlwifi 0000:03:00.0: CONFIG_IWLWIFI_DEVICE_TRACING enabled [ 3.659273] iwlwifi 0000:03:00.0: Detected Intel(R) Centrino(R) Advanced-N 6205 AGN, REV=0xB0 [ 3.694543] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs' [ 3.695812] iwlwifi 0000:03:00.0 wlp3s0: renamed from wlan0 [ 5.060307] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0 [ 5.352853] iwlwifi 0000:03:00.0: Radio type=0x1-0x2-0x0 [ 5.431804] IPv6: ADDRCONF(NETDEV_UP): wlp3s0: link is not ready [ 8.908518] wlp3s0: authenticate with [ 8.912238] wlp3s0: send auth to (try 1/3) [ 9.016437] wlp3s0: send auth to (try 2/3) [ 9.120455] wlp3s0: send auth to (try 3/3) [ 9.125773] wlp3s0: authenticated [ 9.126019] wlp3s0: waiting for beacon from [ 9.148418] wlp3s0: associate with (try 1/3) [ 9.191232] wlp3s0: RX AssocResp from (capab=0x1431 status=0 aid=2) [ 9.211860] wlp3s0: associated [ 9.242532] IPv6: ADDRCONF(NETDEV_CHANGE): wlp3s0: link becomes ready [ 9.249856] wlp3s0: Limiting TX power to 20 (20 - 0) dBm as advertised by

    Troubleshooting

    Kernel not loaded

    Check if the correct kernel is loaded. This can be accomplished as follows (depends on the IKCONFIG feature):

    Firmware issues

    • For systems using udev or systemd, it is imperative to configure the kernel to load binary blobs. In this case the wireless card's firmware is the firmware that needs loaded. More information on configuring the kernel in this manner can be found in the following thread on the Gentoo forums: FW_LOADER_USER_HELPER_FALLBACK.
    • Linux firmware for iwlwifi ucode failed with error -2 from https://z-issue.com/wp/

    Wireless not working

    • Intel Corporation Wireless 8260 (rev 3a) can't access the RSA semaphore it is write protected
    • Intel Wireless-AC 9560 iwlwifi not working kernel 5.4.0
    • Linux kernel 5.6.0 iwlwifi bug
    • Intel Corporation Wi-Fi 6 AX200 (rev 1a). If getting dmesg message pci_enable_msi failed - -38 and the card shows Input/output error in spite of the correct firmware being loaded, then try enabling the Message Signaled Interrupts (MSI and MSI-X) kernel option (CONFIG_PCI_MSI)
    Device Drivers ---> [*] PCI support ---> [*] Network device support ---> [*] Message Signaled Interrupts (MSI and MSI-X)

    No internet connection

    If you can connect to an access point, but still can't connect to any server or get any connection to the internet it might be worth a try to disable 802.11n and/or enable software encryption. You can pass the 11n_disable=1 or 11n_disable=8 and/or swcrypto=1 option to the iwlwifi module. In order to pass the option automatically on module load create the file /etc/modprobe.d/iwlwifi.conf as follows:

    FILE /etc/modprobe.d/iwlwifi.conf Disabling 802.11n, enabling software crypto

     
    options iwlwifi 11n_disable=1 swcrypto=1 

    Note
    In newer kernels, inspected as of 5.3.7, setting 11n_disable=1 (or masked with 0x01) will result in 802.11ac being disabled. This will limit the device to a maximum of 54Mbit throughput.

    "Microcode SW error detected. Restarting 0x0" message in kernel logs

    (. redacted . ) [ 5711.326985] iwlwifi 0000:28:00.0: Microcode SW error detected. Restarting 0x0. [ 5711.326987] iwlwifi 0000:28:00.0: Start IWL Error Log Dump: [ 5711.326990] iwlwifi 0000:28:00.0: Transport status: 0x0000004A, valid: 6 [ 5711.326992] iwlwifi 0000:28:00.0: Loaded firmware version: 71.058653f6.0 ty-a0-gf-a0-71.ucode [ 5711.326993] iwlwifi 0000:28:00.0: 0x00000071 | NMI_INTERRUPT_UMAC_FATAL [ 5711.326995] iwlwifi 0000:28:00.0: 0x00008210 | trm_hw_status0 [ 5711.326998] iwlwifi 0000:28:00.0: 0x00000000 | trm_hw_status1 [ 5711.327001] iwlwifi 0000:28:00.0: 0x004DAEA2 | branchlink2 [ 5711.327003] iwlwifi 0000:28:00.0: 0x004D9974 | interruptlink1 [ 5711.327004] iwlwifi 0000:28:00.0: 0x004D9974 | interruptlink2 [ 5711.327006] iwlwifi 0000:28:00.0: 0x0000C314 | data1 [ 5711.327008] iwlwifi 0000:28:00.0: 0x00000010 | data2 [ 5711.327009] iwlwifi 0000:28:00.0: 0x00000000 | data3 (. redacted . ) [ 5711.329587] iwlwifi 0000:28:00.0: ieee80211 phy0: Hardware restart was requested

    This indicates that a severe error has been encountered by the WiFi adapter's micro-controller which led it to be reset. Consequences might be network drop outs and/and severe slow downs even after the connection to the AP has been restored. The root cause might be difficult to point out (platform own radio noise/buggy firmware/etc) however one of the very first things to try, even if the power management has been disabled for the iwlwifi module, is to prevent the WiFi adapter PCIe link to go in power save mode. This is accomplished by changing the power_scheme value used by the iwlmvm module to 1 (active):

    options iwlmvm power_scheme=1

    Amongst additional countermeasures suggested on https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi disabling 40 MHz channels usage on the 2.4GHz band might also help:

    FILE /etc/modprobe.d/cfg80211.conf Turning off 40 MHz channels usage (2.4 Ghz band)

    options cfg80211 cfg80211_disable_40mhz_24ghz=Y

    See also

    • Handbook:AMD64/Networking/Wireless
    • Wifi — describes the setup of a WiFi (wireless) network device.
    • Wpa_supplicant — a Wi-Fi supplicant
    • Network management using DHCPCD — explains how to use dhcpcd for complete network stack management.
    • Netifrc — Gentoo's default framework for configuring and managing network interfaces on systems running OpenRC.
    • Troubleshooting — provide users with a set of techniques and tools to troubleshoot and fix problems with their Gentoo setups.

    External resources

    References

    Источник

    Читайте также:  Исчезли все сети wifi
Оцените статью
Adblock
detector