aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>2013-10-14 20:42:06 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-10-28 10:05:27 -0400
commit034c6d6e675f84ef5e67445150522b2517d963c9 (patch)
tree564ff2695dbc499e1e3d8e82a01497f93e82a39f /net/wireless/reg.c
parent446075d76b6cc48ed15c515e836dd1a1f25f4c3d (diff)
cfg80211: export reg_initiator_name()
Drivers can now use this to parse the regulatory request and be more verbose when needed. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index edb2ba4e2a18..7da67fd0b418 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -768,24 +768,25 @@ const struct ieee80211_reg_rule *freq_reg_info(struct wiphy *wiphy,
768} 768}
769EXPORT_SYMBOL(freq_reg_info); 769EXPORT_SYMBOL(freq_reg_info);
770 770
771#ifdef CONFIG_CFG80211_REG_DEBUG 771const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
772static const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
773{ 772{
774 switch (initiator) { 773 switch (initiator) {
775 case NL80211_REGDOM_SET_BY_CORE: 774 case NL80211_REGDOM_SET_BY_CORE:
776 return "Set by core"; 775 return "core";
777 case NL80211_REGDOM_SET_BY_USER: 776 case NL80211_REGDOM_SET_BY_USER:
778 return "Set by user"; 777 return "user";
779 case NL80211_REGDOM_SET_BY_DRIVER: 778 case NL80211_REGDOM_SET_BY_DRIVER:
780 return "Set by driver"; 779 return "driver";
781 case NL80211_REGDOM_SET_BY_COUNTRY_IE: 780 case NL80211_REGDOM_SET_BY_COUNTRY_IE:
782 return "Set by country IE"; 781 return "country IE";
783 default: 782 default:
784 WARN_ON(1); 783 WARN_ON(1);
785 return "Set by bug"; 784 return "bug";
786 } 785 }
787} 786}
787EXPORT_SYMBOL(reg_initiator_name);
788 788
789#ifdef CONFIG_CFG80211_REG_DEBUG
789static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan, 790static void chan_reg_rule_print_dbg(struct ieee80211_channel *chan,
790 const struct ieee80211_reg_rule *reg_rule) 791 const struct ieee80211_reg_rule *reg_rule)
791{ 792{
@@ -986,14 +987,17 @@ static bool ignore_reg_update(struct wiphy *wiphy,
986 struct regulatory_request *lr = get_last_request(); 987 struct regulatory_request *lr = get_last_request();
987 988
988 if (!lr) { 989 if (!lr) {
989 REG_DBG_PRINT("Ignoring regulatory request %s since last_request is not set\n", 990 REG_DBG_PRINT("Ignoring regulatory request set by %s "
991 "since last_request is not set\n",
990 reg_initiator_name(initiator)); 992 reg_initiator_name(initiator));
991 return true; 993 return true;
992 } 994 }
993 995
994 if (initiator == NL80211_REGDOM_SET_BY_CORE && 996 if (initiator == NL80211_REGDOM_SET_BY_CORE &&
995 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) { 997 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
996 REG_DBG_PRINT("Ignoring regulatory request %s since the driver uses its own custom regulatory domain\n", 998 REG_DBG_PRINT("Ignoring regulatory request set by %s "
999 "since the driver uses its own custom "
1000 "regulatory domain\n",
997 reg_initiator_name(initiator)); 1001 reg_initiator_name(initiator));
998 return true; 1002 return true;
999 } 1003 }
@@ -1005,7 +1009,9 @@ static bool ignore_reg_update(struct wiphy *wiphy,
1005 if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd && 1009 if (wiphy_strict_alpha2_regd(wiphy) && !wiphy->regd &&
1006 initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && 1010 initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
1007 !is_world_regdom(lr->alpha2)) { 1011 !is_world_regdom(lr->alpha2)) {
1008 REG_DBG_PRINT("Ignoring regulatory request %s since the driver requires its own regulatory domain to be set first\n", 1012 REG_DBG_PRINT("Ignoring regulatory request set by %s "
1013 "since the driver requires its own regulatory "
1014 "domain to be set first\n",
1009 reg_initiator_name(initiator)); 1015 reg_initiator_name(initiator));
1010 return true; 1016 return true;
1011 } 1017 }