Commit 4113f751 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

cfg80211: add a regulatory debug print

Instead of sprinkling code with ifdef's define REG_DBG_PRINT() instead.
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6976b665
...@@ -43,6 +43,15 @@ ...@@ -43,6 +43,15 @@
#include "regdb.h" #include "regdb.h"
#include "nl80211.h" #include "nl80211.h"
#ifdef CONFIG_CFG80211_REG_DEBUG
#define REG_DBG_PRINT(args...) \
do { \
printk(KERN_DEBUG args); \
} while (0)
#else
#define REG_DBG_PRINT(args)
#endif
/* Receipt of information from last regulatory request */ /* Receipt of information from last regulatory request */
static struct regulatory_request *last_request; static struct regulatory_request *last_request;
...@@ -972,25 +981,21 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band, ...@@ -972,25 +981,21 @@ static void handle_channel(struct wiphy *wiphy, enum ieee80211_band band,
if (r == -ERANGE && if (r == -ERANGE &&
last_request->initiator == last_request->initiator ==
NL80211_REGDOM_SET_BY_COUNTRY_IE) { NL80211_REGDOM_SET_BY_COUNTRY_IE) {
#ifdef CONFIG_CFG80211_REG_DEBUG REG_DBG_PRINT("cfg80211: Leaving channel %d MHz "
printk(KERN_DEBUG "cfg80211: Leaving channel %d MHz "
"intact on %s - no rule found in band on " "intact on %s - no rule found in band on "
"Country IE\n", "Country IE\n",
chan->center_freq, wiphy_name(wiphy)); chan->center_freq, wiphy_name(wiphy));
#endif
} else { } else {
/* /*
* In this case we know the country IE has at least one reg rule * In this case we know the country IE has at least one reg rule
* for the band so we respect its band definitions * for the band so we respect its band definitions
*/ */
#ifdef CONFIG_CFG80211_REG_DEBUG
if (last_request->initiator == if (last_request->initiator ==
NL80211_REGDOM_SET_BY_COUNTRY_IE) NL80211_REGDOM_SET_BY_COUNTRY_IE)
printk(KERN_DEBUG "cfg80211: Disabling " REG_DBG_PRINT("cfg80211: Disabling "
"channel %d MHz on %s due to " "channel %d MHz on %s due to "
"Country IE\n", "Country IE\n",
chan->center_freq, wiphy_name(wiphy)); chan->center_freq, wiphy_name(wiphy));
#endif
flags |= IEEE80211_CHAN_DISABLED; flags |= IEEE80211_CHAN_DISABLED;
chan->flags = flags; chan->flags = flags;
} }
...@@ -1870,13 +1875,12 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy, ...@@ -1870,13 +1875,12 @@ int regulatory_hint_found_beacon(struct wiphy *wiphy,
if (!reg_beacon) if (!reg_beacon)
return -ENOMEM; return -ENOMEM;
#ifdef CONFIG_CFG80211_REG_DEBUG REG_DBG_PRINT("cfg80211: Found new beacon on "
printk(KERN_DEBUG "cfg80211: Found new beacon on "
"frequency: %d MHz (Ch %d) on %s\n", "frequency: %d MHz (Ch %d) on %s\n",
beacon_chan->center_freq, beacon_chan->center_freq,
ieee80211_frequency_to_channel(beacon_chan->center_freq), ieee80211_frequency_to_channel(beacon_chan->center_freq),
wiphy_name(wiphy)); wiphy_name(wiphy));
#endif
memcpy(&reg_beacon->chan, beacon_chan, memcpy(&reg_beacon->chan, beacon_chan,
sizeof(struct ieee80211_channel)); sizeof(struct ieee80211_channel));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment