Bug 548845

Summary: iwlagn wireless driver using wrong regulatory domain
Product: [Fedora] Fedora Reporter: John W. Linville <linville>
Component: crdaAssignee: John W. Linville <linville>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: anton, cmeadors, dougsland, gansalmon, itamar, kernel-maint, linville, shillman
Target Milestone: ---Keywords: Desktop
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.1.0_2009.11.25-2.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 548103 Environment:
Last Closed: 2009-12-22 04:40:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 548103    
Bug Blocks:    

Description John W. Linville 2009-12-18 19:34:13 UTC
+++ This bug was initially created as a clone of Bug #548103 +++

Description of problem:
iwlagn wireless driver using wrong regulatory domain. We are located in the US and using US hardware, but dmesg says:

cfg80211: Calling CRDA to update world regulatory domain
...
cfg80211: World regulatory domain updated:
	(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
	(2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
	(2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
	(2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
	(5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
	(5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)

lspci -nn says:

03:00.0 Network controller [0280]: Intel Corporation PRO/Wireless 5100 AGN [Shiloh] Network Connection [8086:4237]

Version-Release number of selected component (if applicable):
kernel-PAE-2.6.31.6-166.fc12.i686

How reproducible:
Always

Steps to Reproduce:
1. Load the driver
2. Look at dmesg
  
Actual results:
Uses World regulatory domain.

Expected results:
Use US regulatory domain!

Additional info:

--- Additional comment from linville on 2009-12-16 13:34:48 EDT ---

Did you set your system time using system-config-date?

--- Additional comment from shillman on 2009-12-16 13:50:03 EDT ---

I did not myself do so, no. I just did an install (with F11, then updated to f12).

--- Additional comment from cmeadors on 2009-12-16 13:57:01 EDT ---

I also see in dmesg that the driver is using the world domain.  I have not specifically used system-config-date to change the time.  This is a fresh install of F12.

--- Additional comment from linville on 2009-12-16 14:06:55 EDT ---

Please post your complete dmesg output -- everything starts with the world domain, most things get updated by udev and/or the driver later.

Also, run "setregdomain" and post the difference in dmesg output.

--- Additional comment from cmeadors on 2009-12-16 14:38:09 EDT ---

Forgot that `dmesg` has more information than /var/log/dmesg.  Attaching `dmesg` output.  Looks like cfg80211 does finally set domain to US.

--- Additional comment from cmeadors on 2009-12-16 14:38:37 EDT ---

Created an attachment (id=378825)
dmesg outpyt

--- Additional comment from shillman on 2009-12-16 14:48:13 EDT ---

Ok. Attaching dmesg output. The difference between the two after I ran setregdomain was:

[root@firefly ~]# diff dmesg.output dmesg.output.afterset 
1095a1096,1104
> cfg80211: Calling CRDA for country: US
> cfg80211: Regulatory domain changed to country: US
> 	(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
> 	(2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
> 	(5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 1700 mBm)
> 	(5250000 KHz - 5330000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> 	(5490000 KHz - 5600000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> 	(5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
> 	(5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 3000 mBm)

--- Additional comment from shillman on 2009-12-16 14:49:10 EDT ---

Created an attachment (id=378827)
shillman dmesg output

--- Additional comment from linville on 2009-12-16 15:43:53 EDT ---

Suzanne, please attach the contents of /etc/sysconfig/regdomain and
/etc/sysconfig/clock (or note it if one or both do not exist).

--- Additional comment from shillman on 2009-12-16 16:18:13 EDT ---

Created an attachment (id=378852)
contents of /etc/sysconfig/clock

FWIW, /etc/sysconfig/regdomain does not exist.

--- Additional comment from linville on 2009-12-16 16:48:39 EDT ---

Well, I'm not sure what is happening.  It looks like /etc/sysconfig/clock has what is needed and running setregdomain manually seems to work for you.  Does 'modprobe -r iwlagn ; modprobe iwlagn' produce fresh CRDA-related output in dmesg for you?

--- Additional comment from shillman on 2009-12-17 14:40:58 EDT ---

Diffing dmesg and dmesg after the modprobe gives:

< wlan0: deauthenticating by local choice (reason=3)
< iwlagn 0000:03:00.0: PCI INT A disabled
< cfg80211: Calling CRDA to update world regulatory domain
< cfg80211: World regulatory domain updated:
< 	(start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
< 	(2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
< 	(2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
< 	(2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
< 	(5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
< 	(5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
< iwlagn: Intel(R) Wireless WiFi Link AGN driver for Linux, 1.3.27kds
< iwlagn: Copyright(c) 2003-2009 Intel Corporation
< iwlagn 0000:03:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
< iwlagn 0000:03:00.0: setting latency timer to 64
< iwlagn 0000:03:00.0: Detected Intel Wireless WiFi Link 5100AGN REV=0x54
< iwlagn 0000:03:00.0: Tunable channels: 13 802.11bg, 24 802.11a channels
< iwlagn 0000:03:00.0: irq 29 for MSI/MSI-X
< phy0: Selected rate control algorithm 'iwl-agn-rs'
< iwlagn 0000:03:00.0: firmware: requesting iwlwifi-5000-2.ucode
< iwlagn 0000:03:00.0: loaded firmware version 8.24.2.12
< Registered led device: iwl-phy0::radio
< Registered led device: iwl-phy0::assoc
< Registered led device: iwl-phy0::RX
< Registered led device: iwl-phy0::TX
< ADDRCONF(NETDEV_UP): wlan0: link is not ready
< wlan0: authenticate with AP 00:1d:7e:dc:3c:2c
< wlan0: authenticated
< wlan0: associate with AP 00:1d:7e:dc:3c:2c
< wlan0: RX AssocResp from 00:1d:7e:dc:3c:2c (capab=0x401 status=0 aid=1)
< wlan0: associated
< ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
< wlan0: no IPv6 routers present
< tun0: Disabled Privacy Extensions

--- Additional comment from linville on 2009-12-18 11:52:04 EDT ---

Alright, just for completeness please confirm that
/lib/udev/rules.d/85-regulatory.rules looks like this:

# Runs CRDA for kernel wireless regulatory events.
# For more information see:
# http://wireless.kernel.org/en/developers/Regulatory/CRDA

SUBSYSTEM=="ieee80211", ACTION=="add", RUN+="/sbin/setregdomain"

KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin//crda"

It looks like the first of those rules isn't getting run for some reason...

--- Additional comment from linville on 2009-12-18 13:36:42 EDT ---

OK, looks like it _is_ getting run, but setregdomain is silently failing due to not being able to find iw in its path.  I suspect this may have been broken for a while (i.e. since I moved iw from /usr/bin to /sbin).

Unfortunately, it looks like Fedora CVS is still not cooperating.  I'll get to this shortly after it becomes usable again.  In the meantime, you can either deal with the constrained set of wireless settings, call setregdomain manually, or hack /sbin/setregdomain to change "iw" to "/sbin/iw".

Thanks!

--- Additional comment from shillman on 2009-12-18 14:05:19 EDT ---

That file is as you put it above, although I suspect you knew this already.

And since this was being tested as part of trying to write testing for firmware in 5.5, I'll just keep working on that test plan and those cases in the meantime. :)

Comment 1 Fedora Update System 2009-12-18 19:50:53 UTC
crda-1.1.0_2009.11.25-2.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/crda-1.1.0_2009.11.25-2.fc11

Comment 2 Fedora Update System 2009-12-22 04:40:04 UTC
crda-1.1.0_2009.11.25-2.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.