cfg80211/nl80211: implement station attribute retrieval

After a station is added to the kernel's structures, userspace
has to be able to retrieve statistics about that station, especially
whether the station was idle and how much bytes were transferred
to and from it. This adds the necessary code to nl80211.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Johannes Berg
2007-12-19 02:03:36 +01:00
committed by David S. Miller
parent 5727ef1b2e
commit fd5b74dcb8
3 changed files with 144 additions and 1 deletions

View File

@@ -157,6 +157,9 @@ enum nl80211_commands {
* restriction (at most %NL80211_MAX_SUPP_RATES).
* @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
* to, or the AP interface the station was originally added to to.
* @NL80211_ATTR_STA_STATS: statistics for a station, part of station info
* given for %NL80211_CMD_GET_STATION, nested attribute containing
* info as possible, see &enum nl80211_sta_stats.
*
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -190,6 +193,7 @@ enum nl80211_attrs {
NL80211_ATTR_STA_LISTEN_INTERVAL,
NL80211_ATTR_STA_SUPPORTED_RATES,
NL80211_ATTR_STA_VLAN,
NL80211_ATTR_STA_STATS,
/* add attributes here, update the policy in nl80211.c */
@@ -252,4 +256,28 @@ enum nl80211_sta_flags {
NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
};
/**
* enum nl80211_sta_stats - station statistics
*
* These attribute types are used with %NL80211_ATTR_STA_STATS
* when getting information about a station.
*
* @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved
* @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs)
* @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station)
* @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station)
* @__NL80211_STA_STAT_AFTER_LAST: internal
* @NL80211_STA_STAT_MAX: highest possible station stats attribute
*/
enum nl80211_sta_stats {
__NL80211_STA_STAT_INVALID,
NL80211_STA_STAT_INACTIVE_TIME,
NL80211_STA_STAT_RX_BYTES,
NL80211_STA_STAT_TX_BYTES,
/* keep last */
__NL80211_STA_STAT_AFTER_LAST,
NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
};
#endif /* __LINUX_NL80211_H */