mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-11-10 19:39:54 +01:00
Following the tradition we have had with ath5k, ath9k, CRDA,
wireless-regdb I'd like to license this code under the permissive ISC
license for the code sharing purposes with other OSes, it'd sure be nice
to help the landscape in this area. Although I am %82.89 owner of the
regulatory code I have asked every contributor to the regulatory code
and have receieved positive Acked-bys from everyone except two deceased
entities:
o Frans Pop RIP 2010 [0]
- Frans Pop <[email protected]>
- Frans Pop <[email protected]>
o Nokia RIP February, 11, 2011 [1], [2]
- [email protected]
- [email protected]
Frans Pop's contribution was a simple patch 55f98938, titled,
"wireless: remove trailing space in messages" which just add a \n
to some printk lines. I'm going to treat these additions as
uncopyrightable.
As for the contributions made by employees on behalf of Nokia
my contact point was Petri Karhula <[email protected]> but
after one month he noted he had not been able to get traction from the
legal department on this request, as such it I proceeded by replacing
their contributions in previous patches.
The end goal is to help a clean rewrite that starts in userspace
that is shared under ISC license which currently is taking place with
the regulatory simulator [3].
[0] http://lists.debian.org/debian-devel/2011/12/msg00263.html
[1] http://press.nokia.com/2011/02/11/nokia-outlines-new-strategy-introduces-new-leadership-operational-structure/
[2] http://NokiaPlanB.com
[3] git://github.com/mcgrof/regsim.git
Acked-by: Thadeu Lima de Souza Cascardo <[email protected]>
Acked-by: Dan Carpenter <[email protected]>
Acked-by: Mihai Moldovan <[email protected]>
Acked-by: Uwe Kleine-König <[email protected]>
Acked-by: Sven Neumann <[email protected]>
Acked-by: Johannes Berg <[email protected]>
Acked-by: Tomas Winkler <[email protected]>
Acked-by: Tony Vroon <[email protected]>
Acked-by: Pavel Roskin <[email protected]>
Acked-by: Bob Copeland <[email protected]>
Acked-by: Lucas De Marchi <[email protected]>
Acked-by: Pat Erley <[email protected]>
Acked-by: Tejun Heo <[email protected]>
Acked-by: John W. Linville <[email protected]>
Acked-by: Chris Wright <[email protected]>
Acked-by: Joe Perches <[email protected]>
Acked-by: Paul Gortmaker <[email protected]>
Acked-by: John Gordon <[email protected]>
Acked-by: Simon Barber <[email protected]>
Acked-by: Rajkumar Manoharan <[email protected]>
Acked-by: Jiri Benc <[email protected]>
Acked-by: Bruno Randolf <[email protected]>
Acked-by: Scott James Remnant <[email protected]>
Acked-by: Roel Kluin <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
127 lines
3.4 KiB
Awk
127 lines
3.4 KiB
Awk
#!/usr/bin/awk -f
|
|
#
|
|
# genregdb.awk -- generate regdb.c from db.txt
|
|
#
|
|
# Actually, it reads from stdin (presumed to be db.txt) and writes
|
|
# to stdout (presumed to be regdb.c), but close enough...
|
|
#
|
|
# Copyright 2009 John W. Linville <[email protected]>
|
|
#
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
# purpose with or without fee is hereby granted, provided that the above
|
|
# copyright notice and this permission notice appear in all copies.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
BEGIN {
|
|
active = 0
|
|
rules = 0;
|
|
print "/*"
|
|
print " * DO NOT EDIT -- file generated from data in db.txt"
|
|
print " */"
|
|
print ""
|
|
print "#include <linux/nl80211.h>"
|
|
print "#include <net/cfg80211.h>"
|
|
print "#include \"regdb.h\""
|
|
print ""
|
|
regdb = "const struct ieee80211_regdomain *reg_regdb[] = {\n"
|
|
}
|
|
|
|
/^[ \t]*#/ {
|
|
# Ignore
|
|
}
|
|
|
|
!active && /^[ \t]*$/ {
|
|
# Ignore
|
|
}
|
|
|
|
!active && /country/ {
|
|
country=$2
|
|
sub(/:/, "", country)
|
|
printf "static const struct ieee80211_regdomain regdom_%s = {\n", country
|
|
printf "\t.alpha2 = \"%s\",\n", country
|
|
printf "\t.reg_rules = {\n"
|
|
active = 1
|
|
regdb = regdb "\t®dom_" country ",\n"
|
|
}
|
|
|
|
active && /^[ \t]*\(/ {
|
|
start = $1
|
|
sub(/\(/, "", start)
|
|
end = $3
|
|
bw = $5
|
|
sub(/\),/, "", bw)
|
|
gain = $6
|
|
sub(/\(/, "", gain)
|
|
sub(/,/, "", gain)
|
|
power = $7
|
|
sub(/\)/, "", power)
|
|
sub(/,/, "", power)
|
|
# power might be in mW...
|
|
units = $8
|
|
sub(/\)/, "", units)
|
|
sub(/,/, "", units)
|
|
if (units == "mW") {
|
|
if (power == 100) {
|
|
power = 20
|
|
} else if (power == 200) {
|
|
power = 23
|
|
} else if (power == 500) {
|
|
power = 27
|
|
} else if (power == 1000) {
|
|
power = 30
|
|
} else {
|
|
print "Unknown power value in database!"
|
|
}
|
|
}
|
|
flagstr = ""
|
|
for (i=8; i<=NF; i++)
|
|
flagstr = flagstr $i
|
|
split(flagstr, flagarray, ",")
|
|
flags = ""
|
|
for (arg in flagarray) {
|
|
if (flagarray[arg] == "NO-OFDM") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_NO_OFDM | "
|
|
} else if (flagarray[arg] == "NO-CCK") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_NO_CCK | "
|
|
} else if (flagarray[arg] == "NO-INDOOR") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_NO_INDOOR | "
|
|
} else if (flagarray[arg] == "NO-OUTDOOR") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_NO_OUTDOOR | "
|
|
} else if (flagarray[arg] == "DFS") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_DFS | "
|
|
} else if (flagarray[arg] == "PTP-ONLY") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_PTP_ONLY | "
|
|
} else if (flagarray[arg] == "PTMP-ONLY") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_PTMP_ONLY | "
|
|
} else if (flagarray[arg] == "PASSIVE-SCAN") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_PASSIVE_SCAN | "
|
|
} else if (flagarray[arg] == "NO-IBSS") {
|
|
flags = flags "\n\t\t\tNL80211_RRF_NO_IBSS | "
|
|
}
|
|
}
|
|
flags = flags "0"
|
|
printf "\t\tREG_RULE(%d, %d, %d, %d, %d, %s),\n", start, end, bw, gain, power, flags
|
|
rules++
|
|
}
|
|
|
|
active && /^[ \t]*$/ {
|
|
active = 0
|
|
printf "\t},\n"
|
|
printf "\t.n_reg_rules = %d\n", rules
|
|
printf "};\n\n"
|
|
rules = 0;
|
|
}
|
|
|
|
END {
|
|
print regdb "};"
|
|
print ""
|
|
print "int reg_regdb_size = ARRAY_SIZE(reg_regdb);"
|
|
}
|