- sinfo->tx_bytes = 0;
- for (ac = 0; ac < IEEE80211_NUM_ACS; ac++) {
- sinfo->tx_bytes += sta->tx_bytes[ac];
- packets += sta->tx_packets[ac];
+
+ if (!(sinfo->filled & (STATION_INFO_TX_BYTES64 |
+ STATION_INFO_TX_BYTES))) {
+ sinfo->tx_bytes = 0;
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
+ sinfo->tx_bytes += sta->tx_bytes[ac];
+ sinfo->filled |= STATION_INFO_TX_BYTES64;
+ }
+
+ if (!(sinfo->filled & STATION_INFO_TX_PACKETS)) {
+ sinfo->tx_packets = 0;
+ for (ac = 0; ac < IEEE80211_NUM_ACS; ac++)
+ sinfo->tx_packets += sta->tx_packets[ac];
+ sinfo->filled |= STATION_INFO_TX_PACKETS;
+ }
+
+ if (!(sinfo->filled & (STATION_INFO_RX_BYTES64 |
+ STATION_INFO_RX_BYTES))) {
+ sinfo->rx_bytes = sta->rx_bytes;
+ sinfo->filled |= STATION_INFO_RX_BYTES64;
+ }
+
+ if (!(sinfo->filled & STATION_INFO_RX_PACKETS)) {
+ sinfo->rx_packets = sta->rx_packets;
+ sinfo->filled |= STATION_INFO_RX_PACKETS;
+ }
+
+ if (!(sinfo->filled & STATION_INFO_TX_RETRIES)) {
+ sinfo->tx_retries = sta->tx_retry_count;
+ sinfo->filled |= STATION_INFO_TX_RETRIES;
+ }
+
+ if (!(sinfo->filled & STATION_INFO_TX_FAILED)) {
+ sinfo->tx_failed = sta->tx_retry_failed;
+ sinfo->filled |= STATION_INFO_TX_FAILED;