Bug 1279653

Summary: rtl8821ae driver disables all 5GHz frequencies for 10ec:8812
Product: [Fedora] Fedora Reporter: Gabriel <gbauman>
Component: linux-firmwareAssignee: David Woodhouse <dwmw2>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: dwmw2, gbauman, jforbes, kernel-maint, larry.finger, littlesmartguy
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-01 02:22:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
iw phy output
none
dmesg | grep cfg80211
none
dmesg | grep rtl8821ae
none
lspci
none
Output from "dmesg | grep cfg80211"
none
Output from "iw phy" after load with ieee80211_regdom=CA
none
fedora_scan
none
fedora_output
none
manjaro_scan
none
manjaro_output
none
manjaro_error
none
manjaro_ip
none
manjaro_error2
none
Patch to fix problem with RTL8812AE none

Description Gabriel 2015-11-09 23:57:46 UTC
Created attachment 1092016 [details]
iw phy output

I am attempting to use a PCIe wireless card, Realtek Semiconductor Co., Ltd. RTL8812AE 802.11ac PCIe Wireless Network Adapter (rev 01) Subsystem: D-Link System Inc Device 3305 (10ec:8812)

Using kernel 4.2.5-300.fc23.x86_64 and driver rtl8821ae.

The device works fine in 2.4GHz mode, but all 5GHz frequencies are disabled:

$ iw phy
<snip>
Frequencies:
	* 5180 MHz [36] (disabled)
	* 5200 MHz [40] (disabled)
	* 5220 MHz [44] (disabled)
	* 5240 MHz [48] (disabled)
	* 5260 MHz [52] (disabled)
	* 5280 MHz [56] (disabled)
	* 5300 MHz [60] (disabled)
	* 5320 MHz [64] (disabled)
	* 5500 MHz [100] (disabled)
	* 5520 MHz [104] (disabled)
	* 5540 MHz [108] (disabled)
	* 5560 MHz [112] (disabled)
	* 5580 MHz [116] (disabled)
	* 5600 MHz [120] (disabled)
	* 5620 MHz [124] (disabled)
	* 5640 MHz [128] (disabled)
	* 5660 MHz [132] (disabled)
	* 5680 MHz [136] (disabled)
	* 5700 MHz [140] (disabled)
	* 5745 MHz [149] (disabled)
	* 5765 MHz [153] (disabled)
	* 5785 MHz [157] (disabled)
	* 5805 MHz [161] (disabled)
	* 5825 MHz [165] (disabled)
<snip>

Any idea why this might be? Any workaround that would allow me to use the 5GHz bands?

Comment 1 Gabriel 2015-11-09 23:58:29 UTC
Created attachment 1092018 [details]
dmesg | grep cfg80211

Comment 2 Gabriel 2015-11-09 23:59:20 UTC
Created attachment 1092020 [details]
dmesg | grep rtl8821ae

Comment 3 Gabriel 2015-11-09 23:59:47 UTC
Created attachment 1092021 [details]
lspci

Comment 4 Gabriel 2015-11-13 01:15:05 UTC
This seems to be an issue with cfg80211 and CRDA on Fedora.

Booting the Fedora 23 LiveCD, 5ghz networks work. Once cfg80211 is loaded, 5GHz networking is disabled. 

It appears that when the card is in its default world regulatory domain, things work - but when the CA regulatory domain is loaded, 5GHz support gets killed.

I have also been testing with the rtlwifi-new driver from github:

 o https://github.com/lwfinger/rtlwifi_new/issues/56

...and the behaviour is the same on F23.

Comment 5 Larry Finger 2015-11-13 14:14:13 UTC
Since the driver at rtlwifi-new is the same as the one in the kernel, itt is not surprising that the behavior is identical.

Comment 6 Gabriel 2015-12-31 21:11:37 UTC
Still the case with kernel 4.2.7-300.fc23.x86_64, fresh Fedora installation.

Anything I can do to work around this?

Comment 7 Larry Finger 2015-12-31 22:04:42 UTC
Created attachment 1110818 [details]
Output from "dmesg | grep cfg80211"

Comment 8 Larry Finger 2015-12-31 22:05:49 UTC
Created attachment 1110819 [details]
Output from "iw phy" after load with ieee80211_regdom=CA

