diff options
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r-- | net/mac80211/sta_info.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 52d4b1a695c9..a03d8a312875 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -228,6 +228,7 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
228 | { | 228 | { |
229 | struct ieee80211_local *local = sdata->local; | 229 | struct ieee80211_local *local = sdata->local; |
230 | struct sta_info *sta; | 230 | struct sta_info *sta; |
231 | struct timespec uptime; | ||
231 | int i; | 232 | int i; |
232 | 233 | ||
233 | sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); | 234 | sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); |
@@ -245,6 +246,8 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, | |||
245 | sta->sdata = sdata; | 246 | sta->sdata = sdata; |
246 | sta->last_rx = jiffies; | 247 | sta->last_rx = jiffies; |
247 | 248 | ||
249 | do_posix_clock_monotonic_gettime(&uptime); | ||
250 | sta->last_connected = uptime.tv_sec; | ||
248 | ewma_init(&sta->avg_signal, 1024, 8); | 251 | ewma_init(&sta->avg_signal, 1024, 8); |
249 | 252 | ||
250 | if (sta_prepare_rate_control(local, sta, gfp)) { | 253 | if (sta_prepare_rate_control(local, sta, gfp)) { |
@@ -609,7 +612,8 @@ static bool sta_info_cleanup_expire_buffered(struct ieee80211_local *local, | |||
609 | #endif | 612 | #endif |
610 | dev_kfree_skb(skb); | 613 | dev_kfree_skb(skb); |
611 | 614 | ||
612 | if (skb_queue_empty(&sta->ps_tx_buf)) | 615 | if (skb_queue_empty(&sta->ps_tx_buf) && |
616 | !test_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF)) | ||
613 | sta_info_clear_tim_bit(sta); | 617 | sta_info_clear_tim_bit(sta); |
614 | } | 618 | } |
615 | 619 | ||
@@ -893,6 +897,7 @@ void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) | |||
893 | struct ieee80211_local *local = sdata->local; | 897 | struct ieee80211_local *local = sdata->local; |
894 | int sent, buffered; | 898 | int sent, buffered; |
895 | 899 | ||
900 | clear_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF); | ||
896 | if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) | 901 | if (!(local->hw.flags & IEEE80211_HW_AP_LINK_PS)) |
897 | drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); | 902 | drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); |
898 | 903 | ||
@@ -985,3 +990,12 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
985 | ieee80211_queue_work(hw, &sta->drv_unblock_wk); | 990 | ieee80211_queue_work(hw, &sta->drv_unblock_wk); |
986 | } | 991 | } |
987 | EXPORT_SYMBOL(ieee80211_sta_block_awake); | 992 | EXPORT_SYMBOL(ieee80211_sta_block_awake); |
993 | |||
994 | void ieee80211_sta_set_tim(struct ieee80211_sta *pubsta) | ||
995 | { | ||
996 | struct sta_info *sta = container_of(pubsta, struct sta_info, sta); | ||
997 | |||
998 | set_sta_flags(sta, WLAN_STA_PS_DRIVER_BUF); | ||
999 | sta_info_set_tim_bit(sta); | ||
1000 | } | ||
1001 | EXPORT_SYMBOL(ieee80211_sta_set_tim); | ||