WiFi: `iw reg set US` Has No Effect
I tried revisiting this issue yesterday, and still have the problem even with kernel 4.6.3. Manually installing the latest firmware image also didn't help. However, trying iw reg set US
on a second laptop running the same kernel worked fine.
The problem machine is a Thinkpad X1 Carbon (Gen.3), which has an Intel 7265D WiFi card; the working machine is a Thinkpad T440p, which has an Intel 7260. I therefore conclude that there's a bug in the 7265D driver or firmware.
Workaround
I also discovered a workaround for the 7265D. Be aware this is a workaround, and may cause conflicts if/when an actual fix is released:
- Remove all WiFi kernel drivers and dependent modules:
sudo modprobe -r iwlmvm
- Install the
cfg80211
kernel module, using a kernel parameter to force the regulatory domain (in this case, 'US'):
sudo modprobe cfg80211 ieee80211_regdom=US
- Re-install the WiFi kernel drivers:
sudo modprobe iwlmvm
You should now see the WiFi interface configured for the US (or whatever) regulatory domain:
$ iw reg get
country US: DFS-FCC
(2402 - 2472 @ 40), (N/A, 30), (N/A)
(5170 - 5250 @ 80), (N/A, 17), (N/A)
(5250 - 5330 @ 80), (N/A, 23), (0 ms), DFS
(5490 - 5730 @ 160), (N/A, 23), (0 ms), DFS
(5735 - 5835 @ 80), (N/A, 30), (N/A)
(57240 - 63720 @ 2160), (N/A, 40), (N/A)
Update 2016.11.17: Fixed in Kernel 4.8 Series
I checked this issue again today for the first time after updating a couple weeks ago to a 4.8.x kernel, and discovered that the WiFi interface is now seems to be properly accepting the regulatory domain. This happened in or prior to kernel rev 4.8.5.
$ iw reg get
global
country 00: DFS-UNSET
(2402 - 2472 @ 40), (6, 20), (N/A)
(2457 - 2482 @ 20), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(2474 - 2494 @ 20), (6, 20), (N/A), NO-OFDM, PASSIVE-SCAN
(5170 - 5250 @ 80), (6, 20), (N/A), AUTO-BW, PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 20), (0 ms), DFS, AUTO-BW, PASSIVE-SCAN
(5490 - 5730 @ 160), (6, 20), (0 ms), DFS, PASSIVE-SCAN
(5735 - 5835 @ 80), (6, 20), (N/A), PASSIVE-SCAN
(57240 - 63720 @ 2160), (N/A, 0), (N/A)
phy#0 (self-managed)
country US: DFS-UNSET
(2402 - 2482 @ 40), (6, 22), (N/A), AUTO-BW, NO-HT40PLUS, NO-80MHZ, NO-160MHZ
(5170 - 5250 @ 80), (6, 22), (N/A), NO-OUTDOOR, AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
(5250 - 5330 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
(5490 - 5730 @ 80), (6, 22), (0 ms), DFS, AUTO-BW, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
(5735 - 5815 @ 80), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40PLUS, NO-160MHZ, PASSIVE-SCAN
(5815 - 5835 @ 20), (6, 22), (N/A), AUTO-BW, IR-CONCURRENT, NO-HT40MINUS, NO-HT40PLUS, NO-80MHZ, NO-160MHZ, PASSIVE-SCAN
After some code research I found out what the problem is:
The Intel WiFi device appears as a "self-manged" device, so the iw reg set won't be applied to it.
All you need to do is setting the iwlwifi
parameter lar_disable=1
:
- Either manually:
modprobe -r iwlwifi & modprobe iwlwifi lar_disable=1
- Automatically:
echo "options iwlwifi lar_disable=1" >/etc/modprobe.d/iwlwifi.conf