The problem that I have observed intermittently as kernel patches come through, is that my wifi does not always obtain the regulatory domain from the AP. The symptom is poor connectivity with frequent drops, and the work-aroud has been to issue the command sudo iw reg set US
, which I usually place in /etc/rc.local as iw reg set US
So the question is: does anyone know how to query the AP (a linksys WRT610N) to ask what regulatory domain it is set to?
An excerpt from /var/log/dmesg from my last boot follows, after changing /etc/default/crda as recommended in comments below: If I am reading this correctly, the regulatory domain is initialized to world, and then using the information in /etc/default/crda, the regulatory domain is updated to become US.
[ 12.109314] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled
[ 12.109317] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUGFS enabled
[ 12.109318] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEVICE_TRACING enabled
[ 12.109320] iwlwifi 0000:02:00.0: Detected Intel(R) Centrino(R) Wireless-N 2230 BGN, REV=0xC8
[ 12.109419] iwlwifi 0000:02:00.0: L1 Enabled; Disabling L0S
[ 12.124492] intel_rapl: domain uncore energy ctr 380974:380974 not working, skip
[ 12.183857] ieee80211 phy0: Selected rate control algorithm 'iwl-agn-rs'
[ 12.394864] cfg80211: World regulatory domain updated:
[ 12.394867] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 12.394868] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.394869] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.394870] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[ 12.394871] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.394872] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.522154] cfg80211: Calling CRDA for country: US
[ 12.523937] cfg80211: Regulatory domain changed to country: US
[ 12.523939] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[ 12.523941] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
[ 12.523942] cfg80211: (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
[ 12.523943] cfg80211: (5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.523943] cfg80211: (5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.523944] cfg80211: (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[ 12.523945] cfg80211: (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)
[ 12.523946] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
The short answer is: You can't query the AP for their regulatory domain.
That's how it's supposed to work:
I wouldn't worry about it, if your 802.11 device is working as it should and there isn't other problems, you can ignore it.
You asked:
Linux's standard
iw
tool for WiFi configuration does this.802.11d, dating to 2001, provides a capability for WiFi access points to announce country and regulatory details, and indeed most access points do so. See the "802.11 Framing in Detail" chapter of 802.11 Wireless Networks: The Definitive Guide for details of exactly how this information is encoded in WiFi frames.
Here's an excerpt from a WiFi scan I just did:
The third AP shown here is one where I've changed the country code setting to Canada (rather than USA), to demonstrate the possibility of varying this field.
Despite all this, it appears that neither mainstream Linux (nor most other OSes, as far as I can tell) actually pay any attention to the 802.11d settings of the APs that they connect to, probably because it's possible for APs to give misconfigured/outdated/conflicting information. The USA's FCC has ruled that devices must not rely exclusively on APs' regulatory configuration to set their own regulatory configuration; in practice, this means that most devices simply ignore APs' regulatory information and use their own, which tends to be set restrictively by default.