aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-12-23 07:15:44 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-28 16:55:06 -0500
commit98b6218388e345064c3f2d3c161383a18274c638 (patch)
tree3df881c8e15947aeefe31da7fa83980a1530aed3 /net/wireless
parente4da8c37af626001ff704fb29ea14eb58f5f7208 (diff)
mac80211/cfg80211: add station events
When, for instance, a new IBSS peer is found, userspace wants to be notified. Add events for all new stations that mac80211 learns about. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/mlme.c10
-rw-r--r--net/wireless/nl80211.c21
-rw-r--r--net/wireless/nl80211.h4
3 files changed, 34 insertions, 1 deletions
diff --git a/net/wireless/mlme.c b/net/wireless/mlme.c
index 11f6469b3f98..3dba19e17271 100644
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
@@ -707,3 +707,13 @@ void cfg80211_remain_on_channel_expired(struct net_device *dev,
707 channel_type, gfp); 707 channel_type, gfp);
708} 708}
709EXPORT_SYMBOL(cfg80211_remain_on_channel_expired); 709EXPORT_SYMBOL(cfg80211_remain_on_channel_expired);
710
711void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
712 struct station_info *sinfo, gfp_t gfp)
713{
714 struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
715 struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
716
717 nl80211_send_sta_event(rdev, dev, mac_addr, sinfo, gfp);
718}
719EXPORT_SYMBOL(cfg80211_new_sta);
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ff857f10cb85..e3bee3cecdfa 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1642,7 +1642,7 @@ static int parse_station_flags(struct genl_info *info,
1642 1642
1643static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, 1643static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
1644 int flags, struct net_device *dev, 1644 int flags, struct net_device *dev,
1645 u8 *mac_addr, struct station_info *sinfo) 1645 const u8 *mac_addr, struct station_info *sinfo)
1646{ 1646{
1647 void *hdr; 1647 void *hdr;
1648 struct nlattr *sinfoattr, *txrate; 1648 struct nlattr *sinfoattr, *txrate;
@@ -5350,6 +5350,25 @@ void nl80211_send_remain_on_channel_cancel(
5350 channel_type, 0, gfp); 5350 channel_type, 0, gfp);
5351} 5351}
5352 5352
5353void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
5354 struct net_device *dev, const u8 *mac_addr,
5355 struct station_info *sinfo, gfp_t gfp)
5356{
5357 struct sk_buff *msg;
5358
5359 msg = nlmsg_new(NLMSG_GOODSIZE, gfp);
5360 if (!msg)
5361 return;
5362
5363 if (nl80211_send_station(msg, 0, 0, 0, dev, mac_addr, sinfo) < 0) {
5364 nlmsg_free(msg);
5365 return;
5366 }
5367
5368 genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
5369 nl80211_mlme_mcgrp.id, gfp);
5370}
5371
5353/* initialisation/exit functions */ 5372/* initialisation/exit functions */
5354 5373
5355int nl80211_init(void) 5374int nl80211_init(void)
diff --git a/net/wireless/nl80211.h b/net/wireless/nl80211.h
index a5e2de419b7a..14855b8fb430 100644
--- a/net/wireless/nl80211.h
+++ b/net/wireless/nl80211.h
@@ -70,4 +70,8 @@ void nl80211_send_remain_on_channel_cancel(
70 u64 cookie, struct ieee80211_channel *chan, 70 u64 cookie, struct ieee80211_channel *chan,
71 enum nl80211_channel_type channel_type, gfp_t gfp); 71 enum nl80211_channel_type channel_type, gfp_t gfp);
72 72
73void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
74 struct net_device *dev, const u8 *mac_addr,
75 struct station_info *sinfo, gfp_t gfp);
76
73#endif /* __NET_WIRELESS_NL80211_H */ 77#endif /* __NET_WIRELESS_NL80211_H */