Search Linux Wireless

[PATCH v2 3/3] cfg80211: parse WIDE-BW flag for internal regdb option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add support for parsing WIDE-BW country flag when
internal regulatory database is used.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
 net/wireless/genregdb.awk |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/net/wireless/genregdb.awk b/net/wireless/genregdb.awk
index 9a8217d..22ffada 100644
--- a/net/wireless/genregdb.awk
+++ b/net/wireless/genregdb.awk
@@ -38,12 +38,26 @@ function parse_country_head() {
 	sub(/:/, "", country)
 	printf "static const struct ieee80211_regdomain regdom_%s = {\n", country
 	printf "\t.alpha2 = \"%s\",\n", country
-	if ($NF ~ /DFS-ETSI/)
-		printf "\t.dfs_region = NL80211_DFS_ETSI,\n"
-	else if ($NF ~ /DFS-FCC/)
-		printf "\t.dfs_region = NL80211_DFS_FCC,\n"
-	else if ($NF ~ /DFS-JP/)
-		printf "\t.dfs_region = NL80211_DFS_JP,\n"
+
+	flagstr = ""
+	dfs_region = ""
+	for (i=3; i<=NF; i++)
+		flagstr = flagstr $i
+	split(flagstr, flagarray, ",")
+	for (arg in flagarray) {
+		if (flagarray[arg] == "WIDE-BW")
+			printf "\t.flags = NL80211_REG_FLAG_WIDE_BW,\n"
+		if (flagarray[arg] == "DFS-ETSI")
+			dfs_region = "NL80211_DFS_ETSI"
+		if (flagarray[arg] == "DFS-FCC")
+			dfs_region = "NL80211_DFS_FCC"
+		if (flagarray[arg] == "DFS-JP")
+			dfs_region = "NL80211_DFS_JP"
+	}
+
+	if (dfs_region != "")
+		printf "\t.dfs_region = %s,\n", dfs_region
+
 	printf "\t.reg_rules = {\n"
 	active = 1
 	regdb = regdb "\t&regdom_" country ",\n"
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux