diff options
author | Ben Greear <greearb@candelatech.com> | 2010-10-07 19:39:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-11 15:04:19 -0400 |
commit | 5a5c731aa59cc2c44ca20f45b1a577cd4f5435e2 (patch) | |
tree | c5f45cd0e014bbaf600fe172ebbd117ca2737bbb | |
parent | b38afa87698375179026224522c2e48dcbf17e65 (diff) |
wireless: Set some stats used by /proc/net/wireless (wext)
Some stats for /proc/net/wireless (and wext in general) are not
being set. This patch addresses a few of those with values easily
obtained from mac80211 core.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | include/net/cfg80211.h | 4 | ||||
-rw-r--r-- | net/mac80211/cfg.c | 4 | ||||
-rw-r--r-- | net/wireless/wext-compat.c | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0778d04b3bbe..f920a06f363e 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -403,6 +403,7 @@ struct station_parameters { | |||
403 | * @STATION_INFO_TX_PACKETS: @tx_packets filled | 403 | * @STATION_INFO_TX_PACKETS: @tx_packets filled |
404 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | 404 | * @STATION_INFO_TX_RETRIES: @tx_retries filled |
405 | * @STATION_INFO_TX_FAILED: @tx_failed filled | 405 | * @STATION_INFO_TX_FAILED: @tx_failed filled |
406 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | ||
406 | */ | 407 | */ |
407 | enum station_info_flags { | 408 | enum station_info_flags { |
408 | STATION_INFO_INACTIVE_TIME = 1<<0, | 409 | STATION_INFO_INACTIVE_TIME = 1<<0, |
@@ -417,6 +418,7 @@ enum station_info_flags { | |||
417 | STATION_INFO_TX_PACKETS = 1<<9, | 418 | STATION_INFO_TX_PACKETS = 1<<9, |
418 | STATION_INFO_TX_RETRIES = 1<<10, | 419 | STATION_INFO_TX_RETRIES = 1<<10, |
419 | STATION_INFO_TX_FAILED = 1<<11, | 420 | STATION_INFO_TX_FAILED = 1<<11, |
421 | STATION_INFO_RX_DROP_MISC = 1<<12, | ||
420 | }; | 422 | }; |
421 | 423 | ||
422 | /** | 424 | /** |
@@ -468,6 +470,7 @@ struct rate_info { | |||
468 | * @tx_packets: packets transmitted to this station | 470 | * @tx_packets: packets transmitted to this station |
469 | * @tx_retries: cumulative retry counts | 471 | * @tx_retries: cumulative retry counts |
470 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) | 472 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) |
473 | * @rx_dropped_misc: Dropped for un-specified reason. | ||
471 | * @generation: generation number for nl80211 dumps. | 474 | * @generation: generation number for nl80211 dumps. |
472 | * This number should increase every time the list of stations | 475 | * This number should increase every time the list of stations |
473 | * changes, i.e. when a station is added or removed, so that | 476 | * changes, i.e. when a station is added or removed, so that |
@@ -487,6 +490,7 @@ struct station_info { | |||
487 | u32 tx_packets; | 490 | u32 tx_packets; |
488 | u32 tx_retries; | 491 | u32 tx_retries; |
489 | u32 tx_failed; | 492 | u32 tx_failed; |
493 | u32 rx_dropped_misc; | ||
490 | 494 | ||
491 | int generation; | 495 | int generation; |
492 | }; | 496 | }; |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index ecf9b7166ed1..25fb351e00f8 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -329,7 +329,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
329 | STATION_INFO_TX_PACKETS | | 329 | STATION_INFO_TX_PACKETS | |
330 | STATION_INFO_TX_RETRIES | | 330 | STATION_INFO_TX_RETRIES | |
331 | STATION_INFO_TX_FAILED | | 331 | STATION_INFO_TX_FAILED | |
332 | STATION_INFO_TX_BITRATE; | 332 | STATION_INFO_TX_BITRATE | |
333 | STATION_INFO_RX_DROP_MISC; | ||
333 | 334 | ||
334 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); | 335 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); |
335 | sinfo->rx_bytes = sta->rx_bytes; | 336 | sinfo->rx_bytes = sta->rx_bytes; |
@@ -338,6 +339,7 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
338 | sinfo->tx_packets = sta->tx_packets; | 339 | sinfo->tx_packets = sta->tx_packets; |
339 | sinfo->tx_retries = sta->tx_retry_count; | 340 | sinfo->tx_retries = sta->tx_retry_count; |
340 | sinfo->tx_failed = sta->tx_retry_failed; | 341 | sinfo->tx_failed = sta->tx_retry_failed; |
342 | sinfo->rx_dropped_misc = sta->rx_dropped; | ||
341 | 343 | ||
342 | if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || | 344 | if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || |
343 | (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { | 345 | (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { |
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 6002265289c6..12222ee6ebf2 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -1366,6 +1366,10 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev) | |||
1366 | } | 1366 | } |
1367 | 1367 | ||
1368 | wstats.qual.updated |= IW_QUAL_NOISE_INVALID; | 1368 | wstats.qual.updated |= IW_QUAL_NOISE_INVALID; |
1369 | if (sinfo.filled & STATION_INFO_RX_DROP_MISC) | ||
1370 | wstats.discard.misc = sinfo.rx_dropped_misc; | ||
1371 | if (sinfo.filled & STATION_INFO_TX_FAILED) | ||
1372 | wstats.discard.retries = sinfo.tx_failed; | ||
1369 | 1373 | ||
1370 | return &wstats; | 1374 | return &wstats; |
1371 | } | 1375 | } |