aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2010-01-04 11:50:11 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-01-05 17:13:19 -0500
commit4113f75187bfebccc54bf13c0ed09593023b53ca (patch)
treefe97cbde83d504192fa0d44954aaec03071d4baf /net/wireless/reg.c
parent6976b665fc2b19900659b964bba3b55de08f264f (diff)
cfg80211: add a regulatory debug print
Instead of sprinkling code with ifdef's define REG_DBG_PRINT() instead. Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/reg.c')
-rw-r--r--net/wireless/reg.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 87ea60d84c3c..ab29a6135d22 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -43,6 +43,15 @@
43#include "regdb.h" 43#include "regdb.h"
44#include "nl80211.h" 44#include "nl80211.h"
45 45
46#ifdef CONFIG_CFG80211_REG_DEBUG
47#define REG_DBG_PRINT(args...) \
48 do { \
49 printk(KERN_DEBUG args); \
50 } while (0)
51#else
52#define REG_DBG_PRINT(args)
53#endif
54
46/* Receipt of information from last regulatory request */ 55/* Receipt of information from last regulatory request */
47static struct regulatory_request *last_request; 56static struct regulatory_request *last_request;
48 57
@@ -972,25 +981,21 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band,
972 if (r == -ERANGE && 981 if (r == -ERANGE &&
973 last_request->initiator == 982 last_request->initiator ==
974 NL80211_REGDOM_SET_BY_COUNTRY_IE) { 983 NL80211_REGDOM_SET_BY_COUNTRY_IE) {
975#ifdef CONFIG_CFG80211_REG_DEBUG 984 REG_DBG_PRINT("cfg80211: Leaving channel %d MHz "
976 printk(KERN_DEBUG "cfg80211: Leaving channel %d MHz "
977 "intact on %s - no rule found in band on " 985 "intact on %s - no rule found in band on "
978 "Country IE\n", 986 "Country IE\n",
979 chan->center_freq, wiphy_name(wiphy)); 987 chan->center_freq, wiphy_name(wiphy));
980#endif
981 } else { 988 } else {
982 /* 989 /*
983 * In this case we know the country IE has at least one reg rule 990 * In this case we know the country IE has at least one reg rule
984 * for the band so we respect its band definitions 991 * for the band so we respect its band definitions
985 */ 992 */
986#ifdef CONFIG_CFG80211_REG_DEBUG
987 if (last_request->initiator == 993 if (last_request->initiator ==
988 NL80211_REGDOM_SET_BY_COUNTRY_IE) 994 NL80211_REGDOM_SET_BY_COUNTRY_IE)
989 printk(KERN_DEBUG "cfg80211: Disabling " 995 REG_DBG_PRINT("cfg80211: Disabling "
990 "channel %d MHz on %s due to " 996 "channel %d MHz on %s due to "
991 "Country IE\n", 997 "Country IE\n",
992 chan->center_freq, wiphy_name(wiphy)); 998 chan->center_freq, wiphy_name(wiphy));
993#endif
994 flags |= IEEE80211_CHAN_DISABLED; 999 flags |= IEEE80211_CHAN_DISABLED;
995 chan->flags = flags; 1000 chan->flags = flags;
996 } 1001 }
@@ -1870,13 +1875,12 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy,
1870 if (!reg_beacon) 1875 if (!reg_beacon)
1871 return -ENOMEM; 1876 return -ENOMEM;
1872 1877
1873#ifdef CONFIG_CFG80211_REG_DEBUG 1878 REG_DBG_PRINT("cfg80211: Found new beacon on "
1874 printk(KERN_DEBUG "cfg80211: Found new beacon on " 1879 "frequency: %d MHz (Ch %d) on %s\n",
1875 "frequency: %d MHz (Ch %d) on %s\n", 1880 beacon_chan->center_freq,
1876 beacon_chan->center_freq, 1881 ieee80211_frequency_to_channel(beacon_chan->center_freq),
1877 ieee80211_frequency_to_channel(beacon_chan->center_freq), 1882 wiphy_name(wiphy));
1878 wiphy_name(wiphy)); 1883
1879#endif
1880 memcpy(&reg_beacon->chan, beacon_chan, 1884 memcpy(&reg_beacon->chan, beacon_chan,
1881 sizeof(struct ieee80211_channel)); 1885 sizeof(struct ieee80211_channel));
1882 1886