diff options
author | Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> | 2013-02-04 06:53:11 -0500 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-02-04 12:57:22 -0500 |
commit | 42745e039312ab4672c60ec584651f0c74e8264f (patch) | |
tree | 36c9593c931239d2c9ab4c0edc307506647525dc /net/wireless/nl80211.c | |
parent | 682bd38b8ac1fa3e84e84cddd1f1d7eeebce1212 (diff) |
cfg80211: expand per-station byte counters to 64bit
In per-station statistics, present 32bit counters are too small
for practical purposes - with gigabit speeds, it get overlapped
every few seconds.
Expand counters in the struct station_info to be 64-bit.
Driver can still fill only 32-bit and indicate in @filled
only bits like STATION_INFO_[TR]X_BYTES; in case driver provides
full 64-bit counter, it should also set in @filled
bit STATION_INFO_[TR]RX_BYTES64
Netlink sends both 32-bit and 64-bit counters, if present, to not
break userspace.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
[change to also have 32-bit counters if driver advertises 64-bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index d359734b6972..807d448e702e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3057,12 +3057,22 @@ static int nl80211_send_station(struct sk_buff *msg, u32 portid, u32 seq, | |||
3057 | nla_put_u32(msg, NL80211_STA_INFO_INACTIVE_TIME, | 3057 | nla_put_u32(msg, NL80211_STA_INFO_INACTIVE_TIME, |
3058 | sinfo->inactive_time)) | 3058 | sinfo->inactive_time)) |
3059 | goto nla_put_failure; | 3059 | goto nla_put_failure; |
3060 | if ((sinfo->filled & STATION_INFO_RX_BYTES) && | 3060 | if ((sinfo->filled & (STATION_INFO_RX_BYTES | |
3061 | STATION_INFO_RX_BYTES64)) && | ||
3061 | nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES, | 3062 | nla_put_u32(msg, NL80211_STA_INFO_RX_BYTES, |
3062 | sinfo->rx_bytes)) | 3063 | (u32)sinfo->rx_bytes)) |
3063 | goto nla_put_failure; | 3064 | goto nla_put_failure; |
3064 | if ((sinfo->filled & STATION_INFO_TX_BYTES) && | 3065 | if ((sinfo->filled & (STATION_INFO_TX_BYTES | |
3066 | NL80211_STA_INFO_TX_BYTES64)) && | ||
3065 | nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, | 3067 | nla_put_u32(msg, NL80211_STA_INFO_TX_BYTES, |
3068 | (u32)sinfo->tx_bytes)) | ||
3069 | goto nla_put_failure; | ||
3070 | if ((sinfo->filled & STATION_INFO_RX_BYTES64) && | ||
3071 | nla_put_u64(msg, NL80211_STA_INFO_RX_BYTES64, | ||
3072 | sinfo->rx_bytes)) | ||
3073 | goto nla_put_failure; | ||
3074 | if ((sinfo->filled & STATION_INFO_TX_BYTES64) && | ||
3075 | nla_put_u64(msg, NL80211_STA_INFO_TX_BYTES64, | ||
3066 | sinfo->tx_bytes)) | 3076 | sinfo->tx_bytes)) |
3067 | goto nla_put_failure; | 3077 | goto nla_put_failure; |
3068 | if ((sinfo->filled & STATION_INFO_LLID) && | 3078 | if ((sinfo->filled & STATION_INFO_LLID) && |