aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-11-13 12:54:05 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:52:18 -0500
commit3ef121b51164282e9eaa732bf79ff027599867c6 (patch)
treeac4a9084ba5eddfb90dc1015ffee9cb13d772937 /net
parentd7a4b05a2794fc8f2a545272048c7212951c1946 (diff)
cfg80211: replace print_dfs_region() with reg_dfs_region_str() helper
This lets us later reuse the more generic reg_dfs_region_str(). Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/reg.c41
1 files changed, 16 insertions, 25 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 740eccb42069..ec54e1aac8e2 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -120,6 +120,21 @@ static const struct ieee80211_regdomain *get_wiphy_regdom(struct wiphy *wiphy)
120 return rtnl_dereference(wiphy->regd); 120 return rtnl_dereference(wiphy->regd);
121} 121}
122 122
123static const char *reg_dfs_region_str(enum nl80211_dfs_regions dfs_region)
124{
125 switch (dfs_region) {
126 case NL80211_DFS_UNSET:
127 return "unset";
128 case NL80211_DFS_FCC:
129 return "FCC";
130 case NL80211_DFS_ETSI:
131 return "ETSI";
132 case NL80211_DFS_JP:
133 return "JP";
134 }
135 return "Unknown";
136}
137
123static void rcu_free_regdom(const struct ieee80211_regdomain *r) 138static void rcu_free_regdom(const struct ieee80211_regdomain *r)
124{ 139{
125 if (!r) 140 if (!r)
@@ -2146,30 +2161,6 @@ bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region)
2146 } 2161 }
2147} 2162}
2148 2163
2149static void print_dfs_region(enum nl80211_dfs_regions dfs_region)
2150{
2151 if (!dfs_region)
2152 return;
2153
2154 switch (dfs_region) {
2155 case NL80211_DFS_UNSET:
2156 pr_info(" DFS Master region unset");
2157 break;
2158 case NL80211_DFS_FCC:
2159 pr_info(" DFS Master region FCC");
2160 break;
2161 case NL80211_DFS_ETSI:
2162 pr_info(" DFS Master region ETSI");
2163 break;
2164 case NL80211_DFS_JP:
2165 pr_info(" DFS Master region JP");
2166 break;
2167 default:
2168 pr_info(" DFS Master region Unknown");
2169 break;
2170 }
2171}
2172
2173static void print_regdomain(const struct ieee80211_regdomain *rd) 2164static void print_regdomain(const struct ieee80211_regdomain *rd)
2174{ 2165{
2175 struct regulatory_request *lr = get_last_request(); 2166 struct regulatory_request *lr = get_last_request();
@@ -2201,7 +2192,7 @@ static void print_regdomain(const struct ieee80211_regdomain *rd)
2201 } 2192 }
2202 } 2193 }
2203 2194
2204 print_dfs_region(rd->dfs_region); 2195 pr_info(" DFS Master region: %s", reg_dfs_region_str(rd->dfs_region));
2205 print_rd_rules(rd); 2196 print_rd_rules(rd);
2206} 2197}
2207 2198