aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
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/nl80211.c
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/nl80211.c')
-rw-r--r--net/wireless/nl80211.c21
1 files changed, 20 insertions, 1 deletions
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)