Comment 9 Larry Finger 2016-01-01 00:25:12 UTC
I downloaded a fresh copy of Fedora-Live-Workstation-x86_64-23-10.iso, copied it to a USB stick, and booted it.

Attached are the output of the cfg80211 outputs from dmesg. There are two sets of outputs. The first is with cfg80211 loaded with the regulatory domain set to world, which is the default set in my device. The second is after I unloaded cfg80211 and reloaded it with the regdom set to CA.

The "iw phy" output after cfg80211 was reloaded is also attached. In both cases, I was able to connect to channel 149.

Apparently the difference between your results and mine is that I have an RTL8821AE and you have an RTL8812AE. I have looked at the code, and both variants tell mac80211 that they are dual-band devices. I will continue looking for any differences in the initialization.

Unfortunately, I only have RTL8821AE devices. I found the 8812 variant on the web, but I'm a little hesitant to spend the $50 that it costs. There are none listed on E-bay.

Comment 10 Larry Finger 2016-01-09 14:04:30 UTC
The Realtek engineer confirmed that the RTL8812AE works OK in their environment using the standard kernel code in Fedora 23, thus the problem seems to happen only for your system.

I am more convinced that you are having some incorrect interaction between CRDA and mac80211. Does your device have the regdom for Canada built into the EEPROM, or are you loading cfg80211 with that option? Mine selects the regdom for the world, but I have a US option selected in a file in /etc/modprobe.d/.

Comment 11 littlesmartguy 2016-01-19 02:35:31 UTC
Hi,

I've been following this bug every week or so for the last couple of months (I came here from the GitHub issue) and I can confirm that a D-Link DWA-582 (which uses a RTL8812AE) can connect to 2.4 GHz APs but not 5 GHz APs. It can see the 5 GHz APs when you click on search/list but it cannot connect to them. I've tried both Fedora 23 live cd and Manjaro 15.12 live cd. I've tried the default regdom (whatever it's set to when you boot the live image) and I've also tried connecting after running commands such as "iw reg set US", "iw reg set CA", "iw reg set RU" and a bunch of other countries.

Comment 12 littlesmartguy 2016-01-19 02:38:24 UTC
Also, I can't edit the filesystem (/etc/modprobe.d/) since I'm running it from a live image. Filesystem edits usually require a reboot but any edits to the filesystem won't be saved after a reboot on a live image.

Comment 13 Larry Finger 2016-01-19 06:45:57 UTC
If you can see the 5G APs in a scan, then they are not blocked. It is possible that your computer only has a single antenna, and that it is not attached to the connector that the driver expects. This can be checked by runnin the command

sudo iw dev wlan0 scan | egrep "freq|signal"

Change wlan0 to match the actual name of the wireless device. Post that output. In addition, post the 5G frequency info from "iw phy".

Comment 14 littlesmartguy 2016-01-19 16:38:32 UTC
For what it's worth, according to this user (https://github.com/lwfinger/rtlwifi_new/issues/56#issuecomment-137716157), it appears that his Startech PEX867WAC22 (RTL8812AE) also can see 5GHz APs but cannot connect to them. Also, for whatever it's worth, about 1-2 weeks ago I had Windows 8.1 installed on the same computer and it connected to the same 5 GHz AP using the driver from the D-Link website.

Anyway, I followed your instructions after booting from a live image on both Fedora 23 64-bit and Manjaro KDE 15.12 64-bit.

Fedora steps:

1. First thing I did was take a screenshot of all the APs: fedora_scan.png
2. Next, I ran sudo iw dev wlp1s0 scan | egrep "freq|signal" (fedora_output.txt)
3. I ran iw phy (fedora_output.txt)
4. I ran iw reg set CA and iw phy (fedora_output.txt)
5. I ran iw reg set US and iw phy (fedora_output.txt)

Fedora 23 64-bit: Linux Kernel 4.2.3

Manjaro steps:

1. First thing I did was take a screenshot of all the APs: manjaro_scan.png
2. Next, I ran sudo iw dev wlp1s0 scan | egrep "freq|signal" (manjaro_output.txt)
3. I ran iw phy and iw reg get (manjaro_output.txt)
4. I ran iw reg set US and iw phy (manjaro_output.txt) (5G networks were still shown after a scan)
5. I ran iw reg set CA and iw phy (manjaro_output.txt) (5G networks were still shown after a scan)
6. I tried to connect to Discovery_5Ghz but it got stuck at "setting network address..." (manjaro_error.png)
7. I set the connection to static IP (manjaro_ip.png)
8. Connection is successful but I cannot access anything. Router cannot detect the computer and pinging 192.168.1.154 from another PC gives 0 results (manjaro_error2.png)

