aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-10-21 09:47:03 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-15 13:24:12 -0500
commit926a0a094d2b9052db3f7f37438c3d305cea4be7 (patch)
treed2f19acc7b84ea60e823638f2cf49e5a11d3401e /net/wireless
parentca4ffe8f2848169a8ded0ea8a60b2d81925564c9 (diff)
cfg80211: add debug prints for when we ignore regulatory hints
This can help with debugging issues. You will only see these with CONFIG_CFG80211_REG_DEBUG enabled. Cc: Easwar Krishnan <easwar.krishnan@atheros.com> Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/reg.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 8ab65f2afe70..7bff1c1d6c8f 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -711,6 +711,25 @@ int freq_reg_info(struct wiphy *wiphy,
711} 711}
712EXPORT_SYMBOL(freq_reg_info); 712EXPORT_SYMBOL(freq_reg_info);
713 713
714#ifdef CONFIG_CFG80211_REG_DEBUG
715static const char *reg_initiator_name(enum nl80211_reg_initiator initiator)
716{
717 switch (initiator) {
718 case NL80211_REGDOM_SET_BY_CORE:
719 return "Set by core";
720 case NL80211_REGDOM_SET_BY_USER:
721 return "Set by user";
722 case NL80211_REGDOM_SET_BY_DRIVER:
723 return "Set by driver";
724 case NL80211_REGDOM_SET_BY_COUNTRY_IE:
725 return "Set by country IE";
726 default:
727 WARN_ON(1);
728 return "Set by bug";
729 }
730}
731#endif
732
714/* 733/*
715 * Note that right now we assume the desired channel bandwidth 734 * Note that right now we assume the desired channel bandwidth
716 * is always 20 MHz for each individual channel (HT40 uses 20 MHz 735 * is always 20 MHz for each individual channel (HT40 uses 20 MHz
@@ -821,19 +840,36 @@ static void handle_band(struct wiphy *wiphy,
821static bool ignore_reg_update(struct wiphy *wiphy, 840static bool ignore_reg_update(struct wiphy *wiphy,
822 enum nl80211_reg_initiator initiator) 841 enum nl80211_reg_initiator initiator)
823{ 842{
824 if (!last_request) 843 if (!last_request) {
844 REG_DBG_PRINT("cfg80211: Ignoring regulatory request %s since "
845 "last_request is not set\n",
846 reg_initiator_name(initiator));
825 return true; 847 return true;
848 }
849
826 if (initiator == NL80211_REGDOM_SET_BY_CORE && 850 if (initiator == NL80211_REGDOM_SET_BY_CORE &&
827 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) 851 wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY) {
852 REG_DBG_PRINT("cfg80211: Ignoring regulatory request %s "
853 "since the driver uses its own custom "
854 "regulatory domain ",
855 reg_initiator_name(initiator));
828 return true; 856 return true;
857 }
858
829 /* 859 /*
830 * wiphy->regd will be set once the device has its own 860 * wiphy->regd will be set once the device has its own
831 * desired regulatory domain set 861 * desired regulatory domain set
832 */ 862 */
833 if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd && 863 if (wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY && !wiphy->regd &&
834 initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE && 864 initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE &&
835 !is_world_regdom(last_request->alpha2)) 865 !is_world_regdom(last_request->alpha2)) {
866 REG_DBG_PRINT("cfg80211: Ignoring regulatory request %s "
867 "since the driver requires its own regulaotry "
868 "domain to be set first",
869 reg_initiator_name(initiator));
836 return true; 870 return true;
871 }
872
837 return false; 873 return false;
838} 874}
839 875