aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/nl80211.h2
-rw-r--r--include/net/cfg80211.h7
-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
6 files changed, 24 insertions, 2 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index f795cb7dccdd..0f5ff3739820 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -1655,6 +1655,7 @@ enum nl80211_sta_bss_param {
1655 * containing info as possible, see &enum nl80211_sta_bss_param 1655 * containing info as possible, see &enum nl80211_sta_bss_param
1656 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected 1656 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
1657 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update. 1657 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
1658 * @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
1658 * @__NL80211_STA_INFO_AFTER_LAST: internal 1659 * @__NL80211_STA_INFO_AFTER_LAST: internal
1659 * @NL80211_STA_INFO_MAX: highest possible station info attribute 1660 * @NL80211_STA_INFO_MAX: highest possible station info attribute
1660 */ 1661 */
@@ -1677,6 +1678,7 @@ enum nl80211_sta_info {
1677 NL80211_STA_INFO_BSS_PARAM, 1678 NL80211_STA_INFO_BSS_PARAM,
1678 NL80211_STA_INFO_CONNECTED_TIME, 1679 NL80211_STA_INFO_CONNECTED_TIME,
1679 NL80211_STA_INFO_STA_FLAGS, 1680 NL80211_STA_INFO_STA_FLAGS,
1681 NL80211_STA_INFO_BEACON_LOSS,
1680 1682
1681 /* keep last */ 1683 /* keep last */
1682 __NL80211_STA_INFO_AFTER_LAST, 1684 __NL80211_STA_INFO_AFTER_LAST,
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 9f85fca0b676..15f4be7d768e 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -505,6 +505,7 @@ struct station_parameters {
505 * @STATION_INFO_CONNECTED_TIME: @connected_time filled 505 * @STATION_INFO_CONNECTED_TIME: @connected_time filled
506 * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled 506 * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
507 * @STATION_INFO_STA_FLAGS: @sta_flags filled 507 * @STATION_INFO_STA_FLAGS: @sta_flags filled
508 * @STATION_INFO_BEACON_LOSS_COUNT: @beacon_loss_count filled
508 */ 509 */
509enum station_info_flags { 510enum station_info_flags {
510 STATION_INFO_INACTIVE_TIME = 1<<0, 511 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -525,7 +526,8 @@ enum station_info_flags {
525 STATION_INFO_BSS_PARAM = 1<<15, 526 STATION_INFO_BSS_PARAM = 1<<15,
526 STATION_INFO_CONNECTED_TIME = 1<<16, 527 STATION_INFO_CONNECTED_TIME = 1<<16,
527 STATION_INFO_ASSOC_REQ_IES = 1<<17, 528 STATION_INFO_ASSOC_REQ_IES = 1<<17,
528 STATION_INFO_STA_FLAGS = 1<<18 529 STATION_INFO_STA_FLAGS = 1<<18,
530 STATION_INFO_BEACON_LOSS_COUNT = 1<<19
529}; 531};
530 532
531/** 533/**
@@ -623,6 +625,7 @@ struct sta_bss_parameters {
623 * the cfg80211_new_sta() calls to notify user space of the IEs. 625 * the cfg80211_new_sta() calls to notify user space of the IEs.
624 * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets. 626 * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
625 * @sta_flags: station flags mask & values 627 * @sta_flags: station flags mask & values
628 * @beacon_loss_count: Number of times beacon loss event has triggered.
626 */ 629 */
627struct station_info { 630struct station_info {
628 u32 filled; 631 u32 filled;
@@ -650,6 +653,8 @@ struct station_info {
650 const u8 *assoc_req_ies; 653 const u8 *assoc_req_ies;
651 size_t assoc_req_ies_len; 654 size_t assoc_req_ies_len;
652 655
656 u32 beacon_loss_count;
657
653 /* 658 /*
654 * Note: Add a new enum station_info_flags value for each new field and 659 * Note: Add a new enum station_info_flags value for each new field and
655 * use it to check which fields are initialized. 660 * use it to check which fields are initialized.
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)