[BPI-R2] MT7615 Wifi no IR flag

i have backported changes in wifi-driver to 5.10 and 5.4 as it seems to work stable like builtin and fixes hang-bug if wlan0 is aquired by another wifi-card

Very cool :slight_smile:

I canā€™t test those currently as the router is now deployed.

Thank you again for all the work you put in!

Result: 10_luHAfwj7zM

5.12 is not for productive use (and still release candidate) you should switch to 5.10 or 5.4. If you need hnat,you can try 5.10-hnat tree but i have not added the wifi patches to it,but you can cherry-pick them from 5.10-main

Tried to follow along with this thread, but I canā€™t for some reason. Is this problem/issue solved?

5.12-rc (+hnat),5.10-main and 5.4-main support building internal wifi as module,so cfg80211 can be built as module too and loaded with regdomain option

So it should be fixed,yes

Iā€™m not sure you fall into it as i can set regdomain with iw in debian (maybe same in ubuntu). Without having cfg80211 or mt6625l as module.

With all due respect intended, I wouldnā€™t ask the question if I wasnā€™t having the problem.

However, I figured it out. Changing my kernel options to make cfg80211 a module, pulling the https://kernel.googlesource.com/pub/scm/linux/kernel/git/sforshee/wireless-regdb repository for the wireless regulatory database, properly linking those files, and including those options in the modprobe.d directory seems to have fixed my issueā€¦

You had the same reg domain 00 issue? Which system (image) and countrycode do you have? With debian and DE i had no problem with regulatory domain (after installing needed packages) with builtin cfg80211

Yeah, Iā€™m using your Debian 10 image with kernel 5.10.23, with US country code.

I know, Iā€™m a bunch of problems, arenā€™t I? :stuck_out_tongue:

Lol no,but i wonder why i can set DE without problems and you not US regdomain

From all my reading about this I came to the following results:

ā€œiw reg setā€ actually calls ā€œcrdaā€ to set the regdom, so if crda is not present it wonā€™t set it.

crda is a deprecated method and is basically only ā€œaliveā€ because it hasnā€™t been fully patched out of the kernel yet.

The ā€œnewā€ way to set the regdom should be done with the cfg80211 module i.e. at the kernel level.

Thatā€™s why I was very glad to see that you helped all the way, wouldnā€™t know what I would have done without you :slight_smile:.

I had the requirements installed (being iw, wireless-regdb, and crda), as outlined by your wiki installed. For some reason, it didnā€™t work for me. I even went so far as to install wireless-regdb from buster-backports, which provided me with a more up-to-date regulatory database than the one in the buster repoā€¦ It was a no-go until I posted in this thread. Thanks, Frank and Eldes!

@ frank-w : For sh!ts and giggles, I tried DE before posting in this thread. Was a no-go as wellā€¦

Mhm, i donā€™t see IR on main router running 5.4.107,but i see DE regdom and have 5g hostap running (currently connected,ch40 5200mhz)

[08:26] root@bpi-r2-emmc:~ (501)
# iw reg get
global
country DE: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (5725 - 5875 @ 80), (N/A, 13), (N/A)
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

[08:26] root@bpi-r2-emmc:~ (502)
#

The ā€œno-IRā€ flag for the 5Ghz spectrum will be there if the ā€œ00ā€ (or ā€œworldā€) regdom or is set.

Oh and I also forgot to mention something that is actually important:

The regdom has to be set before Wifi drivers are loaded, that seems to be rarely mentioned.

So there is only ā€œNO-IRā€ if non working,but no ā€œIRā€ if it is workingā€¦

Need to update wifi-script and wiki before changing defconfig to module

I donā€™t know if weā€™re talking about the same thing here:

The ā€œno IRā€ flag is shown in ā€œiw listā€ like so:

2472 MHz [13] (20.0 dBm) (no IR)

If ā€œ00ā€ is set then you get, with ā€œiw reg getā€, this:

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)

All channels that work are looking like this, with nothing behind them:

2452 MHz [9] (20.0 dBm)

