aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/reg.c
diff options
context:
space:
mode:
authorLuis R. Rodriguez <lrodriguez@atheros.com>2009-04-02 14:08:09 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:40 -0400
commit6bad8766620a3c8b64afa981502fdb543e3cfd6c (patch)
tree7524ea7826a443d920062e48fe081e82b6fd7385 /net/wireless/reg.c
parent5dab3b8a68cc97a7e6b9f79f5de05803c8e55a3c (diff)
cfg80211: send regulatory beacon hint events to userspace
This informs userspace when a change has occured on a world roaming wiphy's channel which has lifted some restrictions due to a regulatory beacon hint. Because this is now sent to userspace through the regulatory multicast group we remove the debug prints we used to use as they are no longer necessary. Acked-by: Johannes Berg <johannes@sipsolutions.net> 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.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 4af4304cec3e..574e217bcc86 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1049,18 +1049,10 @@ static void handle_reg_beacon(struct wiphy *wiphy,
1049 unsigned int chan_idx, 1049 unsigned int chan_idx,
1050 struct reg_beacon *reg_beacon) 1050 struct reg_beacon *reg_beacon)
1051{ 1051{
1052#ifdef CONFIG_CFG80211_REG_DEBUG
1053#define REG_DEBUG_BEACON_FLAG(desc) \
1054 printk(KERN_DEBUG "cfg80211: Enabling " desc " on " \
1055 "frequency: %d MHz (Ch %d) on %s\n", \
1056 reg_beacon->chan.center_freq, \
1057 ieee80211_frequency_to_channel(reg_beacon->chan.center_freq), \
1058 wiphy_name(wiphy));
1059#else
1060#define REG_DEBUG_BEACON_FLAG(desc) do {} while (0)
1061#endif
1062 struct ieee80211_supported_band *sband; 1052 struct ieee80211_supported_band *sband;
1063 struct ieee80211_channel *chan; 1053 struct ieee80211_channel *chan;
1054 bool channel_changed = false;
1055 struct ieee80211_channel chan_before;
1064 1056
1065 assert_cfg80211_lock(); 1057 assert_cfg80211_lock();
1066 1058
@@ -1070,20 +1062,28 @@ static void handle_reg_beacon(struct wiphy *wiphy,
1070 if (likely(chan->center_freq != reg_beacon->chan.center_freq)) 1062 if (likely(chan->center_freq != reg_beacon->chan.center_freq))
1071 return; 1063 return;
1072 1064
1065 if (chan->beacon_found)
1066 return;
1067
1068 chan->beacon_found = true;
1069
1070 chan_before.center_freq = chan->center_freq;
1071 chan_before.flags = chan->flags;
1072
1073 if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) && 1073 if ((chan->flags & IEEE80211_CHAN_PASSIVE_SCAN) &&
1074 !(chan->orig_flags & IEEE80211_CHAN_PASSIVE_SCAN)) { 1074 !(chan->orig_flags & IEEE80211_CHAN_PASSIVE_SCAN)) {
1075 chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN; 1075 chan->flags &= ~IEEE80211_CHAN_PASSIVE_SCAN;
1076 REG_DEBUG_BEACON_FLAG("active scanning"); 1076 channel_changed = true;
1077 } 1077 }
1078 1078
1079 if ((chan->flags & IEEE80211_CHAN_NO_IBSS) && 1079 if ((chan->flags & IEEE80211_CHAN_NO_IBSS) &&
1080 !(chan->orig_flags & IEEE80211_CHAN_NO_IBSS)) { 1080 !(chan->orig_flags & IEEE80211_CHAN_NO_IBSS)) {
1081 chan->flags &= ~IEEE80211_CHAN_NO_IBSS; 1081 chan->flags &= ~IEEE80211_CHAN_NO_IBSS;
1082 REG_DEBUG_BEACON_FLAG("beaconing"); 1082 channel_changed = true;
1083 } 1083 }
1084 1084
1085 chan->beacon_found = true; 1085 if (channel_changed)
1086#undef REG_DEBUG_BEACON_FLAG 1086 nl80211_send_beacon_hint_event(wiphy, &chan_before, chan);
1087} 1087}
1088 1088
1089/* 1089/*