raspberrypi / firmware

This repository contains pre-compiled binaries of the current Raspberry Pi kernel and modules, userspace libraries, and bootloader/GPU firmware.
5.15k stars 1.68k forks source link

Raspbian Lite 4.4 on RPi 3: Wifi changes regulatory domain multiple times during boot when configured in wpa_supplicant.conf #630

Closed Ruffio closed 8 years ago

Ruffio commented 8 years ago

pi@raspberrypi:~ $ uname -a Linux raspberrypi 4.4.14-v7+ #896 SMP Sat Jul 2 15:09:43 BST 2016 armv7l GNU/Linux

I have changed the wpa to below, where country DK is set as regulatory domain:

pi@raspberrypi:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf country=DK ctrl_interface=DIR=/var/run/wpa_supplicant GROUP = netdev update_config=1 network={ ssid="XXX" psk="XXX" }

It looks like the wifi is changing regulatory domain several times during boot, sometime to unset, sometime to DE and sometime to the correct DK:

Here is part of my dmesg: [ 5.387541] cfg80211: World regulatory domain updated: [ 5.387554] cfg80211: DFS Master region: unset [ 5.387567] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 5.387585] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 5.387599] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 5.387611] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) [ 5.387632] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 5.387672] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 5.387686] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) [ 5.387698] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 5.387710] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 5.481267] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [ 5.602819] systemd-journald[139]: Received request to flush runtime journal from PID 1 [ 6.424771] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists [ 6.424798] brcmfmac: brcmf_add_if: ignore IF event [ 6.430232] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 6.430277] brcmfmac: power management disabled [ 6.980087] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup [ 6.980221] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 7.009238] cfg80211: Regulatory domain changed to country: DK [ 7.009253] cfg80211: DFS Master region: ETSI [ 7.009258] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 7.009266] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 7.009274] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 7.009282] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 7.009288] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) [ 7.009301] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [ 8.054473] brcmfmac: brcmf_cfg80211_escan: Connecting: status (3) [ 8.054488] brcmfmac: brcmf_cfg80211_scan: scan error (-11) [ 8.270289] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 8.291739] cfg80211: Regulatory domain changed to country: DE [ 8.291754] cfg80211: DFS Master region: ETSI [ 8.291759] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 8.291767] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 8.291775] cfg80211: (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 8.291782] cfg80211: (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 8.291788] cfg80211: (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 8.291794] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [ 12.324228] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 12.324257] cfg80211: World regulatory domain updated: [ 12.324266] cfg80211: DFS Master region: unset [ 12.324276] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 12.324290] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 12.324311] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 12.324323] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) [ 12.324338] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 12.324358] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 12.324371] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) [ 12.324383] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 12.324396] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 12.363960] cfg80211: Regulatory domain changed to country: DK [ 12.363984] cfg80211: DFS Master region: ETSI [ 12.363994] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 12.364008] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 12.364024] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 12.364057] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 12.364077] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) [ 12.364090] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [ 13.833626] cfg80211: Regulatory domain changed to country: DE [ 13.833639] cfg80211: DFS Master region: ETSI [ 13.833645] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 13.833653] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 13.833661] cfg80211: (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 13.833668] cfg80211: (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 13.833675] cfg80211: (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 13.833681] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)

chrisbgp commented 8 years ago

Having the same problem since the last upgrade...

Linux pi 4.4.14-2-ARCH #1 SMP Sat Jul 2 20:41:34 MDT 2016 armv7l GNU/Linux

linux-firmware 20160516.80d463b-1 raspberrypi-firmware 20160706-1 raspberrypi-firmware-bootloader 20160706-1 raspberrypi-firmware-bootloader-x 20160706-1 raspberrypi-firmware-examples 20160706-1 raspberrypi-firmware-tools 20160706-1

Bus 001 Device 006: ID 0cf3:9271 Atheros Communications, Inc. AR9271 802.11n

...which is using ath9k

Ruffio commented 8 years ago

Hmmm, seams to be an upstream issue then? Anybody can conform this?

I set the CRDA at /etc/defaults/crda to DK and also sudo -i echo "options cfg80211 ieee80211_regdom=DE" > /etc/modprobe.d/cfg80211.conf exit

but nothing has changed. It is still switching around :-( (http://askubuntu.com/questions/621452/something-keeps-changing-my-wireless-regulatory-domain)

pi@raspberrypi:~ $ dmesg |grep "cfg80211" [ 4.345460] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 4.396900] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 4.396931] cfg80211: World regulatory domain updated: [ 4.396940] cfg80211: DFS Master region: unset [ 4.396949] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 4.396963] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 4.396976] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 4.396988] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) [ 4.397003] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 4.397025] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 4.397041] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) [ 4.397054] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 4.397066] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 4.478371] cfg80211: Regulatory domain changed to country: DK [ 4.478395] cfg80211: DFS Master region: ETSI [ 4.478404] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 4.478419] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 4.478446] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 4.478473] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 4.478487] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) [ 4.478499] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [ 7.501814] cfg80211: Regulatory domain changed to country: DE [ 7.501830] cfg80211: DFS Master region: ETSI [ 7.501836] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 7.501844] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 7.501852] cfg80211: (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 7.501859] cfg80211: (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 7.501865] cfg80211: (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 7.501871] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)

And why does it ends by switching to DE? Where does that come from? Is it hardcoded somewhere?

Ruffio commented 8 years ago

Also tried: pi@raspberrypi:/etc/default $ export COUNTRY=DK pi@raspberrypi:/etc/default $ crda Failed to set regulatory domain: -28

tuxen commented 8 years ago

I set the CRDA at /etc/defaults/crda to DK and also sudo -i echo "options cfg80211 ieee80211_regdom=DE" > /etc/modprobe.d/cfg80211.conf exit

shouldn't the DE in bold be DK too, or is it just a type error from watching logs?

Ruffio commented 8 years ago

@tuxen it is a typing error here, I did correct on my RPi.

Ruffio commented 8 years ago

Even without any of my attempts it switches to DE

tuxen commented 8 years ago

thought so =) I have not setup wireless on my RPi. not that I am expecting different results. odd that it likes DE so much. maybe as you say; its hardcoded somewhere.

clivem commented 8 years ago

Even without any of my attempts it switches to DE

I have vague recollections of crda setting regulatory based on system timezone. eg. /etc/localtime.

Ruffio commented 8 years ago

I tried to copy copy Copenhagen to /etc/locatime and rebooted, but thats doesn't make any difference: sudo cp /usr/share/zoneinfo/Europe/Copenhagen /etc/localtime

Still changing from DK and back to DE, so to begin with it is correct (DK) but then for some reason it changes to DE. Any other place where DE is configured by default?

[ 5.461802] brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7 [ 5.483335] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 5.572622] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code [ 5.572653] cfg80211: World regulatory domain updated: [ 5.572662] cfg80211: DFS Master region: unset [ 5.572671] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 5.572696] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 5.572721] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 5.572734] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) [ 5.572768] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 5.572792] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 5.572824] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) [ 5.572838] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 5.572850] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 5.674970] cfg80211: Regulatory domain changed to country: DK [ 5.674992] cfg80211: DFS Master region: ETSI [ 5.675002] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 5.675017] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 5.675033] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 5.675047] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 5.675060] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s) [ 5.675073] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [ 5.812286] systemd-journald[141]: Received request to flush runtime journal from PID 1 [ 6.483514] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists [ 6.483527] brcmfmac: brcmf_add_if: ignore IF event [ 6.487171] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 6.487199] brcmfmac: power management disabled [ 7.419978] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup [ 7.420235] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 8.217504] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 8.241718] cfg80211: Regulatory domain changed to country: DE [ 8.241733] cfg80211: DFS Master region: ETSI [ 8.241738] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 8.241746] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 8.241754] cfg80211: (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 8.241761] cfg80211: (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 8.241768] cfg80211: (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 8.241774] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)

My configs:

pi@raspberrypi:~ $ sudo cat /etc/default/crda
# Set REGDOMAIN to a ISO/IEC 3166-1 alpha2 country code so that iw(8) may set
# the initial regulatory domain setting for IEEE 802.11 devices which operate
# on this system.
#
# Governments assert the right to regulate usage of radio spectrum within
# their respective territories so make sure you select a ISO/IEC 3166-1 alpha2
# country code suitable for your location or you may infringe on local
# legislature. See `/usr/share/zoneinfo/zone.tab' for a table of timezone
# descriptions containing ISO/IEC 3166-1 alpha2 country codes.

REGDOMAIN=DK
pi@raspberrypi:~ $ sudo cat /etc/modprobe.d/cfg80211.conf
options cfg80211 ieee80211_regdom=DK
pi@raspberrypi:~ $ sudo iw reg get
country DE: DFS-ETSI
        (2400 - 2483 @ 40), (N/A, 20), (N/A)
        (5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR
        (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS
        (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS
        (57000 - 66000 @ 2160), (N/A, 40), (N/A)

Hmmm, the comments in /etc/default/crda (see above) actually states that setting the REGDOMAIN should change the behavior of iw, but clearly we can see that something is happening since this setting is overwritten/changed to DE.

clivem commented 8 years ago

Any other place where DE is configured by default?

@Ruffio I also have another vague recollection (from trying to help a user with similar problems a year ago), that when WPA supplicant connects to an AP, the reg domain can be set to match that of the AP it is associating with during the association. Never did really understand how/why, but I wonder if your AP is hard-coded to DE. Just throwing the thought out there.....

If you 'iw reg set DK' after it has associated, does that "stick", or does it change back to DE?

lfoerster commented 8 years ago

Same issue here ! Without setting anything wlan stick comes up with reg.domain set to CN (TP-Link Atheros based stick) Setting /etc/defaults/crda to DE shows reg.domain set to country to 98. Weired. root@lcdpi:/etc# iw reg get country 98: DFS-UNSET (2402 - 2472 @ 40), (N/A, 20), (N/A) (2457 - 2482 @ 25), (N/A, 20), (N/A), NO-IR (2474 - 2482 @ 8), (N/A, 20), (N/A), NO-OFDM, NO-IR (5170 - 5250 @ 80), (N/A, 20), (N/A), NO-IR (5250 - 5330 @ 80), (N/A, 20), (0 ms), DFS, NO-IR (5735 - 5835 @ 80), (N/A, 20), (N/A), NO-IR (57240 - 59400 @ 2160), (N/A, 0), (N/A) (59400 - 63720 @ 2160), (N/A, 0), (N/A) root@lcdpi:_ Even setting it in wpa_supplicant.conf did NOT work. I ended up editing /etc/rc.local and set the iw command sudo iw reg set DE there. That finally did the trick but is of course not a good solution ! There is definitely something wrong in the crda package.

clivem commented 8 years ago

Guys, I really do suspect that this might be because of what the AP is broadcasting as the country code. I know that Sky broadband customers in the UK, get given an AP/Router that broadcasts DE as the regulatory country....

eg. I'm in the UK, (GB), my neighbours who are using Sky as ISP, all appear to have AP's that are broadcasting DE as the regulatory country.....

sudo iw dev wlan0 scan | grep -e SSID -e Country
    SSID: SKY1E929
    Country: DE Environment: Indoor/Outdoor
    SSID: SKY77B78
    Country: DE Environment: Indoor/Outdoor
    SSID: SKYEB806
    Country: DE Environment: Indoor/Outdoor
    SSID: SKY22D06
    Country: DE Environment: Indoor/Outdoor
    SSID: SKY1D45D
    Country: DE Environment: Indoor/Outdoor
    SSID: SKYE55A8
    Country: DE Environment: Indoor/Outdoor
Ruffio commented 8 years ago

Sorry for my late response, but I have been without Internet connection during the weekend and still is :-(

@clivem I don't know where to see if my AP is configured to DE, it is not an open source AP.

''' pi@raspberrypi:~ $ sudo iw reg set DK pi@raspberrypi:~ $ dmesg ... [ 6.317397] brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists [ 6.317413] brcmfmac: brcmf_add_if: ignore IF event [ 6.321186] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready [ 6.321214] brcmfmac: power management disabled [ 7.279890] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup [ 7.280029] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready [ 8.136495] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready [ 8.159917] cfg80211: Regulatory domain changed to country: DE [ 8.159932] cfg80211: DFS Master region: ETSI [ 8.159937] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 8.159945] cfg80211: (2400000 KHz - 2483500 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 8.159953] cfg80211: (5150000 KHz - 5250000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 8.159960] cfg80211: (5250000 KHz - 5350000 KHz @ 80000 KHz, 200000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 8.159967] cfg80211: (5470000 KHz - 5725000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 8.159973] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) [ 79.941538] cfg80211: Current regulatory domain intersected: [ 79.941564] cfg80211: DFS Master region: ETSI [ 79.941573] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 79.941588] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 79.941603] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 79.941617] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 79.941630] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 79.941643] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A) '''

That is not what I expected. I expected, to see: cfg80211: Regulatory domain changed to country: DK

Mayby you are right regarding that it is the AP that sets it to use DE, because right after the link becomes ready (look above), the cfg80211 changes to DE. Eailier I tried to search for files containing '=DE' and I also did the above. That caused the below in dmesg. Is that expected? I only have a USB stick connected (haven't touched it), but is dwc_otg 3f980000.usb the onboard wifi?

''' [ 2783.890791] dwc_otg 3f980000.usb: Invalid offset (0xffffffff) [ 2783.890828] hsic_connect_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.890858] guid_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.890887] mode_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.897603] WARNING! power/level is deprecated; use power/control instead [ 2783.913580] srpcapable_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.913615] Core Global Registers [ 2783.913621] GOTGCTL @0xF3980000 : 0x001C0001 [ 2783.913625] GOTGINT @0xF3980004 : 0x00000000 [ 2783.913630] GAHBCFG @0xF3980008 : 0x00000031 [ 2783.913634] GUSBCFG @0xF398000C : 0x20001700 [ 2783.913639] GRSTCTL @0xF3980010 : 0x80000000 [ 2783.913643] GINTSTS @0xF3980014 : 0x04000021 [ 2783.913648] GINTMSK @0xF3980018 : 0xF301080E [ 2783.913652] GRXSTSR @0xF398001C : 0x000F0005 [ 2783.913656] GRXFSIZ @0xF3980024 : 0x00000306 [ 2783.913661] GNPTXFSIZ @0xF3980028 : 0x01000306 [ 2783.913665] GNPTXSTS @0xF398002C : 0x10080100 [ 2783.913670] GI2CCTL @0xF3980030 : 0x00000000 [ 2783.913674] GPVNDCTL @0xF3980034 : 0x00000000 [ 2783.913678] GGPIO @0xF3980038 : 0x00000000 [ 2783.913683] GUID @0xF398003C : 0x2708A000 [ 2783.913687] GSNPSID @0xF3980040 : 0x4F54280A [ 2783.913692] GHWCFG1 @0xF3980044 : 0x00000000 [ 2783.913696] GHWCFG2 @0xF3980048 : 0x228DDD50 [ 2783.913700] GHWCFG3 @0xF398004C : 0x0FF000E8 [ 2783.913705] GHWCFG4 @0xF3980050 : 0x1FF00020 [ 2783.913709] GLPMCFG @0xF3980054 : 0x75736230 [ 2783.913714] GPWRDN @0xF3980058 : 0x00000000 [ 2783.913718] GDFIFOCFG @0xF398005C : 0x00000000 [ 2783.913723] ADPCTL @0xF3980060 : 0x00000000 [ 2783.913727] HPTXFSIZ @0xF3980100 : 0x02000406 [ 2783.913733] DIENPTXF[1] @0xF3980104 : 0x02000406 [ 2783.913738] DIENPTXF[2] @0xF3980108 : 0x02000406 [ 2783.913743] DIENPTXF[3] @0xF398010C : 0x02000406 [ 2783.913747] DIENPTXF[4] @0xF3980110 : 0x02000406 [ 2783.913752] DIENPTXF[5] @0xF3980114 : 0x02000406 [ 2783.913757] DIENPTXF[6] @0xF3980118 : 0x02000406 [ 2783.913762] DIENPTXF[7] @0xF398011C : 0x02000406 [ 2783.913766] PCGCCTL @0xF3980E00 : 0x00000000 [ 2783.913770] Host Global Registers [ 2783.913774] HCFG @0xF3980400 : 0x00000000 [ 2783.913779] HFIR @0xF3980404 : 0x00001D4C [ 2783.913783] HFNUM @0xF3980408 : 0x0DC6090C [ 2783.913787] HPTXSTS @0xF3980410 : 0x01080200 [ 2783.913792] HAINT @0xF3980414 : 0x00000000 [ 2783.913796] HAINTMSK @0xF3980418 : 0x00000000 [ 2783.913801] HPRT0 @0xF3980440 : 0x00001005 [ 2783.913805] Host Channel 0 Specific Registers [ 2783.913810] HCCHAR @0xF3980500 : 0x00D08040 [ 2783.913814] HCSPLT @0xF3980504 : 0x00000000 [ 2783.913818] HCINT @0xF3980508 : 0x00000000 [ 2783.913823] HCINTMSK @0xF398050C : 0x00000000 [ 2783.913827] HCTSIZ @0xF3980510 : 0x8000003C [ 2783.913831] HCDMA @0xF3980514 : 0xED2B42C4 [ 2783.913835] Host Channel 1 Specific Registers [ 2783.913840] HCCHAR @0xF3980520 : 0x00D00040 [ 2783.913844] HCSPLT @0xF3980524 : 0x00000000 [ 2783.913848] HCINT @0xF3980528 : 0x00000000 [ 2783.913852] HCINTMSK @0xF398052C : 0x00000000 [ 2783.913857] HCTSIZ @0xF3980530 : 0x00000000 [ 2783.913861] HCDMA @0xF3980534 : 0xEE812000 [ 2783.913865] Host Channel 2 Specific Registers [ 2783.913869] HCCHAR @0xF3980540 : 0x00D08040 [ 2783.913873] HCSPLT @0xF3980544 : 0x00000000 [ 2783.913877] HCINT @0xF3980548 : 0x00000000 [ 2783.913882] HCINTMSK @0xF398054C : 0x00000000 [ 2783.913886] HCTSIZ @0xF3980550 : 0x8000003C [ 2783.913890] HCDMA @0xF3980554 : 0xED2B42C4 [ 2783.913894] Host Channel 3 Specific Registers [ 2783.913898] HCCHAR @0xF3980560 : 0x00D00040 [ 2783.913903] HCSPLT @0xF3980564 : 0x00000000 [ 2783.913907] HCINT @0xF3980568 : 0x00000000 [ 2783.913911] HCINTMSK @0xF398056C : 0x00000000 [ 2783.913915] HCTSIZ @0xF3980570 : 0x00000000 [ 2783.913920] HCDMA @0xF3980574 : 0xEE812000 [ 2783.913923] Host Channel 4 Specific Registers [ 2783.913928] HCCHAR @0xF3980580 : 0x00D00040 [ 2783.913932] HCSPLT @0xF3980584 : 0x00000000 [ 2783.913936] HCINT @0xF3980588 : 0x00000000 [ 2783.913940] HCINTMSK @0xF398058C : 0x00000000 [ 2783.913945] HCTSIZ @0xF3980590 : 0x20000008 [ 2783.913949] HCDMA @0xF3980594 : 0xED2B4F08 [ 2783.913953] Host Channel 5 Specific Registers [ 2783.913957] HCCHAR @0xF39805A0 : 0x00DC9810 [ 2783.913961] HCSPLT @0xF39805A4 : 0x00000000 [ 2783.913966] HCINT @0xF39805A8 : 0x00000000 [ 2783.913970] HCINTMSK @0xF39805AC : 0x00000000 [ 2783.913974] HCTSIZ @0xF39805B0 : 0x80080010 [ 2783.913978] HCDMA @0xF39805B4 : 0xED0EDE80 [ 2783.913982] Host Channel 6 Specific Registers [ 2783.913987] HCCHAR @0xF39805C0 : 0x00DC9810 [ 2783.913991] HCSPLT @0xF39805C4 : 0x00000000 [ 2783.913995] HCINT @0xF39805C8 : 0x00000000 [ 2783.913999] HCINTMSK @0xF39805CC : 0x00000000 [ 2783.914004] HCTSIZ @0xF39805D0 : 0x80080010 [ 2783.914008] HCDMA @0xF39805D4 : 0xED0EDE80 [ 2783.914012] Host Channel 7 Specific Registers [ 2783.914016] HCCHAR @0xF39805E0 : 0x00DC9810 [ 2783.914020] HCSPLT @0xF39805E4 : 0x00000000 [ 2783.914024] HCINT @0xF39805E8 : 0x00000000 [ 2783.914028] HCINTMSK @0xF39805EC : 0x00000000 [ 2783.914033] HCTSIZ @0xF39805F0 : 0x80080010 [ 2783.914037] HCDMA @0xF39805F4 : 0xED0EDE80 [ 2783.914066] gpvndctl_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.914095] ggpio_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.914128] hprt0_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2783.914158] HZ 100, MSEC_PER_JIFFIE 10, loops_per_jiffy 384000 [ 2784.283550] gnptxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.283594] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 2784.283860] busconnected_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.283914] gotgctl_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.283975] grxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.284005] gsnpsid_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.284072] gusbcfg_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.284102] hptxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.284144] devspeed_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.284155] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 2784.284197] Core is not in hibernation [ 2784.284272] hnpcapable_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2784.284302] HZ 100, MSEC_PER_JIFFIE 10, loops_per_jiffy 384000 [ 2785.253897] enumspeed_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 2785.253915] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 2785.253938] inv_sel_hsic_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.669661] dwc_otg 3f980000.usb: Invalid offset (0xffffffff) [ 3270.669728] hsic_connect_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.669802] guid_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.669855] mode_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.694469] srpcapable_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.694504] Core Global Registers [ 3270.694509] GOTGCTL @0xF3980000 : 0x001C0001 [ 3270.694514] GOTGINT @0xF3980004 : 0x00000000 [ 3270.694518] GAHBCFG @0xF3980008 : 0x00000031 [ 3270.694523] GUSBCFG @0xF398000C : 0x20001700 [ 3270.694527] GRSTCTL @0xF3980010 : 0x80000000 [ 3270.694532] GINTSTS @0xF3980014 : 0x04000021 [ 3270.694536] GINTMSK @0xF3980018 : 0xF301080E [ 3270.694541] GRXSTSR @0xF398001C : 0x000E0007 [ 3270.694545] GRXFSIZ @0xF3980024 : 0x00000306 [ 3270.694549] GNPTXFSIZ @0xF3980028 : 0x01000306 [ 3270.694554] GNPTXSTS @0xF398002C : 0x08080100 [ 3270.694558] GI2CCTL @0xF3980030 : 0x00000000 [ 3270.694562] GPVNDCTL @0xF3980034 : 0x00000000 [ 3270.694567] GGPIO @0xF3980038 : 0x00000000 [ 3270.694571] GUID @0xF398003C : 0x2708A000 [ 3270.694576] GSNPSID @0xF3980040 : 0x4F54280A [ 3270.694580] GHWCFG1 @0xF3980044 : 0x00000000 [ 3270.694584] GHWCFG2 @0xF3980048 : 0x228DDD50 [ 3270.694589] GHWCFG3 @0xF398004C : 0x0FF000E8 [ 3270.694593] GHWCFG4 @0xF3980050 : 0x1FF00020 [ 3270.694598] GLPMCFG @0xF3980054 : 0x75736230 [ 3270.694602] GPWRDN @0xF3980058 : 0x00000000 [ 3270.694606] GDFIFOCFG @0xF398005C : 0x00000000 [ 3270.694611] ADPCTL @0xF3980060 : 0x00000000 [ 3270.694616] HPTXFSIZ @0xF3980100 : 0x02000406 [ 3270.694621] DIENPTXF[1] @0xF3980104 : 0x02000406 [ 3270.694626] DIENPTXF[2] @0xF3980108 : 0x02000406 [ 3270.694631] DIENPTXF[3] @0xF398010C : 0x02000406 [ 3270.694636] DIENPTXF[4] @0xF3980110 : 0x02000406 [ 3270.694640] DIENPTXF[5] @0xF3980114 : 0x02000406 [ 3270.694677] DIENPTXF[6] @0xF3980118 : 0x02000406 [ 3270.694682] DIENPTXF[7] @0xF398011C : 0x02000406 [ 3270.694687] PCGCCTL @0xF3980E00 : 0x00000000 [ 3270.694691] Host Global Registers [ 3270.694696] HCFG @0xF3980400 : 0x00000000 [ 3270.694701] HFIR @0xF3980404 : 0x00001D4C [ 3270.694705] HFNUM @0xF3980408 : 0x07E532EC [ 3270.694717] HPTXSTS @0xF3980410 : 0x29080200 [ 3270.694745] HAINT @0xF3980414 : 0x00000000 [ 3270.694759] HAINTMSK @0xF3980418 : 0x00000000 [ 3270.694769] HPRT0 @0xF3980440 : 0x00001005 [ 3270.694781] Host Channel 0 Specific Registers [ 3270.694791] HCCHAR @0xF3980500 : 0x00DC9810 [ 3270.694803] HCSPLT @0xF3980504 : 0x00000000 [ 3270.694813] HCINT @0xF3980508 : 0x00000000 [ 3270.694825] HCINTMSK @0xF398050C : 0x00000000 [ 3270.694837] HCTSIZ @0xF3980510 : 0x80080010 [ 3270.694850] HCDMA @0xF3980514 : 0xED0EDE80 [ 3270.694861] Host Channel 1 Specific Registers [ 3270.694870] HCCHAR @0xF3980520 : 0x00D08040 [ 3270.694874] HCSPLT @0xF3980524 : 0x00000000 [ 3270.694879] HCINT @0xF3980528 : 0x00000000 [ 3270.694883] HCINTMSK @0xF398052C : 0x00000000 [ 3270.694887] HCTSIZ @0xF3980530 : 0x8000003C [ 3270.694892] HCDMA @0xF3980534 : 0xEC80C7C4 [ 3270.694896] Host Channel 2 Specific Registers [ 3270.694900] HCCHAR @0xF3980540 : 0x00DC9810 [ 3270.694905] HCSPLT @0xF3980544 : 0x00000000 [ 3270.694909] HCINT @0xF3980548 : 0x00000000 [ 3270.694913] HCINTMSK @0xF398054C : 0x00000000 [ 3270.694918] HCTSIZ @0xF3980550 : 0x80080010 [ 3270.694922] HCDMA @0xF3980554 : 0xED0EDE80 [ 3270.694926] Host Channel 3 Specific Registers [ 3270.694931] HCCHAR @0xF3980560 : 0x00D00040 [ 3270.694935] HCSPLT @0xF3980564 : 0x00000000 [ 3270.694939] HCINT @0xF3980568 : 0x00000000 [ 3270.694945] HCINTMSK @0xF398056C : 0x00000000 [ 3270.694950] HCTSIZ @0xF3980570 : 0x00000000 [ 3270.694955] HCDMA @0xF3980574 : 0xEE812000 [ 3270.694958] Host Channel 4 Specific Registers [ 3270.694963] HCCHAR @0xF3980580 : 0x00DC9810 [ 3270.694967] HCSPLT @0xF3980584 : 0x00000000 [ 3270.694971] HCINT @0xF3980588 : 0x00000000 [ 3270.694976] HCINTMSK @0xF398058C : 0x00000000 [ 3270.694980] HCTSIZ @0xF3980590 : 0x80080010 [ 3270.694984] HCDMA @0xF3980594 : 0xED0EDE80 [ 3270.694988] Host Channel 5 Specific Registers [ 3270.694992] HCCHAR @0xF39805A0 : 0x00D00040 [ 3270.694997] HCSPLT @0xF39805A4 : 0x00000000 [ 3270.695001] HCINT @0xF39805A8 : 0x00000000 [ 3270.695005] HCINTMSK @0xF39805AC : 0x00000000 [ 3270.695009] HCTSIZ @0xF39805B0 : 0x00000000 [ 3270.695014] HCDMA @0xF39805B4 : 0xEE812000 [ 3270.695018] Host Channel 6 Specific Registers [ 3270.695022] HCCHAR @0xF39805C0 : 0x00D00040 [ 3270.695026] HCSPLT @0xF39805C4 : 0x00000000 [ 3270.695030] HCINT @0xF39805C8 : 0x00000000 [ 3270.695035] HCINTMSK @0xF39805CC : 0x00000000 [ 3270.695039] HCTSIZ @0xF39805D0 : 0x20000008 [ 3270.695043] HCDMA @0xF39805D4 : 0xEC80CBC8 [ 3270.695047] Host Channel 7 Specific Registers [ 3270.695051] HCCHAR @0xF39805E0 : 0x009C8801 [ 3270.695056] HCSPLT @0xF39805E4 : 0x00000000 [ 3270.695060] HCINT @0xF39805E8 : 0x00000000 [ 3270.695067] HCINTMSK @0xF39805EC : 0x00000000 [ 3270.695071] HCTSIZ @0xF39805F0 : 0x80080001 [ 3270.695076] HCDMA @0xF39805F4 : 0xED0F21C0 [ 3270.695117] gpvndctl_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.695150] ggpio_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.695188] hprt0_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3270.695228] HZ 100, MSEC_PER_JIFFIE 10, loops_per_jiffy 384000 [ 3271.040447] gnptxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.040490] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 3271.040799] busconnected_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.040853] gotgctl_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.040913] grxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.040942] gsnpsid_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.041006] gusbcfg_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.041036] hptxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.041077] devspeed_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.041087] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 3271.041143] Core is not in hibernation [ 3271.041238] hnpcapable_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.041268] HZ 100, MSEC_PER_JIFFIE 10, loops_per_jiffy 384000 [ 3271.965367] enumspeed_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3271.965385] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 3271.965410] inv_sel_hsic_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.041490] dwc_otg 3f980000.usb: Invalid offset (0xffffffff) [ 3329.041524] hsic_connect_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.041550] guid_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.041578] mode_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.061570] srpcapable_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.061605] Core Global Registers [ 3329.061611] GOTGCTL @0xF3980000 : 0x001C0001 [ 3329.061616] GOTGINT @0xF3980004 : 0x00000000 [ 3329.061620] GAHBCFG @0xF3980008 : 0x00000031 [ 3329.061625] GUSBCFG @0xF398000C : 0x20001700 [ 3329.061629] GRSTCTL @0xF3980010 : 0x80000000 [ 3329.061634] GINTSTS @0xF3980014 : 0x04000021 [ 3329.061638] GINTMSK @0xF3980018 : 0xF301080E [ 3329.061643] GRXSTSR @0xF398001C : 0x000E0002 [ 3329.061647] GRXFSIZ @0xF3980024 : 0x00000306 [ 3329.061652] GNPTXFSIZ @0xF3980028 : 0x01000306 [ 3329.061656] GNPTXSTS @0xF398002C : 0x08080100 [ 3329.061661] GI2CCTL @0xF3980030 : 0x00000000 [ 3329.061665] GPVNDCTL @0xF3980034 : 0x00000000 [ 3329.061670] GGPIO @0xF3980038 : 0x00000000 [ 3329.061674] GUID @0xF398003C : 0x2708A000 [ 3329.061678] GSNPSID @0xF3980040 : 0x4F54280A [ 3329.061682] GHWCFG1 @0xF3980044 : 0x00000000 [ 3329.061687] GHWCFG2 @0xF3980048 : 0x228DDD50 [ 3329.061691] GHWCFG3 @0xF398004C : 0x0FF000E8 [ 3329.061696] GHWCFG4 @0xF3980050 : 0x1FF00020 [ 3329.061700] GLPMCFG @0xF3980054 : 0x75736230 [ 3329.061704] GPWRDN @0xF3980058 : 0x00000000 [ 3329.061709] GDFIFOCFG @0xF398005C : 0x00000000 [ 3329.061714] ADPCTL @0xF3980060 : 0x00000000 [ 3329.061718] HPTXFSIZ @0xF3980100 : 0x02000406 [ 3329.061723] DIENPTXF[1] @0xF3980104 : 0x02000406 [ 3329.061728] DIENPTXF[2] @0xF3980108 : 0x02000406 [ 3329.061733] DIENPTXF[3] @0xF398010C : 0x02000406 [ 3329.061738] DIENPTXF[4] @0xF3980110 : 0x02000406 [ 3329.061743] DIENPTXF[5] @0xF3980114 : 0x02000406 [ 3329.061748] DIENPTXF[6] @0xF3980118 : 0x02000406 [ 3329.061752] DIENPTXF[7] @0xF398011C : 0x02000406 [ 3329.061757] PCGCCTL @0xF3980E00 : 0x00000000 [ 3329.061761] Host Global Registers [ 3329.061765] HCFG @0xF3980400 : 0x00000000 [ 3329.061770] HFIR @0xF3980404 : 0x00001D4C [ 3329.061774] HFNUM @0xF3980408 : 0x1C6D12A7 [ 3329.061779] HPTXSTS @0xF3980410 : 0x39080200 [ 3329.061783] HAINT @0xF3980414 : 0x00000000 [ 3329.061788] HAINTMSK @0xF3980418 : 0x00000000 [ 3329.061792] HPRT0 @0xF3980440 : 0x00001005 [ 3329.061796] Host Channel 0 Specific Registers [ 3329.061801] HCCHAR @0xF3980500 : 0x00D08040 [ 3329.061805] HCSPLT @0xF3980504 : 0x00000000 [ 3329.061810] HCINT @0xF3980508 : 0x00000000 [ 3329.061814] HCINTMSK @0xF398050C : 0x00000000 [ 3329.061818] HCTSIZ @0xF3980510 : 0x8000003C [ 3329.061822] HCDMA @0xF3980514 : 0xEDB72484 [ 3329.061826] Host Channel 1 Specific Registers [ 3329.061831] HCCHAR @0xF3980520 : 0x00D08040 [ 3329.061835] HCSPLT @0xF3980524 : 0x00000000 [ 3329.061839] HCINT @0xF3980528 : 0x00000000 [ 3329.061844] HCINTMSK @0xF398052C : 0x00000000 [ 3329.061848] HCTSIZ @0xF3980530 : 0x8000003C [ 3329.061852] HCDMA @0xF3980534 : 0xEDB72484 [ 3329.061856] Host Channel 2 Specific Registers [ 3329.061860] HCCHAR @0xF3980540 : 0x00DC9810 [ 3329.061865] HCSPLT @0xF3980544 : 0x00000000 [ 3329.061869] HCINT @0xF3980548 : 0x00000000 [ 3329.061873] HCINTMSK @0xF398054C : 0x00000000 [ 3329.061877] HCTSIZ @0xF3980550 : 0x80080010 [ 3329.061881] HCDMA @0xF3980554 : 0xED0EDE80 [ 3329.061885] Host Channel 3 Specific Registers [ 3329.061890] HCCHAR @0xF3980560 : 0x00D00040 [ 3329.061894] HCSPLT @0xF3980564 : 0x00000000 [ 3329.061898] HCINT @0xF3980568 : 0x00000000 [ 3329.061903] HCINTMSK @0xF398056C : 0x00000000 [ 3329.061907] HCTSIZ @0xF3980570 : 0x00000000 [ 3329.061911] HCDMA @0xF3980574 : 0xEE812000 [ 3329.061915] Host Channel 4 Specific Registers [ 3329.061919] HCCHAR @0xF3980580 : 0x00DC9810 [ 3329.061923] HCSPLT @0xF3980584 : 0x00000000 [ 3329.061928] HCINT @0xF3980588 : 0x00000000 [ 3329.061932] HCINTMSK @0xF398058C : 0x00000000 [ 3329.061936] HCTSIZ @0xF3980590 : 0x80080010 [ 3329.061941] HCDMA @0xF3980594 : 0xED0EDE80 [ 3329.061944] Host Channel 5 Specific Registers [ 3329.061949] HCCHAR @0xF39805A0 : 0x00D00040 [ 3329.061953] HCSPLT @0xF39805A4 : 0x00000000 [ 3329.061957] HCINT @0xF39805A8 : 0x00000000 [ 3329.061962] HCINTMSK @0xF39805AC : 0x00000000 [ 3329.061966] HCTSIZ @0xF39805B0 : 0x00000000 [ 3329.061970] HCDMA @0xF39805B4 : 0xEE812000 [ 3329.061974] Host Channel 6 Specific Registers [ 3329.061978] HCCHAR @0xF39805C0 : 0x00D00040 [ 3329.061982] HCSPLT @0xF39805C4 : 0x00000000 [ 3329.061987] HCINT @0xF39805C8 : 0x00000000 [ 3329.061991] HCINTMSK @0xF39805CC : 0x00000000 [ 3329.061995] HCTSIZ @0xF39805D0 : 0x20000008 [ 3329.062000] HCDMA @0xF39805D4 : 0xEDB72B08 [ 3329.062004] Host Channel 7 Specific Registers [ 3329.062008] HCCHAR @0xF39805E0 : 0x009C8801 [ 3329.062012] HCSPLT @0xF39805E4 : 0x00000000 [ 3329.062017] HCINT @0xF39805E8 : 0x00000000 [ 3329.062021] HCINTMSK @0xF39805EC : 0x00000000 [ 3329.062025] HCTSIZ @0xF39805F0 : 0x80080001 [ 3329.062030] HCDMA @0xF39805F4 : 0xED0F21C0 [ 3329.062065] gpvndctl_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.062094] ggpio_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.062121] hprt0_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.062149] HZ 100, MSEC_PER_JIFFIE 10, loops_per_jiffy 384000 [ 3329.431906] gnptxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.431956] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 3329.432206] busconnected_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432254] gotgctl_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432305] grxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432334] gsnpsid_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432396] gusbcfg_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432424] hptxfsiz_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432451] devspeed_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432464] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 3329.432497] Core is not in hibernation [ 3329.432560] hnpcapable_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3329.432587] HZ 100, MSEC_PER_JIFFIE 10, loops_per_jiffy 384000 [ 3330.399175] enumspeed_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 3330.399191] WARN::dwc_otg_handle_mode_mismatch_intr:68: Mode Mismatch Interrupt: currently in Host mode

[ 3330.399228] inv_sel_hsic_show(ad9fd810) -> platform_dev ad9fd800, otg_dev ad031800 [ 5511.467547] cfg80211: Current regulatory domain intersected: [ 5511.467570] cfg80211: DFS Master region: ETSI [ 5511.467579] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 5511.467595] cfg80211: (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 5511.467610] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 5511.467625] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 5511.467638] cfg80211: (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2698 mBm), (0 s) [ 5511.467651] cfg80211: (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
'''

I have also found this thread, but havn't got the chance to try it out: https://community.nxp.com/thread/352772

As soon as I get my internet connection back, I will try out some more testing and report back.

Ruffio commented 8 years ago

Sorry, this is the correct link: http://fuzon.co.uk/phpbb/viewtopic.php?f=11&t=151&sid=b4aaa56c509e6d83ec743355d502d1ec&start=20

clivem commented 8 years ago

I don't know where to see if my AP is configured to DE, it is not an open source AP.

Just scan, sudo iw dev wlan0 scan,then look at the details shown for each AP it finds, including yours and see if it has a country code configured...

I've got a feeling that when you associate with an AP via wpa_supplicant, some kind of callback takes place, probably via udev, (/lib/udev/rules.d/85-regulatory.rules change event calls setregdomain), if a country code is set on the AP. You could probably add some sort of logging to that change event, or a wrapper around setregdomain, so you can see when those events are being generated.

lfoerster commented 8 years ago

Here its definitely not the case. The stick (TP-Link TL-WN722N) comes up with regulatory domain set to China (CN) and, weired enough, DFS set to FCC: _root@lcdpi:/home/pi# dmesg | grep 802 [ 3.937802] systemd[1]: Listening on udev Kernel Socket. [ 10.701188] cfg80211: Calling CRDA to update world regulatory domain [ 13.254861] cfg80211: World regulatory domain updated: [ 13.254904] cfg80211: DFS Master region: unset [ 13.254956] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time) [ 13.254980] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 13.254996] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A) [ 13.255012] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A) [ 13.255063] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A) [ 13.255086] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s) [ 13.255103] cfg80211: (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s) [ 13.255118] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A) [ 13.255133] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A) [ 14.808116] ieee80211 phy0: Atheros AR9271 Rev:1 --> [ 14.808326] cfg80211: Calling CRDA for country: CN [ 15.266293] cfg80211: Regulatory domain changed to country: CN [ 15.266364] cfg80211: DFS Master region: FCC <-- [ 15.266379] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cactime)

Putting the "iw reg set DE" command into rc.local switches it to DE and ETSI:

[ 22.480363] cfg80211: Calling CRDA for country: DE [ 22.914043] cfg80211: Regulatory domain changed to country: DE [ 22.914081] cfg80211: DFS Master region: ETSI root@lcdpi:/home/pi# iw reg get country DE: DFS-ETSI (2400 - 2483 @ 40), (N/A, 20), (N/A) (5150 - 5250 @ 80), (N/A, 20), (N/A), NO-OUTDOOR (5250 - 5350 @ 80), (N/A, 20), (0 ms), NO-OUTDOOR, DFS (5470 - 5725 @ 160), (N/A, 26), (0 ms), DFS (57000 - 66000 @ 2160), (N/A, 40), (N/A) So as a conclusion it can be set to different values by the software and its definitely not predefined or somehow "burned in" to a EEPROM or so. With nothing configured it stays in regulatory domain CN (China) and DFS FCC.

Changing the /etc/defaults/crda domain setting to DE sets the regulatory domain to county code 98 after reboot with no ISO name just the number (98 is reported as Iran...ooops). This is definitely wrong. Why is DE converted to "98" ? If its preset like this in the /etc/defaults/crda btw. it can NOT be set with iw reg set DE command to a different value. Its stays 98. the iw set command is just ignored. After erasing DE in /etc/defaults/crda it then can be set with the "iw reg set xy" commad to different values again. Thats why i ended up setting it in r.local. This finally did set the correct reg.domain as a quick and dirty workaround.

clivem commented 8 years ago

So as a conclusion it can be set to different values by the software and its definitely not predefined or somehow "burned in" to a EEPROM or so.

@lfoerster I think we are heading away from what the problem actually is now, but anyway..... I think setting regdomain from software/userspace can only make things more restrictive, with regard to regulatory restictions on channels and power, not less. It will not override what is set in the EEPROM. eg. I bought a wifi dongle from an American eBay vendor. The country was set to 'US' in the EEPROM. iw reg set GB, did not restore the availability of channels 12 and 13. ;) ISTR, that from userspace crda you can make it more restrictive than was originally programmed, but not less.

@Ruffio Anyway, before I butt-out of this conversation, you can always monitor the udev events from userspace. Probably won't tell you what is generating the regdomain change events, but should at least make it easy to see the country code that is being sent to userspace crda (setregdomain) from the kernel. sudo udevadm monitor --environment kernel

Ruffio commented 8 years ago

My whole point of creating this issue is that I can see that RPi3 using onboard wifi does three times of changing the regulatory domain. IMHO it should only do it one time, not three. It should be unnecessary to the two last changes and it takes time for the booting to complete. I worries me that the CRDA has been implemented but there is no guidance in how to set it correctly.

In this thread (http://raspberrypi.stackexchange.com/questions/40738/jessie-cfg80211-calling-crda-to-update-world-regulatory-domain) three valid suggestions are proposed and tried but none of them are working and I find no documentation on the official RPi Forum that explains what the correct way of doing it is.

I still haven't been able to test in depth yet, but will eventually get there... @clivem thanks. As far as I understand it, your suggested monitor-line only shows what is happening from when it is executed and not during boot. Correct?

clivem commented 8 years ago

@Ruffio Rasmus, I don't know if this is going to help you in any way, or muddy the waters because I'm using Fedora (F24) and my network connections are managed by NetworkManager, but anyway, I think this is working correctly..... (Or at least, the way I expect things to be working.) By which I mean, that World regulatory is "updated" followed by crda setting "GB" because of my London timezone.

NB. In the case of the Atheros dongle, (example 3 log), it's CN, then GB. This is because the Atheros dongle has CN (China) programmed in hardware and the ath9k driver sets the regulatory based on that before it is changed, based on timezone, via /lib/udev/rules.d/85-regulatory.rules.

Example 1, using on-board Pi3B brcmfmac.

Feb 11 16:28:08 IQPlus3B1 kernel: usbcore: registered new interface driver brcmfmac
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211: World regulatory domain updated:
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:  DFS Master region: unset
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:08 IQPlus3B1 kernel: cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Feb 11 16:28:09 IQPlus3B1 kernel: brcmfmac: brcmf_c_preinit_dcmds: Firmware version = wl0: May 27 2016 00:13:38 version 7.45.41.26 (r640327) FWID 01-df77e4a7
Feb 11 16:28:09 IQPlus3B1 kernel: brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code
Feb 11 16:28:09 IQPlus3B1 crda[276]: setting regulatory domain to GB based on timezone (Europe/London)
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211: Regulatory domain changed to country: GB
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:  DFS Master region: ETSI
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Feb 11 16:28:09 IQPlus3B1 kernel: cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Feb 11 16:28:13 IQPlus3B1 NetworkManager[375]: <info>  [1455208093.5517] rfkill0: found WiFi radio killswitch (at /sys/devices/platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/ieee80211/phy0/rfkill0) (driver brcmfmac_sdio)
Feb 11 16:28:13 IQPlus3B1 kernel: brcmfmac: power management disabled
Feb 11 16:28:15 IQPlus3B1 kernel: brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
Feb 11 16:28:15 IQPlus3B1 kernel: brcmfmac: brcmf_add_if: ignore IF event
Feb 11 16:28:15 IQPlus3B1 kernel: brcmfmac: power management disabled
Feb 11 16:28:15 IQPlus3B1 dbus[363]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'
Feb 11 16:28:16 IQPlus3B1 dbus[363]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'
Feb 11 16:28:16 IQPlus3B1 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=wpa_supplicant comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 11 16:28:16 IQPlus3B1 wpa_supplicant[459]: Successfully initialized wpa_supplicant
Feb 11 16:28:16 IQPlus3B1 NetworkManager[375]: <info>  [1455208096.0965] supplicant: wpa_supplicant running
Feb 11 16:28:16 IQPlus3B1 kernel: brcmfmac: brcmf_add_if: ERROR: netdev:wlan0 already exists
Feb 11 16:28:16 IQPlus3B1 kernel: brcmfmac: brcmf_add_if: ignore IF event
Feb 11 16:28:16 IQPlus3B1 wpa_supplicant[459]: Could not read interface p2p-dev-wlan0 flags: No such device
Feb 11 16:28:17 IQPlus3B1 wpa_supplicant[459]: wlan0: Trying to associate with SSID 'BTHub4-FM2W'
Feb 11 16:28:17 IQPlus3B1 wpa_supplicant[459]: wlan0: Associated with 4c:5e:0c:6c:21:ac
Feb 11 16:28:17 IQPlus3B1 wpa_supplicant[459]: wlan0: WPA: Key negotiation completed with 4c:5e:0c:6c:21:ac [PTK=CCMP GTK=CCMP]
Feb 11 16:28:17 IQPlus3B1 wpa_supplicant[459]: wlan0: CTRL-EVENT-CONNECTED - Connection to 4c:5e:0c:6c:21:ac completed [id=0 id_str=]

Example 2, using mt7601u dongle.

Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211: World regulatory domain updated:
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:  DFS Master region: unset
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi2B1 kernel: cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Feb 11 16:28:14 IQDigi2B1 kernel: mt7601u 1-1.5:1.0: ASIC revision: 76010001 MAC revision: 76010500
Feb 11 16:28:14 IQDigi2B1 kernel: mt7601u 1-1.5:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
Feb 11 16:28:15 IQDigi2B1 kernel: mt7601u 1-1.5:1.0: EEPROM ver:0b fae:00
Feb 11 16:28:15 IQDigi2B1 kernel: usbcore: registered new interface driver mt7601u
Feb 11 16:28:15 IQDigi2B1 crda[283]: setting regulatory domain to GB based on timezone (Europe/London)
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211: Regulatory domain changed to country: GB
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:  DFS Master region: ETSI
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Feb 11 16:28:15 IQDigi2B1 kernel: cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Feb 11 16:28:19 IQDigi2B1 NetworkManager[380]: <info>  [1455208099.2739] rfkill0: found WiFi radio killswitch (at /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/ieee80211/phy0/rfkill0) (driver mt7601u)
Feb 11 16:28:21 IQDigi2B1 dbus[366]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'
Feb 11 16:28:22 IQDigi2B1 dbus[366]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'
Feb 11 16:28:22 IQDigi2B1 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=wpa_supplicant comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 11 16:28:22 IQDigi2B1 wpa_supplicant[481]: Successfully initialized wpa_supplicant
Feb 11 16:28:22 IQDigi2B1 NetworkManager[380]: <info>  [1455208102.2586] supplicant: wpa_supplicant running
Feb 11 16:28:23 IQDigi2B1 wpa_supplicant[481]: wlan0: SME: Trying to authenticate with 4c:5e:0c:6c:21:ac (SSID='BTHub4-FM2W' freq=2412 MHz)
Feb 11 16:28:23 IQDigi2B1 wpa_supplicant[481]: wlan0: Trying to associate with 4c:5e:0c:6c:21:ac (SSID='BTHub4-FM2W' freq=2412 MHz)
Feb 11 16:28:23 IQDigi2B1 wpa_supplicant[481]: wlan0: Associated with 4c:5e:0c:6c:21:ac
Feb 11 16:28:23 IQDigi2B1 wpa_supplicant[481]: wlan0: WPA: Key negotiation completed with 4c:5e:0c:6c:21:ac [PTK=CCMP GTK=CCMP]
Feb 11 16:28:23 IQDigi2B1 wpa_supplicant[481]: wlan0: CTRL-EVENT-CONNECTED - Connection to 4c:5e:0c:6c:21:ac completed [id=0 id_str=]

Example 3, using Atheros AR9721 dongle.

Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211: World regulatory domain updated:
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:  DFS Master region: unset
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz, 92000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:12 IQDigi3B1 kernel: usb 1-1.4: ath9k_htc: Firmware ath9k_htc/htc_9271-1.4.0.fw requested
Feb 11 16:28:12 IQDigi3B1 kernel: usbcore: registered new interface driver ath9k_htc
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (5490000 KHz - 5730000 KHz @ 160000 KHz), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:12 IQDigi3B1 kernel: cfg80211:   (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm), (N/A)
Feb 11 16:28:12 IQDigi3B1 kernel: usb 1-1.4: ath9k_htc: Transferred FW: ath9k_htc/htc_9271-1.4.0.fw, size: 51008
Feb 11 16:28:13 IQDigi3B1 kernel: ath9k_htc 1-1.4:1.0: ath9k_htc: HTC initialized with 33 credits
Feb 11 16:28:13 IQDigi3B1 kernel: ath9k_htc 1-1.4:1.0: ath9k_htc: FW Version: 1.4
Feb 11 16:28:13 IQDigi3B1 kernel: ath9k_htc 1-1.4:1.0: FW RMW support: On
Feb 11 16:28:13 IQDigi3B1 kernel: ath: EEPROM regdomain: 0x809c
Feb 11 16:28:13 IQDigi3B1 kernel: ath: EEPROM indicates we should expect a country code
Feb 11 16:28:13 IQDigi3B1 kernel: ath: doing EEPROM country->regdmn map search
Feb 11 16:28:13 IQDigi3B1 kernel: ath: country maps to regdmn code: 0x52
Feb 11 16:28:13 IQDigi3B1 kernel: ath: Country alpha2 being used: CN
Feb 11 16:28:13 IQDigi3B1 kernel: ath: Regpair used: 0x52
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211: Regulatory domain changed to country: CN
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:  DFS Master region: FCC
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (N/A)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2300 mBm), (0 s)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (5735000 KHz - 5835000 KHz @ 80000 KHz), (N/A, 3000 mBm), (N/A)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (57240000 KHz - 59400000 KHz @ 2160000 KHz), (N/A, 2800 mBm), (N/A)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (59400000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4400 mBm), (N/A)
Feb 11 16:28:13 IQDigi3B1 kernel: cfg80211:   (63720000 KHz - 65880000 KHz @ 2160000 KHz), (N/A, 2800 mBm), (N/A)
Feb 11 16:28:14 IQDigi3B1 crda[345]: setting regulatory domain to GB based on timezone (Europe/London)
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211: Regulatory domain changed to country: GB
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:  DFS Master region: ETSI
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp), (dfs_cac_time)
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:   (2402000 KHz - 2482000 KHz @ 40000 KHz), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:   (5170000 KHz - 5250000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (N/A)
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:   (5250000 KHz - 5330000 KHz @ 80000 KHz, 160000 KHz AUTO), (N/A, 2000 mBm), (0 s)
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:   (5490000 KHz - 5710000 KHz @ 160000 KHz), (N/A, 2700 mBm), (0 s)
Feb 11 16:28:14 IQDigi3B1 kernel: cfg80211:   (57000000 KHz - 66000000 KHz @ 2160000 KHz), (N/A, 4000 mBm), (N/A)
Feb 11 16:28:17 IQDigi3B1 NetworkManager[388]: <info>  [1455208097.7669] rfkill0: found WiFi radio killswitch (at /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/ieee80211/phy0/rfkill0) (driver ath9k_htc)
Feb 11 16:28:22 IQDigi3B1 dbus[380]: [system] Activating via systemd: service name='fi.w1.wpa_supplicant1' unit='wpa_supplicant.service'
Feb 11 16:28:23 IQDigi3B1 dbus[380]: [system] Successfully activated service 'fi.w1.wpa_supplicant1'
Feb 11 16:28:23 IQDigi3B1 audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=wpa_supplicant comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Feb 11 16:28:23 IQDigi3B1 wpa_supplicant[515]: Successfully initialized wpa_supplicant
Feb 11 16:28:23 IQDigi3B1 NetworkManager[388]: <info>  [1455208103.0832] supplicant: wpa_supplicant running
Feb 11 16:28:26 IQDigi3B1 wpa_supplicant[515]: wlan0: SME: Trying to authenticate with 4c:5e:0c:6c:21:ac (SSID='BTHub4-FM2W' freq=2412 MHz)
Feb 11 16:28:27 IQDigi3B1 wpa_supplicant[515]: wlan0: Trying to associate with 4c:5e:0c:6c:21:ac (SSID='BTHub4-FM2W' freq=2412 MHz)
Feb 11 16:28:27 IQDigi3B1 wpa_supplicant[515]: wlan0: Associated with 4c:5e:0c:6c:21:ac
Feb 11 16:28:27 IQDigi3B1 wpa_supplicant[515]: wlan0: WPA: Key negotiation completed with 4c:5e:0c:6c:21:ac [PTK=CCMP GTK=CCMP]
Feb 11 16:28:27 IQDigi3B1 wpa_supplicant[515]: wlan0: CTRL-EVENT-CONNECTED - Connection to 4c:5e:0c:6c:21:ac completed [id=0 id_str=]
Ruffio commented 8 years ago

Looking at my AP, I do see the country set to DE even I live in DK, so that must be the reason why the driver changes. That should IMHO be configurable not to align. with AP:

BSS 8c:10:d4:9a:6f:46(on wlan0) -- associated TSF: 0 usec (0d, 00:00:00) freq: 2427 beacon interval: 100 TUs capability: ESS Privacy SpectrumMgmt ShortSlotTime RadioMeasure (0x1511) signal: -10.00 dBm last seen: 0 ms ago SSID: xxx Supported rates: 1.0* 2.0* 5.5* 11.0* 18.0 24.0 36.0 54.0 DS Parameter set: channel 4 Country: DE Environment: Indoor/Outdoor Channels [1 - 13] @ 20 dBm Power constraint: 0 dB TPC report: TX power: 16 dBm ERP: Barker_Preamble_Mode ERP D4.0: Barker_Preamble_Mode RSN: * Version: 1 * Group cipher: CCMP * Pairwise ciphers: CCMP * Authentication suites: PSK * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c) Extended supported rates: 6.0 9.0 12.0 48.0 BSS Load: * station count: 7 * channel utilisation: 32/255 * available admission capacity: 0 [32us] HT capabilities: Capabilities: 0x19ad RX LDPC HT20 SM Power Save disabled RX HT20 SGI TX STBC RX STBC 1-stream Max AMSDU length: 7935 bytes DSSS/CCK HT40 Maximum RX AMPDU length 65535 bytes (exponent: 0x003) Minimum RX AMPDU time spacing: 4 usec (0x05) HT RX MCS rate indexes supported: 0-23 HT TX MCS rate indexes are undefined HT operation: * primary channel: 4 * secondary channel offset: no secondary * STA channel width: 20 MHz * RIFS: 0 * HT protection: non-HT mixed * non-GF present: 1 * OBSS non-GF present: 1 * dual beacon: 0 * dual CTS protection: 0 * STBC beacon: 0 * L-SIG TXOP Prot: 0 * PCO active: 0 * PCO phase: 0 Extended capabilities: Extended Channel Switching, BSS Transition, 6 WPS: * Version: 1.0 * Wi-Fi Protected Setup State: 2 (Configured) * Response Type: 3 (AP) * UUID: 89a5682a-45e7-18e8-3996-3d5f1f735d51 * Manufacturer: Sagemcom * Model: Sagemcom * Model Number: 123456 * Serial Number: 0000001 * Primary Device Type: 6-0050f204-1 * Device name: SagemcomAP * Config methods: Display * RF Bands: 0x3 * Unknown TLV (0x1049, 6 bytes): 00 37 2a 00 01 20 WMM: * Parameter version 1 * u-APSD * BE: CW 15-1023, AIFSN 3 * BK: CW 15-1023, AIFSN 7 * VI: CW 7-15, AIFSN 2, TXOP 3008 usec \ VO: CW 3-7, AIFSN 2, TXOP 1504 usec

Regarding the error [ 12.324228] brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code I have found this: https://patchwork.kernel.org/patch/8336131/

clivem commented 8 years ago

Looking at my AP, I do see the country set to DE even I live in DK, so that must be the reason why the driver changes. That should IMHO be configurable not to align. with AP:

The whole point of the Linux kernel wifi code respecting 802.11d, if being broadcast by an AP, is to ensure radio regulatory compliance from the Linux side of things. I'd suggest that the problem is with the configuration of your AP, not the Linux wifi stack. ;)

Ruffio commented 8 years ago

@clivem I agree and the one part, but how do you explain the brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code before the Interface has connected to the AP? Where is it that the driver is looking for ISO3166 code and potentially misread it? As far as I can find out, that is in etc/wpa_supplicant/wpa_supplicant.conf and /etc/default/crda where I already have configured it to be DK, so why does it throw that error?

clivem commented 8 years ago

how do you explain the brcmfmac: brcmf_cfg80211_reg_notifier: not a ISO3166 code before the Interface has connected to the AP

Like the Atheros which implements a mapping table in the driver, the (BRCM) firmware is using different codes internally, to the actual 2 digit country codes. That patch you referenced implements a mechanism to lookup a country code in a driver and convert it to what they are actually using internally. (Although, I didn't notice any actual mapping table.)

Also, ISTR the driver code is throwing that warning/error when it receives any country code that isn't comprised of A-Z chars. It seems to happen after the world defaults are set from cfg80211. It's possibly just the reg_notifier callback into the driver after the world defaults are set from cfg80211 driver, and can probably be ignored........

Arend Van Spriel is probably the BRCM guy you need to start talking to, for definitive answers on anything concerning BRCM wifi. His email address is in that patch you referenced.

Ruffio commented 8 years ago

@clivem thanks for your response, and please bear over with me if/when there is something I miss/don't understand. As I'm developing an application to be runned on RPi, I really don't like when errors are thrown. In my (naive) world one should try to avoid errors and that is the reason why I'm having focus on this. In my world, if I configure it correctly, then there will (ideally) be no errors.

In your response I can't quite figure out if the driver can be configured/implemented differently in the various implementation. I have tried to find out how to configure it, but I can't find any documentation regarding this on the official RPi homepage. I know that it is not supposed to be a wiki with information of everything, and that is why I have tried to use configurations that other implementation have used.

Since noone can answer me how to configure it correctly so no errors are thrown, I guess that nobody really knows? I could understand it if I had configured it in a very special and never used way, but this is how it works out of the box, without any configuration.

Your suggestion regarding contacting Arend, that I will follow and update this issue. Hopefully soon :-) Thanks all for your contributions.

clivem commented 8 years ago

@Ruffio Sorry, I'm not doing a very good job of explaining..... Even when I have an understanding in my own head, I'm not so good at putting it into words. Let me try again....

The error you see, brcmf_cfg80211_reg_notifier: not a ISO3166 code, is because cfg80211 sets an initial WORLD regulatory (lowest common denominator) profile before any more specific country one. That "default" WORLD profile has a country code of '00'. The brcmfmac reg_notifier callback checks for upper-case alpha chars, and "errors" on anything else, so it says '00' is not a ISO3166 code.

    /* ignore non-ISO3166 country codes */
    for (i = 0; i < sizeof(req->alpha2); i++)
        if (req->alpha2[i] < 'A' || req->alpha2[i] > 'Z') {
            brcmf_err("not a ISO3166 code\n");
            return;
        }

All this means, AFAICT, is that the country code of '00' isn't passed back to the firmware by the driver.

Later, you are setting a country code of 'DK'. This is "passed" by the driver to the device firmware.

I agree, that in an ideal world there would be no errors, but I think this error, that '00' is not a ISO3166 code and it is being ignored by the BRCM wifi hardware, isn't really something you need to be concerned about.

Ruffio commented 8 years ago

Thanks.

I wrote to Arend that quickly responded with the below. I guess there is nothing more to be done here as it is working as designed, even I don't agree on throwing an error if nothing can be done/configured to prevent this.

I can. This is not really a problem. The regulatory code in cfg80211 has a world regulatory domain which is identified with "00". It notifies the brcmfmac driver about this domain, but "00" is not a proper ISO3166 code and as such there is no need to handle this in the driver. We could add an exception for "00" in the driver, ie. ignore it without logging an error message.

Regards, Arend