Depending on what regdom is loaded however some channels may be disabled, ā€œiw listā€:

2484 MHz [14] (disabled)

In this example channel 14 is only available with the regdom ā€œJPā€(Japan).

Iā€™m showing all this on the 2.4GHz as I have that on hand currently but the same is true for 5GHz.

As for this:

5500 MHz [100] (26.0 dBm) (radar detection)

This needs the ā€œDFSā€ feature to work in the driver to use that channel, many drivers seem to not really support it though.

ā€œDFSā€ is used in hostapd with the ā€œacsā€ settings and channel either left out or set to ā€œ0ā€, meaning hostapd will select a channel automatically after scanning the environment to check if there is anything broadcasting on those frequencies.

1 Like

ok, looked onto my main-router it show this for mt7612e/5G band (imho hard to get phy to right device):

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

still wondering why it works in my case (5.4.107-bpi-r2-main) without having cfg80211 as module. i have modprobe-config set, but this should not be read

# cat /etc/modprobe.d/cfg80211.conf 
options cfg80211 ieee80211_regdom=DE

but tried module approach on my test-device and ap0 is up and running. only added

modprobe wlan_gen2

before check for /dev/wmtWifi in my wifi.sh (wmt_chrdev_wifi is loaded automaticly), but iā€™m thinking about checking for

/lib/modules/$(uname -r)/kernel/drivers/misc/mediatek/connectivity/wlan/gen2/wlan_gen2.ko

before trying to load itā€¦just to avoid modprobe-error if wifi-driver is built-in

cfg80211.ko is loaded at boottime because i have mt7615 active :wink:

have pushed changes to 5.10-main, will do for 5.4-main if no problems will come :wink:

You may have an udev rule that is doing what needs to be done.

For which part do you suggest an udev rule?

Have added modprobe to wifi.sh like this:

You may have an udev rule in your system for crda.

This talks about it:

https://wireless.wiki.kernel.org/en/developers/regulatory/crda

Neat, I may have to adopt that part to my script :slight_smile: At one pointā€¦

Not yet,but found country_code=DE option in my hostapd.conf for 5g, looked on my test-device also no udev-rules, but the config in modprobe.d is also there (no cfg80211 module).

booted older kernel on my test-device without cfg80211 module

root@bpi-r2:~# iw reg get
global                                                                          
country 00: DFS-UNSET                                                           
        (2402 - 2472 @ 40), (N/A, 20), (N/A)                                    
        (2457 - 2482 @ 20), (N/A, 20), (N/A), AUTO-BW, NO-IR                    
        (2474 - 2494 @ 20), (N/A, 20), (N/A), NO-OFDM, NO-IR                    
        (5170 - 5250 @ 80), (N/A, 20), (N/A), AUTO-BW, NO-IR                    
        (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, AUTO-BW, NO-IR              
        (5490 - 5730 @ 160), (N/A, 20), (0 ms), DFS, NO-IR                      
        (5735 - 5835 @ 80), (N/A, 20), (N/A), NO-IR                             
        (57240 - 63720 @ 2160), (N/A, 0), (N/A)                                 
                                                                                
root@bpi-r2:~# iw reg set DE                                                    
root@bpi-r2:~# iw reg get                                                       
global                                                                          
country DE: DFS-ETSI                                                            
        (2400 - 2483 @ 40), (N/A, 20), (N/A)                                    
        (5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR, AUTO-BW               
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS, AUTO-BW         
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS                             
        (5725 - 5875 @ 80), (N/A, 13), (N/A)                                    
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)                                
                                                                                
root@bpi-r2:~# 

root@bpi-r2:~# apt list --installed | grep "crda\|iw\|reg"                      
                                                                                
WARNING: apt does not have a stable CLI interface. Use with caution in scripts. 
                                                                                
crda/stable,now 3.18-1 armhf [installed]                                        
iw/stable,now 5.0.1-1 armhf [installed]                                         
libiw30/stable,now 30~pre9-13 armhf [installed,automatic]                       
wireless-regdb/stable,now 2016.06.10-1 all [installed]                          
root@bpi-r2:~#