diff options
author | Johannes Berg <johannes.berg@intel.com> | 2015-10-16 11:18:11 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2015-10-21 04:08:21 -0400 |
commit | 976bd9efdae6a844079ba4a7898a38d229ef246c (patch) | |
tree | f077d5f3e587294c4d62a2dc98fe62cc06a03f45 | |
parent | 763aa27a292113b6fd9f6ad8bf633edc9b13c98b (diff) |
mac80211: move beacon_loss_count into ifmgd
There's little point in keeping (and even sending to userspace)
the beacon_loss_count value per station, since it can only apply
to the AP on a managed-mode connection. Move the value to ifmgd,
advertise it only in managed mode, and remove it from ethtool as
it's available through better interfaces.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/ethtool.c | 3 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 3 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 10 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 9 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 1 |
5 files changed, 12 insertions, 14 deletions
diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c index 188faab11c24..3fbf9c308ec5 100644 --- a/net/mac80211/ethtool.c +++ b/net/mac80211/ethtool.c | |||
@@ -40,7 +40,7 @@ static const char ieee80211_gstrings_sta_stats[][ETH_GSTRING_LEN] = { | |||
40 | "rx_duplicates", "rx_fragments", "rx_dropped", | 40 | "rx_duplicates", "rx_fragments", "rx_dropped", |
41 | "tx_packets", "tx_bytes", | 41 | "tx_packets", "tx_bytes", |
42 | "tx_filtered", "tx_retry_failed", "tx_retries", | 42 | "tx_filtered", "tx_retry_failed", "tx_retries", |
43 | "beacon_loss", "sta_state", "txrate", "rxrate", "signal", | 43 | "sta_state", "txrate", "rxrate", "signal", |
44 | "channel", "noise", "ch_time", "ch_time_busy", | 44 | "channel", "noise", "ch_time", "ch_time_busy", |
45 | "ch_time_ext_busy", "ch_time_rx", "ch_time_tx" | 45 | "ch_time_ext_busy", "ch_time_rx", "ch_time_tx" |
46 | }; | 46 | }; |
@@ -90,7 +90,6 @@ static void ieee80211_get_stats(struct net_device *dev, | |||
90 | data[i++] += sta->tx_filtered_count; \ | 90 | data[i++] += sta->tx_filtered_count; \ |
91 | data[i++] += sta->tx_retry_failed; \ | 91 | data[i++] += sta->tx_retry_failed; \ |
92 | data[i++] += sta->tx_retry_count; \ | 92 | data[i++] += sta->tx_retry_count; \ |
93 | data[i++] += sta->beacon_loss_count; \ | ||
94 | } while (0) | 93 | } while (0) |
95 | 94 | ||
96 | /* For Managed stations, find the single station based on BSSID | 95 | /* For Managed stations, find the single station based on BSSID |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 056d3721148c..62f2a97cd2a6 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -503,6 +503,9 @@ struct ieee80211_if_managed { | |||
503 | */ | 503 | */ |
504 | unsigned int count_beacon_signal; | 504 | unsigned int count_beacon_signal; |
505 | 505 | ||
506 | /* Number of times beacon loss was invoked. */ | ||
507 | unsigned int beacon_loss_count; | ||
508 | |||
506 | /* | 509 | /* |
507 | * Last Beacon frame signal strength average (ave_beacon_signal / 16) | 510 | * Last Beacon frame signal strength average (ave_beacon_signal / 16) |
508 | * that triggered a cqm event. 0 indicates that no event has been | 511 | * that triggered a cqm event. 0 indicates that no event has been |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 6158db06a5b5..ded4b976bb48 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2420,15 +2420,9 @@ static void ieee80211_beacon_connection_loss_work(struct work_struct *work) | |||
2420 | container_of(work, struct ieee80211_sub_if_data, | 2420 | container_of(work, struct ieee80211_sub_if_data, |
2421 | u.mgd.beacon_connection_loss_work); | 2421 | u.mgd.beacon_connection_loss_work); |
2422 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 2422 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
2423 | struct sta_info *sta; | ||
2424 | 2423 | ||
2425 | if (ifmgd->associated) { | 2424 | if (ifmgd->associated) |
2426 | rcu_read_lock(); | 2425 | ifmgd->beacon_loss_count++; |
2427 | sta = sta_info_get(sdata, ifmgd->bssid); | ||
2428 | if (sta) | ||
2429 | sta->beacon_loss_count++; | ||
2430 | rcu_read_unlock(); | ||
2431 | } | ||
2432 | 2426 | ||
2433 | if (ifmgd->connection_loss) { | 2427 | if (ifmgd->connection_loss) { |
2434 | sdata_info(sdata, "Connection to AP %pM lost\n", | 2428 | sdata_info(sdata, "Connection to AP %pM lost\n", |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 7f2c4f2acadf..0b8dd1cca6d8 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -1871,8 +1871,12 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
1871 | BIT(NL80211_STA_INFO_STA_FLAGS) | | 1871 | BIT(NL80211_STA_INFO_STA_FLAGS) | |
1872 | BIT(NL80211_STA_INFO_BSS_PARAM) | | 1872 | BIT(NL80211_STA_INFO_BSS_PARAM) | |
1873 | BIT(NL80211_STA_INFO_CONNECTED_TIME) | | 1873 | BIT(NL80211_STA_INFO_CONNECTED_TIME) | |
1874 | BIT(NL80211_STA_INFO_RX_DROP_MISC) | | 1874 | BIT(NL80211_STA_INFO_RX_DROP_MISC); |
1875 | BIT(NL80211_STA_INFO_BEACON_LOSS); | 1875 | |
1876 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | ||
1877 | sinfo->beacon_loss_count = sdata->u.mgd.beacon_loss_count; | ||
1878 | sinfo->filled |= BIT(NL80211_STA_INFO_BEACON_LOSS); | ||
1879 | } | ||
1876 | 1880 | ||
1877 | sinfo->connected_time = ktime_get_seconds() - sta->last_connected; | 1881 | sinfo->connected_time = ktime_get_seconds() - sta->last_connected; |
1878 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); | 1882 | sinfo->inactive_time = jiffies_to_msecs(jiffies - sta->last_rx); |
@@ -1914,7 +1918,6 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo) | |||
1914 | } | 1918 | } |
1915 | 1919 | ||
1916 | sinfo->rx_dropped_misc = sta->rx_dropped; | 1920 | sinfo->rx_dropped_misc = sta->rx_dropped; |
1917 | sinfo->beacon_loss_count = sta->beacon_loss_count; | ||
1918 | 1921 | ||
1919 | if (sdata->vif.type == NL80211_IFTYPE_STATION && | 1922 | if (sdata->vif.type == NL80211_IFTYPE_STATION && |
1920 | !(sdata->vif.driver_flags & IEEE80211_VIF_BEACON_FILTER)) { | 1923 | !(sdata->vif.driver_flags & IEEE80211_VIF_BEACON_FILTER)) { |
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 7bb5781b4ce2..3a401d40c329 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -508,7 +508,6 @@ struct sta_info { | |||
508 | enum ieee80211_sta_rx_bandwidth cur_max_bandwidth; | 508 | enum ieee80211_sta_rx_bandwidth cur_max_bandwidth; |
509 | 509 | ||
510 | unsigned int lost_packets; | 510 | unsigned int lost_packets; |
511 | unsigned int beacon_loss_count; | ||
512 | 511 | ||
513 | enum ieee80211_smps_mode known_smps_mode; | 512 | enum ieee80211_smps_mode known_smps_mode; |
514 | const struct ieee80211_cipher_scheme *cipher_scheme; | 513 | const struct ieee80211_cipher_scheme *cipher_scheme; |