# [solved] Problems setting correct regul. domain on wifi AP

## zidour

After upgrading many packages on my AP I am having troubles setting correct regulatory domain for my wifi card.

Upon startup, I am getting the following in /var/log/messages:

```

Nov 12 21:22:45 server kernel: cfg80211: Calling CRDA to update world regulatory domain

Nov 12 21:22:45 server kernel: pcieport 0000:00:15.0: driver skip pci_set_master, fix it!

Nov 12 21:22:45 server kernel: ath: EEPROM regdomain: 0x809c

Nov 12 21:22:45 server kernel: ath: EEPROM indicates we should expect a country code

Nov 12 21:22:45 server kernel: ath: doing EEPROM country->regdmn map search

Nov 12 21:22:45 server kernel: ath: country maps to regdmn code: 0x52

Nov 12 21:22:45 server kernel: ath: Country alpha2 being used: CN

Nov 12 21:22:45 server kernel: ath: Regpair used: 0x52

```

and then later on

```
Nov 12 21:22:45 server kernel: cfg80211: Pending regulatory request, waiting for it to be processed...
```

Before the update (i.e. when setting the reg domain worked) the latter part of the log would be

```

Oct 14 12:04:46 server kernel: cfg80211: Calling CRDA for country: CZ

... channel list ...

Oct 14 12:04:46 server kernel: cfg80211: Regulatory domain changed to country: CZ

```

.

I was trying to narrow down the problem and found out that there might be some problem with the regulatory.bin file:

```

# regdbdump /usr/lib64/crda/regulatory.bin

Database signature verification failed.

```

I was verifying that the regulatory.bin file is binary identical to the one distributed by the linux wireless project (it is), next I was checking that the public key used to verify the DB is identical to the one that belongs to John Linville (it is).

This leaves me clueless.

Potentially there might be some issue after upgrading either openssl or m2crypto packages, which are used to extract the public key into a C structure during the emerge process for CRDA, but I doubt this.

Could anyone please suggest any further steps to narrow down the problem?

Thanks.

Edit: Package versions after/before update:

crda: 1.1.3/1.1.2-r4

wireless-regdb: 20131011/20110428-r1

openssl: 1.0.1e-r2/1.0.1c

m2crypto: 0.21.1-r1/0.21.1Last edited by zidour on Mon Dec 09, 2013 8:59 am; edited 1 time in total

----------

## zidour

It must have been an issue with the net-wireless/wireless-regdb-20131011 package. All is fine after upgrading to net-wireless/wireless-regdb-20131127.

----------

## Logicien

As a side note, you can set the country you want to use with the ieee80211_regdom option of the cfg80211 module. I dont see any other place to set it in Gentoo than write a line in /etc/modprobe.d/modprobe.conf

```
options cfg80211 ieee80211_regdom=XX
```

Obviously XX must be change for your country. With Debian, I can set it too in the configuration file /etc/default/crda.

```
modinfo cfg80211

filename:       /lib/modules/3.10.17-gentoo/kernel/net/wireless/cfg80211.ko

description:    wireless configuration support

license:        GPL

author:         Johannes Berg

depends:        

intree:         Y

vermagic:       3.10.17-gentoo SMP preempt mod_unload modversions 

parm:           ieee80211_regdom:IEEE 802.11 regulatory domain code (charp)

parm:           cfg80211_disable_40mhz_24ghz:Disable 40MHz support in the 2.4GHz band (bool)

```

----------

## ulenrich

Everyone only in need to connect to default domain channels per wifi can create this file

```
# cat /etc/udev/rules.d/85-regulatory.rules 

# Runs CRDA for kernel wireless regulatory events.

# For more information see:

# http://wireless.kernel.org/en/developers/Regulatory/CRDA

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

KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/bin/true"
```

----------

