aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/mlme.c
diff options
context:
space:
mode:
authorThomas Pedersen <c_tpeder@qca.qualcomm.com>2012-04-06 16:35:47 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-11 16:23:59 -0400
commit5314526b1743e8e8614293db7d86e480b4fe9824 (patch)
treec493979d2d417b9a146ac6ef5e1b5562a5fda6df /net/wireless/mlme.c
parent14dc7852099535d17807e348dd127433413b7e0a (diff)
cfg80211: add channel switch notify event
The firmware may decide to switch channels while already beaconing, e.g. in response to a cfg80211 connect request on a different vif. Add this event to notify userspace when an AP or GO interface has successfully migrated to a new channel, so it can update its configuration accordingly. Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/mlme.c')
-rw-r--r--net/wireless/mlme.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index e14fdcc1d7cd..6801d96bc224 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -930,6 +930,33 @@ void cfg80211_pmksa_candidate_notify(struct net_device *dev, int index,
930} 930}
931EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify); 931EXPORT_SYMBOL(cfg80211_pmksa_candidate_notify);
932 932
933void cfg80211_ch_switch_notify(struct net_device *dev, int freq,
934 enum nl80211_channel_type type)
935{
936 struct wireless_dev *wdev = dev->ieee80211_ptr;
937 struct wiphy *wiphy = wdev->wiphy;
938 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
939 struct ieee80211_channel *chan;
940
941 wdev_lock(wdev);
942
943 if (WARN_ON(wdev->iftype != NL80211_IFTYPE_AP &&
944 wdev->iftype != NL80211_IFTYPE_P2P_GO))
945 goto out;
946
947 chan = rdev_freq_to_chan(rdev, freq, type);
948 if (WARN_ON(!chan))
949 goto out;
950
951 wdev->channel = chan;
952
953 nl80211_ch_switch_notify(rdev, dev, freq, type, GFP_KERNEL);
954out:
955 wdev_unlock(wdev);
956 return;
957}
958EXPORT_SYMBOL(cfg80211_ch_switch_notify);
959
933bool cfg80211_rx_spurious_frame(struct net_device *dev, 960bool cfg80211_rx_spurious_frame(struct net_device *dev,
934 const u8 *addr, gfp_t gfp) 961 const u8 *addr, gfp_t gfp)
935{ 962{