diff options
author | Bruno Randolf <br1@einfach.org> | 2010-10-06 05:34:12 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-06 16:30:43 -0400 |
commit | b206b4ef062d83c0875a085672ed50e8c8b01521 (patch) | |
tree | f182cc272055f7b646bc62a5d37fb097a8fd07cc | |
parent | 09be251e9005ebd67e5eabcaad904edb7ecacc55 (diff) |
nl80211/mac80211: Add retry and failed transmission count to station info
This information is already available in mac80211, we just need to export it
via cfg80211 and nl80211.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/linux/nl80211.h | 4 | ||||
-rw-r--r-- | include/net/cfg80211.h | 8 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 4 | ||||
-rw-r--r-- | net/wireless/nl80211.c | 6 |
4 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index e451f176e662..c08709fe36fc 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -1137,6 +1137,8 @@ enum nl80211_rate_info { | |||
1137 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) | 1137 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) |
1138 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this | 1138 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this |
1139 | * station) | 1139 | * station) |
1140 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) | ||
1141 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) | ||
1140 | */ | 1142 | */ |
1141 | enum nl80211_sta_info { | 1143 | enum nl80211_sta_info { |
1142 | __NL80211_STA_INFO_INVALID, | 1144 | __NL80211_STA_INFO_INVALID, |
@@ -1150,6 +1152,8 @@ enum nl80211_sta_info { | |||
1150 | NL80211_STA_INFO_TX_BITRATE, | 1152 | NL80211_STA_INFO_TX_BITRATE, |
1151 | NL80211_STA_INFO_RX_PACKETS, | 1153 | NL80211_STA_INFO_RX_PACKETS, |
1152 | NL80211_STA_INFO_TX_PACKETS, | 1154 | NL80211_STA_INFO_TX_PACKETS, |
1155 | NL80211_STA_INFO_TX_RETRIES, | ||
1156 | NL80211_STA_INFO_TX_FAILED, | ||
1153 | 1157 | ||
1154 | /* keep last */ | 1158 | /* keep last */ |
1155 | __NL80211_STA_INFO_AFTER_LAST, | 1159 | __NL80211_STA_INFO_AFTER_LAST, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0f77515266b8..e76daaa7dc25 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -401,6 +401,8 @@ struct station_parameters { | |||
401 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) | 401 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) |
402 | * @STATION_INFO_RX_PACKETS: @rx_packets filled | 402 | * @STATION_INFO_RX_PACKETS: @rx_packets filled |
403 | * @STATION_INFO_TX_PACKETS: @tx_packets filled | 403 | * @STATION_INFO_TX_PACKETS: @tx_packets filled |
404 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | ||
405 | * @STATION_INFO_TX_FAILED: @tx_failed filled | ||
404 | */ | 406 | */ |
405 | enum station_info_flags { | 407 | enum station_info_flags { |
406 | STATION_INFO_INACTIVE_TIME = 1<<0, | 408 | STATION_INFO_INACTIVE_TIME = 1<<0, |
@@ -413,6 +415,8 @@ enum station_info_flags { | |||
413 | STATION_INFO_TX_BITRATE = 1<<7, | 415 | STATION_INFO_TX_BITRATE = 1<<7, |
414 | STATION_INFO_RX_PACKETS = 1<<8, | 416 | STATION_INFO_RX_PACKETS = 1<<8, |
415 | STATION_INFO_TX_PACKETS = 1<<9, | 417 | STATION_INFO_TX_PACKETS = 1<<9, |
418 | STATION_INFO_TX_RETRIES = 1<<10, | ||
419 | STATION_INFO_TX_FAILED = 1<<11, | ||
416 | }; | 420 | }; |
417 | 421 | ||
418 | /** | 422 | /** |
@@ -462,6 +466,8 @@ struct rate_info { | |||
462 | * @txrate: current unicast bitrate to this station | 466 | * @txrate: current unicast bitrate to this station |
463 | * @rx_packets: packets received from this station | 467 | * @rx_packets: packets received from this station |
464 | * @tx_packets: packets transmitted to this station | 468 | * @tx_packets: packets transmitted to this station |
469 | * @tx_retries: cumulative retry counts | ||
470 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) | ||
465 | * @generation: generation number for nl80211 dumps. | 471 | * @generation: generation number for nl80211 dumps. |
466 | * This number should increase every time the list of stations | 472 | * This number should increase every time the list of stations |
467 | * changes, i.e. when a station is added or removed, so that | 473 | * changes, i.e. when a station is added or removed, so that |
@@ -479,6 +485,8 @@ struct station_info { | |||
479 | struct rate_info txrate; | 485 | struct rate_info txrate; |
480 | u32 rx_packets; | 486 | u32 rx_packets; |
481 | u32 tx_packets; | 487 | u32 tx_packets; |
488 | u32 tx_retries; | ||
489 | u32 tx_failed; | ||
482 | 490 | ||
483 | int generation; | 491 | int generation; |
484 | }; | 492 | }; |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8b0e874a3d65..2e5a3fb38efe 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -327,6 +327,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
327 | STATION_INFO_TX_BYTES | | 327 | STATION_INFO_TX_BYTES | |
328 | STATION_INFO_RX_PACKETS | | 328 | STATION_INFO_RX_PACKETS | |
329 | STATION_INFO_TX_PACKETS | | 329 | STATION_INFO_TX_PACKETS | |
330 | STATION_INFO_TX_RETRIES | | ||
331 | STATION_INFO_TX_FAILED | | ||
330 | STATION_INFO_TX_BITRATE; | 332 | STATION_INFO_TX_BITRATE; |
331 | 333 | ||
332 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); | 334 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); |
@@ -334,6 +336,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
334 | sinfo->tx_bytes = sta->tx_bytes; | 336 | sinfo->tx_bytes = sta->tx_bytes; |
335 | sinfo->rx_packets = sta->rx_packets; | 337 | sinfo->rx_packets = sta->rx_packets; |
336 | sinfo->tx_packets = sta->tx_packets; | 338 | sinfo->tx_packets = sta->tx_packets; |
339 | sinfo->tx_retries = sta->tx_retry_count; | ||
340 | sinfo->tx_failed = sta->tx_retry_failed; | ||
337 | 341 | ||
338 | if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || | 342 | if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || |
339 | (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { | 343 | (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 9942f0b061ff..524f55402838 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -1890,6 +1890,12 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq, | |||
1890 | if (sinfo->filled & STATION_INFO_TX_PACKETS) | 1890 | if (sinfo->filled & STATION_INFO_TX_PACKETS) |
1891 | NLA_PUT_U32(msg, NL80211_STA_INFO_TX_PACKETS, | 1891 | NLA_PUT_U32(msg, NL80211_STA_INFO_TX_PACKETS, |
1892 | sinfo->tx_packets); | 1892 | sinfo->tx_packets); |
1893 | if (sinfo->filled & STATION_INFO_TX_RETRIES) | ||
1894 | NLA_PUT_U32(msg, NL80211_STA_INFO_TX_RETRIES, | ||
1895 | sinfo->tx_retries); | ||
1896 | if (sinfo->filled & STATION_INFO_TX_FAILED) | ||
1897 | NLA_PUT_U32(msg, NL80211_STA_INFO_TX_FAILED, | ||
1898 | sinfo->tx_failed); | ||
1893 | nla_nest_end(msg, sinfoattr); | 1899 | nla_nest_end(msg, sinfoattr); |
1894 | 1900 | ||
1895 | return genlmsg_end(msg, hdr); | 1901 | return genlmsg_end(msg, hdr); |