summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2014-11-17 14:08:11 +0100
committerJohannes Berg <johannes.berg@intel.com>2015-01-08 15:28:10 +0100
commit319090bf6c75e3ad42a8c74973be5e78ae4f948f (patch)
tree499fe25951bd986948c2b0e0552dfeca0784ae3a /net/mac80211
parentmac80211: allow drivers to provide most station statistics (diff)
downloadlinux-319090bf6c75e3ad42a8c74973be5e78ae4f948f.tar.xz
linux-319090bf6c75e3ad42a8c74973be5e78ae4f948f.zip
cfg80211: remove enum station_info_flags
This is really just duplicating the list of information that's already available in the nl80211 attribute, so remove the list. Two small changes are needed: * remove STATION_INFO_ASSOC_REQ_IES complete, but the length (assoc_req_ies_len) can be used instead * add NL80211_STA_INFO_RX_DROP_MISC which exists internally but not in nl80211 yet This gets rid of the duplicate maintenance of the two lists. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ethtool.c6
-rw-r--r--net/mac80211/sta_info.c80
2 files changed, 43 insertions, 43 deletions
diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index eea742710c0a..52bcea6ad9e8 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -117,16 +117,16 @@ static void ieee80211_get_stats(struct net_device *dev,
data[i++] = sta->sta_state;
- if (sinfo.filled & STATION_INFO_TX_BITRATE)
+ if (sinfo.filled & BIT(NL80211_STA_INFO_TX_BITRATE))
data[i] = 100000 *
cfg80211_calculate_bitrate(&sinfo.txrate);
i++;
- if (sinfo.filled & STATION_INFO_RX_BITRATE)
+ if (sinfo.filled & BIT(NL80211_STA_INFO_RX_BITRATE))
data[i] = 100000 *
cfg80211_calculate_bitrate(&sinfo.rxrate);
i++;
- if (sinfo.filled & STATION_INFO_SIGNAL_AVG)
+ if (sinfo.filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))
data[i] = (u8)sinfo.signal_avg;
i++;
} else {
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 967b42eae5c2..64b53b943d98 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1756,51 +1756,51 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
drv_sta_statistics(local, sdata, &sta->sta, sinfo);
- sinfo->filled |= STATION_INFO_INACTIVE_TIME |
- STATION_INFO_STA_FLAGS |
- STATION_INFO_BSS_PARAM |
- STATION_INFO_CONNECTED_TIME |
- STATION_INFO_RX_DROP_MISC |
- STATION_INFO_BEACON_LOSS_COUNT;
+ sinfo->filled |= BIT(NL80211_STA_INFO_INACTIVE_TIME) |
+ BIT(NL80211_STA_INFO_STA_FLAGS) |
+ BIT(NL80211_STA_INFO_BSS_PARAM) |
+ BIT(NL80211_STA_INFO_CONNECTED_TIME) |
+ BIT(NL80211_STA_INFO_RX_DROP_MISC) |
+ BIT(NL80211_STA_INFO_BEACON_LOSS);
ktime_get_ts(&uptime);
sinfo->connected_time = uptime.tv_sec - sta->last_connected;
sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx);
- if (!(sinfo->filled & (STATION_INFO_TX_BYTES64 |
- STATION_INFO_TX_BYTES))) {
+ if (!(sinfo->filled & (BIT(NL80211_STA_INFO_TX_BYTES64) |
+ BIT(NL80211_STA_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;
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BYTES64);
}
- if (!(sinfo->filled & STATION_INFO_TX_PACKETS)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_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;
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_PACKETS);
}
- if (!(sinfo->filled & (STATION_INFO_RX_BYTES64 |
- STATION_INFO_RX_BYTES))) {
+ if (!(sinfo->filled & (BIT(NL80211_STA_INFO_RX_BYTES64) |
+ BIT(NL80211_STA_INFO_RX_BYTES)))) {
sinfo->rx_bytes = sta->rx_bytes;
- sinfo->filled |= STATION_INFO_RX_BYTES64;
+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BYTES64);
}
- if (!(sinfo->filled & STATION_INFO_RX_PACKETS)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_PACKETS))) {
sinfo->rx_packets = sta->rx_packets;
- sinfo->filled |= STATION_INFO_RX_PACKETS;
+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_PACKETS);
}
- if (!(sinfo->filled & STATION_INFO_TX_RETRIES)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_RETRIES))) {
sinfo->tx_retries = sta->tx_retry_count;
- sinfo->filled |= STATION_INFO_TX_RETRIES;
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_RETRIES);
}
- if (!(sinfo->filled & STATION_INFO_TX_FAILED)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_FAILED))) {
sinfo->tx_failed = sta->tx_retry_failed;
- sinfo->filled |= STATION_INFO_TX_FAILED;
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_FAILED);
}
sinfo->rx_dropped_misc = sta->rx_dropped;
@@ -1808,22 +1808,22 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
(sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
- if (!(sinfo->filled & STATION_INFO_SIGNAL)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL))) {
sinfo->signal = (s8)sta->last_signal;
- sinfo->filled |= STATION_INFO_SIGNAL;
+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL);
}
- if (!(sinfo->filled & STATION_INFO_SIGNAL_AVG)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_SIGNAL_AVG))) {
sinfo->signal_avg = (s8) -ewma_read(&sta->avg_signal);
- sinfo->filled |= STATION_INFO_SIGNAL_AVG;
+ sinfo->filled |= BIT(NL80211_STA_INFO_SIGNAL_AVG);
}
}
if (sta->chains &&
- !(sinfo->filled & (STATION_INFO_CHAIN_SIGNAL |
- STATION_INFO_CHAIN_SIGNAL_AVG))) {
- sinfo->filled |= STATION_INFO_CHAIN_SIGNAL |
- STATION_INFO_CHAIN_SIGNAL_AVG;
+ !(sinfo->filled & (BIT(NL80211_STA_INFO_CHAIN_SIGNAL) |
+ BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG)))) {
+ sinfo->filled |= BIT(NL80211_STA_INFO_CHAIN_SIGNAL) |
+ BIT(NL80211_STA_INFO_CHAIN_SIGNAL_AVG);
sinfo->chains = sta->chains;
for (i = 0; i < ARRAY_SIZE(sinfo->chain_signal); i++) {
@@ -1833,30 +1833,30 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
}
}
- if (!(sinfo->filled & STATION_INFO_TX_BITRATE)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_TX_BITRATE))) {
sta_set_rate_info_tx(sta, &sta->last_tx_rate, &sinfo->txrate);
- sinfo->filled |= STATION_INFO_TX_BITRATE;
+ sinfo->filled |= BIT(NL80211_STA_INFO_TX_BITRATE);
}
- if (!(sinfo->filled & STATION_INFO_RX_BITRATE)) {
+ if (!(sinfo->filled & BIT(NL80211_STA_INFO_RX_BITRATE))) {
sta_set_rate_info_rx(sta, &sinfo->rxrate);
- sinfo->filled |= STATION_INFO_RX_BITRATE;
+ sinfo->filled |= BIT(NL80211_STA_INFO_RX_BITRATE);
}
if (ieee80211_vif_is_mesh(&sdata->vif)) {
#ifdef CONFIG_MAC80211_MESH
- sinfo->filled |= STATION_INFO_LLID |
- STATION_INFO_PLID |
- STATION_INFO_PLINK_STATE |
- STATION_INFO_LOCAL_PM |
- STATION_INFO_PEER_PM |
- STATION_INFO_NONPEER_PM;
+ sinfo->filled |= BIT(NL80211_STA_INFO_LLID) |
+ BIT(NL80211_STA_INFO_PLID) |
+ BIT(NL80211_STA_INFO_PLINK_STATE) |
+ BIT(NL80211_STA_INFO_LOCAL_PM) |
+ BIT(NL80211_STA_INFO_PEER_PM) |
+ BIT(NL80211_STA_INFO_NONPEER_PM);
sinfo->llid = sta->llid;
sinfo->plid = sta->plid;
sinfo->plink_state = sta->plink_state;
if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
- sinfo->filled |= STATION_INFO_T_OFFSET;
+ sinfo->filled |= BIT(NL80211_STA_INFO_T_OFFSET);
sinfo->t_offset = sta->t_offset;
}
sinfo->local_pm = sta->local_pm;
@@ -1905,7 +1905,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
thr = drv_get_expected_throughput(local, &sta->sta);
if (thr != 0) {
- sinfo->filled |= STATION_INFO_EXPECTED_THROUGHPUT;
+ sinfo->filled |= BIT(NL80211_STA_INFO_EXPECTED_THROUGHPUT);
sinfo->expected_throughput = thr;
}
}