aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPaul Stewart <pstew@chromium.org>2011-12-09 14:01:49 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-19 14:34:13 -0500
commita85e1d55974646a442d95911e3f7d7a891ea9ac5 (patch)
treeaa4dbeb64336c8e3ee2003a7963ec8ef38675101 /net
parent84381b4ed58498e1e3d49a4a306fec9894b8e00c (diff)
cfg80211: Return beacon loss count in station
If station info contains a beacon loss count, return it to userspace. Signed-off-by: Paul Stewart <pstew@chromium.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/cfg.c4
-rw-r--r--net/mac80211/mlme.c8
-rw-r--r--net/mac80211/sta_info.h2
-rw-r--r--net/wireless/nl80211.c3
4 files changed, 16 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 66ad9d9af87f..850bb96bd680 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -355,7 +355,8 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
355 STATION_INFO_RX_DROP_MISC | 355 STATION_INFO_RX_DROP_MISC |
356 STATION_INFO_BSS_PARAM | 356 STATION_INFO_BSS_PARAM |
357 STATION_INFO_CONNECTED_TIME | 357 STATION_INFO_CONNECTED_TIME |
358 STATION_INFO_STA_FLAGS; 358 STATION_INFO_STA_FLAGS |
359 STATION_INFO_BEACON_LOSS_COUNT;
359 360
360 do_posix_clock_monotonic_gettime(&uptime); 361 do_posix_clock_monotonic_gettime(&uptime);
361 sinfo->connected_time = uptime.tv_sec - sta->last_connected; 362 sinfo->connected_time = uptime.tv_sec - sta->last_connected;
@@ -368,6 +369,7 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
368 sinfo->tx_retries = sta->tx_retry_count; 369 sinfo->tx_retries = sta->tx_retry_count;
369 sinfo->tx_failed = sta->tx_retry_failed; 370 sinfo->tx_failed = sta->tx_retry_failed;
370 sinfo->rx_dropped_misc = sta->rx_dropped; 371 sinfo->rx_dropped_misc = sta->rx_dropped;
372 sinfo->beacon_loss_count = sta->beacon_loss_count;
371 373
372 if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) || 374 if ((sta->local->hw.flags & IEEE80211_HW_SIGNAL_DBM) ||
373 (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) { 375 (sta->local->hw.flags & IEEE80211_HW_SIGNAL_UNSPEC)) {
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a984f1f60ddb..57989a046fca 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1381,6 +1381,14 @@ void ieee80211_beacon_connection_loss_work(struct work_struct *work)
1381 struct ieee80211_sub_if_data *sdata = 1381 struct ieee80211_sub_if_data *sdata =
1382 container_of(work, struct ieee80211_sub_if_data, 1382 container_of(work, struct ieee80211_sub_if_data,
1383 u.mgd.beacon_connection_loss_work); 1383 u.mgd.beacon_connection_loss_work);
1384 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
1385 struct sta_info *sta;
1386
1387 if (ifmgd->associated) {
1388 sta = sta_info_get(sdata, ifmgd->bssid);
1389 if (sta)
1390 sta->beacon_loss_count++;
1391 }
1384 1392
1385 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) 1393 if (sdata->local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
1386 __ieee80211_connection_loss(sdata); 1394 __ieee80211_connection_loss(sdata);
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
index dee284290464..6f77f12dc3fc 100644
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -275,6 +275,7 @@ struct sta_ampdu_mlme {
275 * EAP frames before association 275 * EAP frames before association
276 * @sta: station information we share with the driver 276 * @sta: station information we share with the driver
277 * @sta_state: duplicates information about station state (for debug) 277 * @sta_state: duplicates information about station state (for debug)
278 * @beacon_loss_count: number of times beacon loss has triggered
278 */ 279 */
279struct sta_info { 280struct sta_info {
280 /* General information, mostly static */ 281 /* General information, mostly static */
@@ -367,6 +368,7 @@ struct sta_info {
367#endif 368#endif
368 369
369 unsigned int lost_packets; 370 unsigned int lost_packets;
371 unsigned int beacon_loss_count;
370 372
371 /* should be right in front of sta to be in the same cache line */ 373 /* should be right in front of sta to be in the same cache line */
372 bool dummy; 374 bool dummy;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b07c4fc4ae22..b3d3cf8931cb 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2390,6 +2390,9 @@ static int nl80211_send_station(struct sk_buff *msg, u32 pid, u32 seq,
2390 if (sinfo->filled & STATION_INFO_TX_FAILED) 2390 if (sinfo->filled & STATION_INFO_TX_FAILED)
2391 NLA_PUT_U32(msg, NL80211_STA_INFO_TX_FAILED, 2391 NLA_PUT_U32(msg, NL80211_STA_INFO_TX_FAILED,
2392 sinfo->tx_failed); 2392 sinfo->tx_failed);
2393 if (sinfo->filled & STATION_INFO_BEACON_LOSS_COUNT)
2394 NLA_PUT_U32(msg, NL80211_STA_INFO_BEACON_LOSS,
2395 sinfo->beacon_loss_count);
2393 if (sinfo->filled & STATION_INFO_BSS_PARAM) { 2396 if (sinfo->filled & STATION_INFO_BSS_PARAM) {
2394 bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM); 2397 bss_param = nla_nest_start(msg, NL80211_STA_INFO_BSS_PARAM);
2395 if (!bss_param) 2398 if (!bss_param)