From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
"Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Subject: [PATCH 4/5] cfg80211: replace print_dfs_region() with reg_dfs_region_str() helper
Date: Wed, 13 Nov 2013 18:54:05 +0100 [thread overview]
Message-ID: <1384365246-24768-5-git-send-email-mcgrof@do-not-panic.com> (raw)
In-Reply-To: <1384365246-24768-1-git-send-email-mcgrof@do-not-panic.com>
This lets us later reuse the more generic reg_dfs_region_str().
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
net/wireless/reg.c | 41 ++++++++++++++++-------------------------
1 file changed, 16 insertions(+), 25 deletions(-)
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 740eccb..ec54e1a 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)
return rtnl_dereference(wiphy->regd);
}
+static const char *reg_dfs_region_str(enum nl80211_dfs_regions dfs_region)
+{
+ switch (dfs_region) {
+ case NL80211_DFS_UNSET:
+ return "unset";
+ case NL80211_DFS_FCC:
+ return "FCC";
+ case NL80211_DFS_ETSI:
+ return "ETSI";
+ case NL80211_DFS_JP:
+ return "JP";
+ }
+ return "Unknown";
+}
+
static void rcu_free_regdom(const struct ieee80211_regdomain *r)
{
if (!r)
@@ -2146,30 +2161,6 @@ bool reg_supported_dfs_region(enum nl80211_dfs_regions dfs_region)
}
}
-static void print_dfs_region(enum nl80211_dfs_regions dfs_region)
-{
- if (!dfs_region)
- return;
-
- switch (dfs_region) {
- case NL80211_DFS_UNSET:
- pr_info(" DFS Master region unset");
- break;
- case NL80211_DFS_FCC:
- pr_info(" DFS Master region FCC");
- break;
- case NL80211_DFS_ETSI:
- pr_info(" DFS Master region ETSI");
- break;
- case NL80211_DFS_JP:
- pr_info(" DFS Master region JP");
- break;
- default:
- pr_info(" DFS Master region Unknown");
- break;
- }
-}
-
static void print_regdomain(const struct ieee80211_regdomain *rd)
{
struct regulatory_request *lr = get_last_request();
@@ -2201,7 +2192,7 @@ static void print_regdomain(const struct ieee80211_regdomain *rd)
}
}
- print_dfs_region(rd->dfs_region);
+ pr_info(" DFS Master region: %s", reg_dfs_region_str(rd->dfs_region));
print_rd_rules(rd);
}
--
1.8.4.rc3
next prev parent reply other threads:[~2013-11-13 17:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-13 17:54 [PATCH 0/5] cfg80211: few updates prior to quiesce and exporting DFS regions Luis R. Rodriguez
2013-11-13 17:54 ` [PATCH 1/5] cfg80211: use enum nl80211_dfs_regions for dfs_region everywhere Luis R. Rodriguez
2013-11-13 17:54 ` [PATCH 2/5] cfg80211: intersection dfs regions when intersecting regdomains Luis R. Rodriguez
2013-11-13 17:54 ` [PATCH 3/5] cfg80211: distinguish unset DFS region from unknown Luis R. Rodriguez
2013-11-13 17:54 ` Luis R. Rodriguez [this message]
2013-11-13 17:54 ` [PATCH 5/5] cfg80211: add reg_get_dfs_region() Luis R. Rodriguez
2013-11-13 18:49 ` Johannes Berg
2013-11-13 18:49 ` [PATCH 0/5] cfg80211: few updates prior to quiesce and exporting DFS regions Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1384365246-24768-5-git-send-email-mcgrof@do-not-panic.com \
--to=mcgrof@do-not-panic.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).