diff options
author | Ben Greear <greearb@candelatech.com> | 2019-08-09 14:00:01 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2019-08-21 04:58:10 -0400 |
commit | 9cf02338880dfc5928e98e3a1200d5aacfa6d1c6 (patch) | |
tree | 78da23f42ee1ee7b91f64d7a755166e41e38a2e3 | |
parent | 6c7a00339e2a64b068c986301f37bd31eb83d7e9 (diff) |
mac80211: add assoc-at support
Report timestamp for when sta becomes associated.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Link: https://lore.kernel.org/r/20190809180001.26393-2-greearb@candelatech.com
[fix ktime_get_boot_ns() to ktime_get_boottime_ns(), assoc_at type to u64]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | net/mac80211/sta_info.c | 3 | ||||
-rw-r--r-- | net/mac80211/sta_info.h | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index fb6614f57cbc..df553070206c 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -1961,6 +1961,7 @@ int sta_info_move_state(struct sta_info *sta, | |||
1961 | case IEEE80211_STA_ASSOC: | 1961 | case IEEE80211_STA_ASSOC: |
1962 | if (sta->sta_state == IEEE80211_STA_AUTH) { | 1962 | if (sta->sta_state == IEEE80211_STA_AUTH) { |
1963 | set_bit(WLAN_STA_ASSOC, &sta->_flags); | 1963 | set_bit(WLAN_STA_ASSOC, &sta->_flags); |
1964 | sta->assoc_at = ktime_get_boottime_ns(); | ||
1964 | ieee80211_recalc_min_chandef(sta->sdata); | 1965 | ieee80211_recalc_min_chandef(sta->sdata); |
1965 | if (!sta->sta.support_p2p_ps) | 1966 | if (!sta->sta.support_p2p_ps) |
1966 | ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); | 1967 | ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); |
@@ -2190,6 +2191,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, | |||
2190 | BIT_ULL(NL80211_STA_INFO_STA_FLAGS) | | 2191 | BIT_ULL(NL80211_STA_INFO_STA_FLAGS) | |
2191 | BIT_ULL(NL80211_STA_INFO_BSS_PARAM) | | 2192 | BIT_ULL(NL80211_STA_INFO_BSS_PARAM) | |
2192 | BIT_ULL(NL80211_STA_INFO_CONNECTED_TIME) | | 2193 | BIT_ULL(NL80211_STA_INFO_CONNECTED_TIME) | |
2194 | BIT_ULL(NL80211_STA_INFO_ASSOC_AT_BOOTTIME) | | ||
2193 | BIT_ULL(NL80211_STA_INFO_RX_DROP_MISC); | 2195 | BIT_ULL(NL80211_STA_INFO_RX_DROP_MISC); |
2194 | 2196 | ||
2195 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { | 2197 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
@@ -2198,6 +2200,7 @@ void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, | |||
2198 | } | 2200 | } |
2199 | 2201 | ||
2200 | sinfo->connected_time = ktime_get_seconds() - sta->last_connected; | 2202 | sinfo->connected_time = ktime_get_seconds() - sta->last_connected; |
2203 | sinfo->assoc_at = sta->assoc_at; | ||
2201 | sinfo->inactive_time = | 2204 | sinfo->inactive_time = |
2202 | jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta)); | 2205 | jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta)); |
2203 | 2206 | ||
diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h index 3260d4234920..369c2dddce52 100644 --- a/net/mac80211/sta_info.h +++ b/net/mac80211/sta_info.h | |||
@@ -466,6 +466,7 @@ struct ieee80211_sta_rx_stats { | |||
466 | * the station when it leaves powersave or polls for frames | 466 | * the station when it leaves powersave or polls for frames |
467 | * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on | 467 | * @driver_buffered_tids: bitmap of TIDs the driver has data buffered on |
468 | * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on | 468 | * @txq_buffered_tids: bitmap of TIDs that mac80211 has txq data buffered on |
469 | * @assoc_at: clock boottime (in ns) of last association | ||
469 | * @last_connected: time (in seconds) when a station got connected | 470 | * @last_connected: time (in seconds) when a station got connected |
470 | * @last_seq_ctrl: last received seq/frag number from this STA (per TID | 471 | * @last_seq_ctrl: last received seq/frag number from this STA (per TID |
471 | * plus one for non-QoS frames) | 472 | * plus one for non-QoS frames) |
@@ -562,6 +563,7 @@ struct sta_info { | |||
562 | unsigned long driver_buffered_tids; | 563 | unsigned long driver_buffered_tids; |
563 | unsigned long txq_buffered_tids; | 564 | unsigned long txq_buffered_tids; |
564 | 565 | ||
566 | u64 assoc_at; | ||
565 | long last_connected; | 567 | long last_connected; |
566 | 568 | ||
567 | /* Updated from RX path only, no locking requirements */ | 569 | /* Updated from RX path only, no locking requirements */ |