aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4c1ce353c662..11156b381ec3 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -269,6 +269,31 @@ static int ieee80211_config_default_key(struct wiphy *wiphy,
269 return 0; 269 return 0;
270} 270}
271 271
272static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
273 u8 *mac, struct station_stats *stats)
274{
275 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
276 struct sta_info *sta;
277
278 sta = sta_info_get(local, mac);
279 if (!sta)
280 return -ENOENT;
281
282 /* XXX: verify sta->dev == dev */
283
284 stats->filled = STATION_STAT_INACTIVE_TIME |
285 STATION_STAT_RX_BYTES |
286 STATION_STAT_TX_BYTES;
287
288 stats->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
289 stats->rx_bytes = sta->rx_bytes;
290 stats->tx_bytes = sta->tx_bytes;
291
292 sta_info_put(sta);
293
294 return 0;
295}
296
272struct cfg80211_ops mac80211_config_ops = { 297struct cfg80211_ops mac80211_config_ops = {
273 .add_virtual_intf = ieee80211_add_iface, 298 .add_virtual_intf = ieee80211_add_iface,
274 .del_virtual_intf = ieee80211_del_iface, 299 .del_virtual_intf = ieee80211_del_iface,
@@ -277,4 +302,5 @@ struct cfg80211_ops mac80211_config_ops = {
277 .del_key = ieee80211_del_key, 302 .del_key = ieee80211_del_key,
278 .get_key = ieee80211_get_key, 303 .get_key = ieee80211_get_key,
279 .set_default_key = ieee80211_config_default_key, 304 .set_default_key = ieee80211_config_default_key,
305 .get_station = ieee80211_get_station,
280}; 306};