RFC: automagically set wireless regulatory domain in cfg80211

John W. Linville linville at redhat.com
Mon Mar 2 15:32:40 UTC 2009


On Mon, Mar 02, 2009 at 03:09:12PM +0100, Ralf Ertzinger wrote:
> Hi.
> 
> On Mon, 02 Mar 2009 14:04:37 +0100, Christoph Höger wrote
> 
> > as you might know kernel module cfg80211 has a parameter to set the
> > regulatory domain:
> > 
> > parm:           ieee80211_regdom:IEEE 802.11 regulatory domain code
> > (charp)
> 
> As I found out the hard way the module in current rawhide kernels (around
> 0.140 or something) don't know this parameter any more.

Sorta -- the module option is there if you enable the (deprecated)
statically-defined regulatory domains.

Anyway, I think a better option is to use the local timezone
information to indicate the default regulatory domain.  I'll attach
a sample script as a strawman.  The equivalent would need to be
added somewhere, possible to the initscripts package (or triggered
from there).

Thoughts?

John
-- 
John W. Linville		Linux should be at the core
linville at redhat.com			of your literate lifestyle.
-------------- next part --------------
#!/bin/sh

CLOCK=/etc/sysconfig/clock

if [ -f $CLOCK ]
then
	# This should set ZONE
	. $CLOCK
else
	echo "Timezone information not found!  Unable to set regulatory domain."
	exit
fi

if [ -z "$ZONE" ]
then
	echo "Timezone information not set!  Unable to set regulatory domain."
	exit
fi

COOKED_ZONE=$(echo $ZONE | sed -e 's/ /_/')

COUNTRY=$(grep $COOKED_ZONE /usr/share/zoneinfo/zone.tab | awk '{ print $1 }')

if [ -z "$COUNTRY" ]
then
	echo "Could not determine country!  Unable to set regulatory domain."
	exit
fi

iw reg set $COUNTRY


More information about the fedora-devel-list mailing list