I like to run Arch Linux on my System76 Galago Pro, but I’ve had some strange problems with wifi networks. After a minute (or sometimes less) of being connected to the network, I would suddenly lose my link-layer connection.
Looking at my kernel log, I would see the following:
$ journalctl Dec 04 15:58:02 hostname kernel: wlp59s0: authenticate with d8:c7:c8:6d:94:41 Dec 04 15:58:02 hostname kernel: wlp59s0: send auth to d8:c7:c8:6d:94:41 (try 1/3) Dec 04 15:58:02 hostname kernel: wlp59s0: authenticated Dec 04 15:58:02 hostname kernel: wlp59s0: associate with d8:c7:c8:6d:94:41 (try 1/3) Dec 04 15:58:02 hostname kernel: wlp59s0: RX AssocResp from d8:c7:c8:6d:94:41 (capab=0x421 status=0 aid=1) Dec 04 15:58:02 hostname kernel: wlp59s0: associated Dec 04 15:58:02 hostname kernel: IPv6: ADDRCONF(NETDEV_CHANGE): wlp59s0: link becomes ready ... Dec 04 15:58:52 hostname dhcpcd[469]: wlp59s0: carrier lost Dec 04 15:58:52 hostname kernel: wlp59s0: deauthenticated from d8:c7:c8:6d:94:41 (Reason: 6=CLASS2_FRAME_FROM_NONAUTH_STA)
I don’t know about anyone else, but I don’t find CLASS2_FRAME_FROM_NONAUTH_STA
to be very self-explanatory. I searched around and found this reference chart for the codes and their meaning. Sadly, Class 2 frame received from nonauthenticated STA
still doesn’t tell me enough to know what my problem was.
I searched around for the problem some more and came across two separate threads with similar solutions.
- Someone on stackoverflow getting the same deauth problem
- An Ubuntu user with an intel wireless card resolving this problem
Both of these suggest configuring the iwlwifi
kernel module using a /etc/modprobe.d/iwlwifi.conf
. Specifically, both solutions changed a setting named 11n_disable
.
Trying to discover what the 11n_disable
parameter actually does, I searched the ArchWiki and found this page, which mentions that a value of 1
disables 11n
, whereas a value of 8
enables antenna aggregation. I followed their sources for that.
A gentoo forum post documents the discovery of new values for this parameter and explains that you can find out what these arcane kernel parameters mean by using modinfo
.
$ modinfo iwlwifi filename: /lib/modules/4.13.0-17-generic/kernel/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko license: GPL author: Copyright(c) 2003- 2015 Intel Corporation <linuxwifi@intel.com> description: Intel(R) Wireless WiFi driver for Linux <a bunch of firmware and alias lines> depends: cfg80211 intree: Y name: iwlwifi vermagic: 4.13.0-17-generic SMP mod_unload signat: PKCS#7 signer: sig_key: sig_hashalgo: md4 parm: swcrypto:using crypto in software (default 0 [hardware]) (int) parm: 11n_disable:disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX (uint) parm: amsdu_size:amsdu size 0: 12K for multi Rx queue devices, 4K for other devices 1:4K 2:8K 3:12K (default 0) (int) parm: fw_restart:restart firmware in case of error (default true) (bool) parm: antenna_coupling:specify antenna coupling in dB (default: 0 dB) (int) parm: nvm_file:NVM file name (charp) parm: d0i3_disable:disable d0i3 functionality (default: Y) (bool) parm: lar_disable:disable LAR functionality (default: N) (bool) parm: uapsd_disable:disable U-APSD functionality bitmap 1: BSS 2: P2P Client (default: 3) (uint) parm: bt_coex_active:enable wifi/bt co-exist (default: enable) (bool) parm: led_mode:0=system default, 1=On(RF On)/Off(RF Off), 2=blinking, 3=Off (default: 0) (int) parm: power_save:enable WiFi power management (default: disable) (bool) parm: power_level:default power save level (range from 1 - 5, default: 1) (int) parm: fw_monitor:firmware monitor - to debug FW (default: false - needs lots of memory) (bool) parm: d0i3_timeout:Timeout to D0i3 entry when idle (ms) (uint) parm: disable_11ac:Disable VHT capabilities (default: false) (bool)
I didn’t know that it was that easy to look this stuff up. It looks like you can AND together multiple values for this setting, though I’m not sure how it would work if you explicitly disabled TX aggregation and enabled it. (I think a setting value of 12 (8 & 4) would attempt this.)
It seems like there are many other settings that can be tweaked in this driver. I might have to play with them some other time. I wonder how they might impact performance…
This bugzilla report against the kernel supports that this setting causes the wireless card to only use one of the antennae, rather than all of them (or, at least, this is my understanding of “antenna aggregation”).
I made the following changes to my /etc/modprobe.d/iwlwifi.conf
:
# /etc/modprobe.d/iwlwifi.conf options iwlwifi 11n_disable=8
After rebooting, my wifi is both faster and doesn’t recieve those crazy deauthentication packets anymore!
Image Credit: Ed Hunsinger
Image License: CC BY-NC 2.0