Manjaro KDE 15.12 64-bit: Linux Kernel 4.1.15

Comment 15 littlesmartguy 2016-01-19 16:39:27 UTC
Created attachment 1116268 [details]
fedora_scan

Comment 16 littlesmartguy 2016-01-19 16:39:48 UTC
Created attachment 1116269 [details]
fedora_output

Comment 17 littlesmartguy 2016-01-19 16:40:20 UTC
Created attachment 1116270 [details]
manjaro_scan

Comment 18 littlesmartguy 2016-01-19 16:40:59 UTC
Created attachment 1116271 [details]
manjaro_output

Comment 19 littlesmartguy 2016-01-19 16:41:31 UTC
Created attachment 1116272 [details]
manjaro_error

Comment 20 littlesmartguy 2016-01-19 16:41:48 UTC
Created attachment 1116273 [details]
manjaro_ip

Comment 21 littlesmartguy 2016-01-19 16:42:05 UTC
Created attachment 1116274 [details]
manjaro_error2

Comment 22 littlesmartguy 2016-01-19 16:53:57 UTC
Also, I forgot to mention that the D-Link DWA-582 has 2 antennas.

Comment 23 Larry Finger 2016-01-19 17:22:35 UTC
These are interesting results. Given the same hardware and essentially the same driver, 5G frequencies are allowed with Manjaro and forbidden with Fedora. I'm not sure why Manjaro was unable to complete the connection, but that is likely a separate issue.

At this point, I do not know enough to say why the Manjaro, Ubuntu and openSUSE systems allow 5G and Fedora does not.

Gabe: There is a question in Comment 10 that you still have not answered.

Comment 24 Larry Finger 2016-01-19 17:57:16 UTC
@Gabe: Please pull updates from the rtlwifi_new repo, build the master branch (the default), and run again. The new code will log a line

In _rtl_regdomain_select, country code XX

Please report the value for XX.

Comment 25 littlesmartguy 2016-01-19 18:21:43 UTC
Manjaro has a nifty tool to swap out kernels so I decided to try out a bunch of kernels:

3.10.94 --> wifi card not detected

3.14.58 --> can see 5G and can connect

3.16.7 --> can see 5G and can connect

3.18.25 --> can see 5G but cannot connect

4.1.15 --> can see 5G but cannot connect

4.2.8 --> cannot see 5G

4.3.3 --> cannot see 5G

4.4.0 --> cannot see 5G

Comment 26 littlesmartguy 2016-01-19 18:22:17 UTC
I should add that for the kernels that cannot even see 5G APs, the "iw phy" output says that all 5 GHz channels are disabled.

Comment 27 Larry Finger 2016-01-21 03:56:21 UTC
Created attachment 1116777 [details]
Patch to fix problem with RTL8812AE

The problem with the D-Link DWA-582 is that the country code is improperly encoded in the EEPROM. This problem leads to the driver selecting a channel plan that only includes 2.4 GHz channels. This patch changes that tp allow both 2.4 and 5 GHz bands.

The NEEDINFO request, which the OP has ignored, is cleared. I think this bug can be closed. The patch will be submitted to the wireless tree.

Comment 28 Josh Boyer 2016-01-21 15:16:05 UTC
Thanks Larry!  I've backported your patch to 4.3.y and included it in Fedora git.

Comment 29 Fedora Update System 2016-01-25 18:22:07 UTC
kernel-4.3.4-300.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-2f25d12c51

Comment 30 Fedora Update System 2016-01-25 18:25:52 UTC
kernel-4.3.4-200.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-5d43766e33

Comment 31 Fedora Update System 2016-01-26 04:21:52 UTC
kernel-4.3.4-200.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-5d43766e33

Comment 32 Fedora Update System 2016-01-26 04:27:30 UTC
kernel-4.3.4-300.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-2f25d12c51

Comment 33 Fedora Update System 2016-02-01 02:21:41 UTC
kernel-4.3.4-300.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 34 Fedora Update System 2016-02-01 06:22:25 UTC
kernel-4.3.4-200.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.