aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-05-15 18:55:00 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-04 07:03:10 -0400
commit6ff57cf88807dd81300b5b9c623dc5eb6422b9f6 (patch)
tree8819fea1f493077ff311208986ebfe27bd327623 /net/wireless/nl80211.c
parent51217cee3a94d5409d6ee2ac090ae96bc9a06757 (diff)
cfg80211/mac80211: clean up cfg80211 SME APIs
Do some cleanups in the cfg80211 SME APIs, which are only used by mac80211. Most of these functions get a frame passed, and there isn't really any reason to export multiple functions as cfg80211 can check the frame type instead, do that. Additionally, the API functions have confusing names like cfg80211_send_...() which was meant to indicate that it sends an event to userspace, but gets a bit confusing when there's both TX and RX and they're not all clearly labeled. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ce949e38178c..444f5effb77f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -9313,31 +9313,27 @@ void nl80211_send_disassoc(struct cfg80211_registered_device *rdev,
9313 NL80211_CMD_DISASSOCIATE, gfp); 9313 NL80211_CMD_DISASSOCIATE, gfp);
9314} 9314}
9315 9315
9316void cfg80211_send_unprot_deauth(struct net_device *dev, const u8 *buf, 9316void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev, const u8 *buf,
9317 size_t len) 9317 size_t len)
9318{ 9318{
9319 struct wireless_dev *wdev = dev->ieee80211_ptr; 9319 struct wireless_dev *wdev = dev->ieee80211_ptr;
9320 struct wiphy *wiphy = wdev->wiphy; 9320 struct wiphy *wiphy = wdev->wiphy;
9321 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); 9321 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
9322 const struct ieee80211_mgmt *mgmt = (void *)buf;
9323 u32 cmd;
9322 9324
9323 trace_cfg80211_send_unprot_deauth(dev); 9325 if (WARN_ON(len < 2))
9324 nl80211_send_mlme_event(rdev, dev, buf, len, 9326 return;
9325 NL80211_CMD_UNPROT_DEAUTHENTICATE, GFP_ATOMIC);
9326}
9327EXPORT_SYMBOL(cfg80211_send_unprot_deauth);
9328 9327
9329void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf, 9328 if (ieee80211_is_deauth(mgmt->frame_control))
9330 size_t len) 9329 cmd = NL80211_CMD_UNPROT_DEAUTHENTICATE;
9331{ 9330 else
9332 struct wireless_dev *wdev = dev->ieee80211_ptr; 9331 cmd = NL80211_CMD_UNPROT_DISASSOCIATE;
9333 struct wiphy *wiphy = wdev->wiphy;
9334 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
9335 9332
9336 trace_cfg80211_send_unprot_disassoc(dev); 9333 trace_cfg80211_rx_unprot_mlme_mgmt(dev, buf, len);
9337 nl80211_send_mlme_event(rdev, dev, buf, len, 9334 nl80211_send_mlme_event(rdev, dev, buf, len, cmd, GFP_ATOMIC);
9338 NL80211_CMD_UNPROT_DISASSOCIATE, GFP_ATOMIC);
9339} 9335}
9340EXPORT_SYMBOL(cfg80211_send_unprot_disassoc); 9336EXPORT_SYMBOL(cfg80211_rx_unprot_mlme_mgmt);
9341 9337
9342static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev, 9338static void nl80211_send_mlme_timeout(struct cfg80211_registered_device *rdev,
9343 struct net_device *netdev, int cmd, 9339 struct net_device *netdev, int cmd,