Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 183408
b: refs/heads/master
c: 98b6218
h: refs/heads/master
v: v3
  • Loading branch information
Johannes Berg authored and John W. Linville committed Dec 28, 2009
1 parent fd7362d commit d5be10e
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4da8c37af626001ff704fb29ea14eb58f5f7208
refs/heads/master: 98b6218388e345064c3f2d3c161383a18274c638
12 changes: 12 additions & 0 deletions trunk/include/net/cfg80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -2195,4 +2195,16 @@ void cfg80211_remain_on_channel_expired(struct net_device *dev,
enum nl80211_channel_type channel_type,
gfp_t gfp);


/**
* cfg80211_new_sta - notify userspace about station
*
* @dev: the netdev
* @mac_addr: the station's address
* @sinfo: the station information
* @gfp: allocation flags
*/
void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
struct station_info *sinfo, gfp_t gfp);

#endif /* __NET_CFG80211_H */
5 changes: 5 additions & 0 deletions trunk/net/mac80211/sta_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ int sta_info_insert(struct sta_info *sta)
{
struct ieee80211_local *local = sta->local;
struct ieee80211_sub_if_data *sdata = sta->sdata;
struct station_info sinfo;
unsigned long flags;
int err = 0;

Expand Down Expand Up @@ -408,6 +409,10 @@ int sta_info_insert(struct sta_info *sta)

spin_unlock_irqrestore(&local->sta_lock, flags);

sinfo.filled = 0;
sinfo.generation = local->sta_generation;
cfg80211_new_sta(sdata->dev, sta->sta.addr, &sinfo, GFP_ATOMIC);

#ifdef CONFIG_MAC80211_DEBUGFS
/*
* Debugfs entry adding might sleep, so schedule process
Expand Down
10 changes: 10 additions & 0 deletions trunk/net/wireless/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,3 +707,13 @@ void cfg80211_remain_on_channel_expired(struct net_device *dev,
channel_type, gfp);
}
EXPORT_SYMBOL(cfg80211_remain_on_channel_expired);

void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
struct station_info *sinfo, gfp_t gfp)
{
struct wiphy *wiphy = dev->ieee80211_ptr->wiphy;
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);

nl80211_send_sta_event(rdev, dev, mac_addr, sinfo, gfp);
}
EXPORT_SYMBOL(cfg80211_new_sta);
21 changes: 20 additions & 1 deletion trunk/net/wireless/nl80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ static int parse_station_flags(struct genl_info *info,

static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
int flags, struct net_device *dev,
u8 *mac_addr, struct station_info *sinfo)
const u8 *mac_addr, struct station_info *sinfo)
{
void *hdr;
struct nlattr *sinfoattr, *txrate;
Expand Down Expand Up @@ -5350,6 +5350,25 @@ void nl80211_send_remain_on_channel_cancel(
channel_type, 0, gfp);
}

void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
struct net_device *dev, const u8 *mac_addr,
struct station_info *sinfo, gfp_t gfp)
{
struct sk_buff *msg;

msg = nlmsg_new(NLMSG_GOODSIZE, gfp);
if (!msg)
return;

if (nl80211_send_station(msg, 0, 0, 0, dev, mac_addr, sinfo) < 0) {
nlmsg_free(msg);
return;
}

genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
nl80211_mlme_mcgrp.id, gfp);
}

/* initialisation/exit functions */

int nl80211_init(void)
Expand Down
4 changes: 4 additions & 0 deletions trunk/net/wireless/nl80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ void nl80211_send_remain_on_channel_cancel(
u64 cookie, struct ieee80211_channel *chan,
enum nl80211_channel_type channel_type, gfp_t gfp);

void nl80211_send_sta_event(struct cfg80211_registered_device *rdev,
struct net_device *dev, const u8 *mac_addr,
struct station_info *sinfo, gfp_t gfp);

#endif /* __NET_WIRELESS_NL80211_H */

0 comments on commit d5be10e

Please sign in to comment.