Lines Matching refs:sta

78 			     struct sta_info *sta)  in sta_info_hash_del()  argument
80 return rhltable_remove(&local->sta_hash, &sta->hash_node, in sta_info_hash_del()
84 static void __cleanup_single_sta(struct sta_info *sta) in __cleanup_single_sta() argument
88 struct ieee80211_sub_if_data *sdata = sta->sdata; in __cleanup_single_sta()
92 if (test_sta_flag(sta, WLAN_STA_PS_STA) || in __cleanup_single_sta()
93 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || in __cleanup_single_sta()
94 test_sta_flag(sta, WLAN_STA_PS_DELIVER)) { in __cleanup_single_sta()
95 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || in __cleanup_single_sta()
96 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) in __cleanup_single_sta()
103 clear_sta_flag(sta, WLAN_STA_PS_STA); in __cleanup_single_sta()
104 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in __cleanup_single_sta()
105 clear_sta_flag(sta, WLAN_STA_PS_DELIVER); in __cleanup_single_sta()
110 if (sta->sta.txq[0]) { in __cleanup_single_sta()
111 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in __cleanup_single_sta()
114 if (!sta->sta.txq[i]) in __cleanup_single_sta()
117 txqi = to_txq_info(sta->sta.txq[i]); in __cleanup_single_sta()
124 local->total_ps_buffered -= skb_queue_len(&sta->ps_tx_buf[ac]); in __cleanup_single_sta()
125 ieee80211_purge_tx_queue(&local->hw, &sta->ps_tx_buf[ac]); in __cleanup_single_sta()
126 ieee80211_purge_tx_queue(&local->hw, &sta->tx_filtered[ac]); in __cleanup_single_sta()
130 mesh_sta_cleanup(sta); in __cleanup_single_sta()
132 cancel_work_sync(&sta->drv_deliver_wk); in __cleanup_single_sta()
141 kfree(sta->ampdu_mlme.tid_start_tx[i]); in __cleanup_single_sta()
142 tid_tx = rcu_dereference_raw(sta->ampdu_mlme.tid_tx[i]); in __cleanup_single_sta()
150 static void cleanup_single_sta(struct sta_info *sta) in cleanup_single_sta() argument
152 struct ieee80211_sub_if_data *sdata = sta->sdata; in cleanup_single_sta()
155 __cleanup_single_sta(sta); in cleanup_single_sta()
156 sta_info_free(local, sta); in cleanup_single_sta()
171 struct sta_info *sta; in sta_info_get() local
174 for_each_sta_info(local, addr, sta, tmp) { in sta_info_get()
175 if (sta->sdata == sdata) { in sta_info_get()
180 return sta; in sta_info_get()
196 struct sta_info *sta; in sta_info_get_bss() local
199 for_each_sta_info(local, addr, sta, tmp) { in sta_info_get_bss()
200 if (sta->sdata == sdata || in sta_info_get_bss()
201 (sta->sdata->bss && sta->sdata->bss == sdata->bss)) { in sta_info_get_bss()
206 return sta; in sta_info_get_bss()
217 struct sta_info *sta; in sta_info_get_by_addrs() local
219 for_each_sta_info(local, sta_addr, sta, tmp) { in sta_info_get_by_addrs()
220 if (ether_addr_equal(vif_addr, sta->sdata->vif.addr)) in sta_info_get_by_addrs()
221 return sta; in sta_info_get_by_addrs()
231 struct sta_info *sta; in sta_info_get_by_idx() local
234 list_for_each_entry_rcu(sta, &local->sta_list, list, in sta_info_get_by_idx()
236 if (sdata != sta->sdata) in sta_info_get_by_idx()
242 return sta; in sta_info_get_by_idx()
259 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) in sta_info_free() argument
269 while (sta->sta_state > IEEE80211_STA_NONE) { in sta_info_free()
272 WARN_ON_ONCE(test_sta_flag(sta, WLAN_STA_INSERTED)); in sta_info_free()
274 ret = sta_info_move_state(sta, sta->sta_state - 1); in sta_info_free()
279 if (sta->rate_ctrl) in sta_info_free()
280 rate_control_free_sta(sta); in sta_info_free()
282 sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); in sta_info_free()
284 if (sta->sta.txq[0]) in sta_info_free()
285 kfree(to_txq_info(sta->sta.txq[0])); in sta_info_free()
286 kfree(rcu_dereference_raw(sta->sta.rates)); in sta_info_free()
288 kfree(sta->mesh); in sta_info_free()
290 free_percpu(sta->pcpu_rx_stats); in sta_info_free()
291 kfree(sta); in sta_info_free()
296 struct sta_info *sta) in sta_info_hash_add() argument
298 return rhltable_insert(&local->sta_hash, &sta->hash_node, in sta_info_hash_add()
304 struct sta_info *sta; in sta_deliver_ps_frames() local
306 sta = container_of(wk, struct sta_info, drv_deliver_wk); in sta_deliver_ps_frames()
308 if (sta->dead) in sta_deliver_ps_frames()
312 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) in sta_deliver_ps_frames()
313 ieee80211_sta_ps_deliver_wakeup(sta); in sta_deliver_ps_frames()
314 else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) in sta_deliver_ps_frames()
315 ieee80211_sta_ps_deliver_poll_response(sta); in sta_deliver_ps_frames()
316 else if (test_and_clear_sta_flag(sta, WLAN_STA_UAPSD)) in sta_deliver_ps_frames()
317 ieee80211_sta_ps_deliver_uapsd(sta); in sta_deliver_ps_frames()
322 struct sta_info *sta, gfp_t gfp) in sta_prepare_rate_control() argument
327 sta->rate_ctrl = local->rate_ctrl; in sta_prepare_rate_control()
328 sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, in sta_prepare_rate_control()
329 sta, gfp); in sta_prepare_rate_control()
330 if (!sta->rate_ctrl_priv) in sta_prepare_rate_control()
341 struct sta_info *sta; in sta_info_alloc() local
344 sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp); in sta_info_alloc()
345 if (!sta) in sta_info_alloc()
349 sta->pcpu_rx_stats = in sta_info_alloc()
351 if (!sta->pcpu_rx_stats) in sta_info_alloc()
355 spin_lock_init(&sta->lock); in sta_info_alloc()
356 spin_lock_init(&sta->ps_lock); in sta_info_alloc()
357 INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); in sta_info_alloc()
358 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); in sta_info_alloc()
359 mutex_init(&sta->ampdu_mlme.mtx); in sta_info_alloc()
362 sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); in sta_info_alloc()
363 if (!sta->mesh) in sta_info_alloc()
365 sta->mesh->plink_sta = sta; in sta_info_alloc()
366 spin_lock_init(&sta->mesh->plink_lock); in sta_info_alloc()
369 timer_setup(&sta->mesh->plink_timer, mesh_plink_timer, in sta_info_alloc()
371 sta->mesh->nonpeer_pm = NL80211_MESH_POWER_ACTIVE; in sta_info_alloc()
375 memcpy(sta->addr, addr, ETH_ALEN); in sta_info_alloc()
376 memcpy(sta->sta.addr, addr, ETH_ALEN); in sta_info_alloc()
377 sta->sta.max_rx_aggregation_subframes = in sta_info_alloc()
386 BUILD_BUG_ON(ARRAY_SIZE(sta->ptk) <= INVALID_PTK_KEYIDX); in sta_info_alloc()
387 sta->ptk_idx = INVALID_PTK_KEYIDX; in sta_info_alloc()
389 sta->local = local; in sta_info_alloc()
390 sta->sdata = sdata; in sta_info_alloc()
391 sta->rx_stats.last_rx = jiffies; in sta_info_alloc()
393 u64_stats_init(&sta->rx_stats.syncp); in sta_info_alloc()
395 sta->sta_state = IEEE80211_STA_NONE; in sta_info_alloc()
398 sta->reserved_tid = IEEE80211_TID_UNRESERVED; in sta_info_alloc()
400 sta->last_connected = ktime_get_seconds(); in sta_info_alloc()
401 ewma_signal_init(&sta->rx_stats_avg.signal); in sta_info_alloc()
402 ewma_avg_signal_init(&sta->status_stats.avg_ack_signal); in sta_info_alloc()
403 for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++) in sta_info_alloc()
404 ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]); in sta_info_alloc()
411 txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); in sta_info_alloc()
415 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in sta_info_alloc()
419 ieee80211_txq_init(sdata, sta, txq, i); in sta_info_alloc()
423 if (sta_prepare_rate_control(local, sta, gfp)) in sta_info_alloc()
426 sta->airtime_weight = IEEE80211_DEFAULT_AIRTIME_WEIGHT; in sta_info_alloc()
429 skb_queue_head_init(&sta->ps_tx_buf[i]); in sta_info_alloc()
430 skb_queue_head_init(&sta->tx_filtered[i]); in sta_info_alloc()
431 sta->airtime[i].deficit = sta->airtime_weight; in sta_info_alloc()
432 atomic_set(&sta->airtime[i].aql_tx_pending, 0); in sta_info_alloc()
433 sta->airtime[i].aql_limit_low = local->aql_txq_limit_low[i]; in sta_info_alloc()
434 sta->airtime[i].aql_limit_high = local->aql_txq_limit_high[i]; in sta_info_alloc()
438 sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX); in sta_info_alloc()
477 sta->sta.supp_rates[i] |= BIT(r); in sta_info_alloc()
481 sta->sta.smps_mode = IEEE80211_SMPS_OFF; in sta_info_alloc()
499 sta->known_smps_mode = IEEE80211_SMPS_OFF; in sta_info_alloc()
502 sta->known_smps_mode = IEEE80211_SMPS_STATIC; in sta_info_alloc()
505 sta->known_smps_mode = IEEE80211_SMPS_DYNAMIC; in sta_info_alloc()
512 sta->sta.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; in sta_info_alloc()
514 sta->cparams.ce_threshold = CODEL_DISABLED_THRESHOLD; in sta_info_alloc()
515 sta->cparams.target = MS2TIME(20); in sta_info_alloc()
516 sta->cparams.interval = MS2TIME(100); in sta_info_alloc()
517 sta->cparams.ecn = true; in sta_info_alloc()
519 sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); in sta_info_alloc()
521 return sta; in sta_info_alloc()
524 if (sta->sta.txq[0]) in sta_info_alloc()
525 kfree(to_txq_info(sta->sta.txq[0])); in sta_info_alloc()
527 free_percpu(sta->pcpu_rx_stats); in sta_info_alloc()
529 kfree(sta->mesh); in sta_info_alloc()
531 kfree(sta); in sta_info_alloc()
535 static int sta_info_insert_check(struct sta_info *sta) in sta_info_insert_check() argument
537 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_info_insert_check()
547 if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) || in sta_info_insert_check()
548 is_multicast_ether_addr(sta->sta.addr))) in sta_info_insert_check()
558 ieee80211_find_sta_by_ifaddr(&sdata->local->hw, sta->addr, NULL)) { in sta_info_insert_check()
569 struct sta_info *sta) in sta_info_insert_drv_state() argument
574 for (state = IEEE80211_STA_NOTEXIST; state < sta->sta_state; state++) { in sta_info_insert_drv_state()
575 err = drv_sta_state(local, sdata, sta, state, state + 1); in sta_info_insert_drv_state()
586 sta->uploaded = true; in sta_info_insert_drv_state()
593 sta->sta.addr, state + 1, err); in sta_info_insert_drv_state()
599 WARN_ON(drv_sta_state(local, sdata, sta, state, state - 1)); in sta_info_insert_drv_state()
609 struct sta_info *sta; in ieee80211_recalc_p2p_go_ps_allowed() local
612 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_p2p_go_ps_allowed()
613 if (sdata != sta->sdata || in ieee80211_recalc_p2p_go_ps_allowed()
614 !test_sta_flag(sta, WLAN_STA_ASSOC)) in ieee80211_recalc_p2p_go_ps_allowed()
616 if (!sta->sta.support_p2p_ps) { in ieee80211_recalc_p2p_go_ps_allowed()
634 static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) in sta_info_insert_finish() argument
636 struct ieee80211_local *local = sta->local; in sta_info_insert_finish()
637 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_info_insert_finish()
644 if (sta_info_get_bss(sdata, sta->sta.addr)) { in sta_info_insert_finish()
660 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in sta_info_insert_finish()
663 err = sta_info_hash_add(local, sta); in sta_info_insert_finish()
667 list_add_tail_rcu(&sta->list, &local->sta_list); in sta_info_insert_finish()
670 err = sta_info_insert_drv_state(local, sdata, sta); in sta_info_insert_finish()
674 set_sta_flag(sta, WLAN_STA_INSERTED); in sta_info_insert_finish()
676 if (sta->sta_state >= IEEE80211_STA_ASSOC) { in sta_info_insert_finish()
677 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_insert_finish()
678 if (!sta->sta.support_p2p_ps) in sta_info_insert_finish()
679 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_insert_finish()
683 clear_sta_flag(sta, WLAN_STA_BLOCK_BA); in sta_info_insert_finish()
685 ieee80211_sta_debugfs_add(sta); in sta_info_insert_finish()
686 rate_control_add_sta_debugfs(sta); in sta_info_insert_finish()
689 cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); in sta_info_insert_finish()
692 sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); in sta_info_insert_finish()
703 sta_info_hash_del(local, sta); in sta_info_insert_finish()
704 list_del_rcu(&sta->list); in sta_info_insert_finish()
708 cleanup_single_sta(sta); in sta_info_insert_finish()
716 int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) in sta_info_insert_rcu() argument
718 struct ieee80211_local *local = sta->local; in sta_info_insert_rcu()
725 err = sta_info_insert_check(sta); in sta_info_insert_rcu()
727 sta_info_free(local, sta); in sta_info_insert_rcu()
733 return sta_info_insert_finish(sta); in sta_info_insert_rcu()
736 int sta_info_insert(struct sta_info *sta) in sta_info_insert() argument
738 int err = sta_info_insert_rcu(sta); in sta_info_insert()
790 static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending) in __sta_info_recalc_tim() argument
792 struct ieee80211_local *local = sta->local; in __sta_info_recalc_tim()
795 u8 ignore_for_tim = sta->sta.uapsd_queues; in __sta_info_recalc_tim()
797 u16 id = sta->sta.aid; in __sta_info_recalc_tim()
799 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || in __sta_info_recalc_tim()
800 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in __sta_info_recalc_tim()
801 if (WARN_ON_ONCE(!sta->sdata->bss)) in __sta_info_recalc_tim()
804 ps = &sta->sdata->bss->ps; in __sta_info_recalc_tim()
806 } else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) { in __sta_info_recalc_tim()
807 ps = &sta->sdata->u.mesh.ps; in __sta_info_recalc_tim()
817 if (sta->dead) in __sta_info_recalc_tim()
838 indicate_tim |= !skb_queue_empty(&sta->tx_filtered[ac]) || in __sta_info_recalc_tim()
839 !skb_queue_empty(&sta->ps_tx_buf[ac]); in __sta_info_recalc_tim()
846 sta->driver_buffered_tids & tids; in __sta_info_recalc_tim()
848 sta->txq_buffered_tids & tids; in __sta_info_recalc_tim()
862 if (local->ops->set_tim && !WARN_ON(sta->dead)) { in __sta_info_recalc_tim()
864 drv_set_tim(local, &sta->sta, indicate_tim); in __sta_info_recalc_tim()
872 void sta_info_recalc_tim(struct sta_info *sta) in sta_info_recalc_tim() argument
874 __sta_info_recalc_tim(sta, false); in sta_info_recalc_tim()
877 static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb) in sta_info_buffer_expired() argument
888 timeout = (sta->listen_interval * in sta_info_buffer_expired()
889 sta->sdata->vif.bss_conf.beacon_int * in sta_info_buffer_expired()
898 struct sta_info *sta, int ac) in sta_info_cleanup_expire_buffered_ac() argument
911 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
912 skb = skb_peek(&sta->tx_filtered[ac]); in sta_info_cleanup_expire_buffered_ac()
913 if (sta_info_buffer_expired(sta, skb)) in sta_info_cleanup_expire_buffered_ac()
914 skb = __skb_dequeue(&sta->tx_filtered[ac]); in sta_info_cleanup_expire_buffered_ac()
917 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
937 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
938 skb = skb_peek(&sta->ps_tx_buf[ac]); in sta_info_cleanup_expire_buffered_ac()
939 if (sta_info_buffer_expired(sta, skb)) in sta_info_cleanup_expire_buffered_ac()
940 skb = __skb_dequeue(&sta->ps_tx_buf[ac]); in sta_info_cleanup_expire_buffered_ac()
943 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
954 ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", in sta_info_cleanup_expire_buffered_ac()
955 sta->sta.addr); in sta_info_cleanup_expire_buffered_ac()
964 sta_info_recalc_tim(sta); in sta_info_cleanup_expire_buffered_ac()
971 return !(skb_queue_empty(&sta->ps_tx_buf[ac]) && in sta_info_cleanup_expire_buffered_ac()
972 skb_queue_empty(&sta->tx_filtered[ac])); in sta_info_cleanup_expire_buffered_ac()
976 struct sta_info *sta) in sta_info_cleanup_expire_buffered() argument
982 if (!sta->sdata->bss && in sta_info_cleanup_expire_buffered()
983 !ieee80211_vif_is_mesh(&sta->sdata->vif)) in sta_info_cleanup_expire_buffered()
988 sta_info_cleanup_expire_buffered_ac(local, sta, ac); in sta_info_cleanup_expire_buffered()
993 static int __must_check __sta_info_destroy_part1(struct sta_info *sta) in __sta_info_destroy_part1() argument
1001 if (!sta) in __sta_info_destroy_part1()
1004 local = sta->local; in __sta_info_destroy_part1()
1005 sdata = sta->sdata; in __sta_info_destroy_part1()
1015 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in __sta_info_destroy_part1()
1016 ieee80211_sta_tear_down_BA_sessions(sta, AGG_STOP_DESTROY_STA); in __sta_info_destroy_part1()
1023 drv_sync_rx_queues(local, sta); in __sta_info_destroy_part1()
1025 ret = sta_info_hash_del(local, sta); in __sta_info_destroy_part1()
1033 if (test_sta_flag(sta, WLAN_STA_TDLS_OFF_CHANNEL)) { in __sta_info_destroy_part1()
1034 drv_tdls_cancel_channel_switch(local, sdata, &sta->sta); in __sta_info_destroy_part1()
1035 clear_sta_flag(sta, WLAN_STA_TDLS_OFF_CHANNEL); in __sta_info_destroy_part1()
1038 list_del_rcu(&sta->list); in __sta_info_destroy_part1()
1039 sta->removed = true; in __sta_info_destroy_part1()
1041 drv_sta_pre_rcu_remove(local, sta->sdata, sta); in __sta_info_destroy_part1()
1044 rcu_access_pointer(sdata->u.vlan.sta) == sta) in __sta_info_destroy_part1()
1045 RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); in __sta_info_destroy_part1()
1050 static void __sta_info_destroy_part2(struct sta_info *sta) in __sta_info_destroy_part2() argument
1052 struct ieee80211_local *local = sta->local; in __sta_info_destroy_part2()
1053 struct ieee80211_sub_if_data *sdata = sta->sdata; in __sta_info_destroy_part2()
1065 if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { in __sta_info_destroy_part2()
1066 ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); in __sta_info_destroy_part2()
1071 ieee80211_free_sta_keys(local, sta); in __sta_info_destroy_part2()
1074 __sta_info_recalc_tim(sta, true); in __sta_info_destroy_part2()
1076 sta->dead = true; in __sta_info_destroy_part2()
1081 while (sta->sta_state > IEEE80211_STA_NONE) { in __sta_info_destroy_part2()
1082 ret = sta_info_move_state(sta, sta->sta_state - 1); in __sta_info_destroy_part2()
1089 if (sta->uploaded) { in __sta_info_destroy_part2()
1090 ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE, in __sta_info_destroy_part2()
1095 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); in __sta_info_destroy_part2()
1099 sta_set_sinfo(sta, sinfo, true); in __sta_info_destroy_part2()
1100 cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); in __sta_info_destroy_part2()
1103 ieee80211_sta_debugfs_remove(sta); in __sta_info_destroy_part2()
1105 cleanup_single_sta(sta); in __sta_info_destroy_part2()
1108 int __must_check __sta_info_destroy(struct sta_info *sta) in __sta_info_destroy() argument
1110 int err = __sta_info_destroy_part1(sta); in __sta_info_destroy()
1117 __sta_info_destroy_part2(sta); in __sta_info_destroy()
1124 struct sta_info *sta; in sta_info_destroy_addr() local
1128 sta = sta_info_get(sdata, addr); in sta_info_destroy_addr()
1129 ret = __sta_info_destroy(sta); in sta_info_destroy_addr()
1138 struct sta_info *sta; in sta_info_destroy_addr_bss() local
1142 sta = sta_info_get_bss(sdata, addr); in sta_info_destroy_addr_bss()
1143 ret = __sta_info_destroy(sta); in sta_info_destroy_addr_bss()
1152 struct sta_info *sta; in sta_info_cleanup() local
1156 list_for_each_entry_rcu(sta, &local->sta_list, list) in sta_info_cleanup()
1157 if (sta_info_cleanup_expire_buffered(local, sta)) in sta_info_cleanup()
1197 struct sta_info *sta, *tmp; in __sta_info_flush() local
1207 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in __sta_info_flush()
1208 if (sdata == sta->sdata || in __sta_info_flush()
1209 (vlans && sdata->bss == sta->sdata->bss)) { in __sta_info_flush()
1210 if (!WARN_ON(__sta_info_destroy_part1(sta))) in __sta_info_flush()
1211 list_add(&sta->free_list, &free_list); in __sta_info_flush()
1218 list_for_each_entry_safe(sta, tmp, &free_list, free_list) in __sta_info_flush()
1219 __sta_info_destroy_part2(sta); in __sta_info_flush()
1230 struct sta_info *sta, *tmp; in ieee80211_sta_expire() local
1234 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in ieee80211_sta_expire()
1235 unsigned long last_active = ieee80211_sta_last_active(sta); in ieee80211_sta_expire()
1237 if (sdata != sta->sdata) in ieee80211_sta_expire()
1241 sta_dbg(sta->sdata, "expiring inactive STA %pM\n", in ieee80211_sta_expire()
1242 sta->sta.addr); in ieee80211_sta_expire()
1245 test_sta_flag(sta, WLAN_STA_PS_STA)) in ieee80211_sta_expire()
1248 WARN_ON(__sta_info_destroy(sta)); in ieee80211_sta_expire()
1261 struct sta_info *sta; in ieee80211_find_sta_by_ifaddr() local
1267 for_each_sta_info(local, addr, sta, tmp) { in ieee80211_find_sta_by_ifaddr()
1269 !ether_addr_equal(sta->sdata->vif.addr, localaddr)) in ieee80211_find_sta_by_ifaddr()
1271 if (!sta->uploaded) in ieee80211_find_sta_by_ifaddr()
1273 return &sta->sta; in ieee80211_find_sta_by_ifaddr()
1283 struct sta_info *sta; in ieee80211_find_sta() local
1288 sta = sta_info_get_bss(vif_to_sdata(vif), addr); in ieee80211_find_sta()
1289 if (!sta) in ieee80211_find_sta()
1292 if (!sta->uploaded) in ieee80211_find_sta()
1295 return &sta->sta; in ieee80211_find_sta()
1300 void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) in ieee80211_sta_ps_deliver_wakeup() argument
1302 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_deliver_wakeup()
1320 clear_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_ps_deliver_wakeup()
1323 sta->driver_buffered_tids = 0; in ieee80211_sta_ps_deliver_wakeup()
1324 sta->txq_buffered_tids = 0; in ieee80211_sta_ps_deliver_wakeup()
1327 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); in ieee80211_sta_ps_deliver_wakeup()
1329 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in ieee80211_sta_ps_deliver_wakeup()
1330 if (!sta->sta.txq[i] || !txq_has_queue(sta->sta.txq[i])) in ieee80211_sta_ps_deliver_wakeup()
1333 schedule_and_wake_txq(local, to_txq_info(sta->sta.txq[i])); in ieee80211_sta_ps_deliver_wakeup()
1339 spin_lock(&sta->ps_lock); in ieee80211_sta_ps_deliver_wakeup()
1344 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1345 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending); in ieee80211_sta_ps_deliver_wakeup()
1346 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1351 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1352 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); in ieee80211_sta_ps_deliver_wakeup()
1353 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1361 clear_sta_flag(sta, WLAN_STA_PS_DELIVER); in ieee80211_sta_ps_deliver_wakeup()
1366 clear_sta_flag(sta, WLAN_STA_PSPOLL); in ieee80211_sta_ps_deliver_wakeup()
1367 clear_sta_flag(sta, WLAN_STA_UAPSD); in ieee80211_sta_ps_deliver_wakeup()
1368 spin_unlock(&sta->ps_lock); in ieee80211_sta_ps_deliver_wakeup()
1374 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_wakeup()
1378 sta->sta.addr, sta->sta.aid, filtered, buffered); in ieee80211_sta_ps_deliver_wakeup()
1380 ieee80211_check_fast_xmit(sta); in ieee80211_sta_ps_deliver_wakeup()
1383 static void ieee80211_send_null_response(struct sta_info *sta, int tid, in ieee80211_send_null_response() argument
1387 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_send_null_response()
1393 bool qos = sta->sta.wme; in ieee80211_send_null_response()
1422 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in ieee80211_send_null_response()
1456 drv_allow_buffered_frames(local, sta, BIT(tid), 1, in ieee80211_send_null_response()
1470 ieee80211_xmit(sdata, sta, skb); in ieee80211_send_null_response()
1491 ieee80211_sta_ps_more_data(struct sta_info *sta, u8 ignored_acs, in ieee80211_sta_ps_more_data() argument
1510 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in ieee80211_sta_ps_more_data()
1511 !skb_queue_empty(&sta->ps_tx_buf[ac])) in ieee80211_sta_ps_more_data()
1519 ieee80211_sta_ps_get_frames(struct sta_info *sta, int n_frames, u8 ignored_acs, in ieee80211_sta_ps_get_frames() argument
1524 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_get_frames()
1542 sta->driver_buffered_tids & tids; in ieee80211_sta_ps_get_frames()
1543 *driver_release_tids |= sta->txq_buffered_tids & tids; in ieee80211_sta_ps_get_frames()
1550 skb = skb_dequeue(&sta->tx_filtered[ac]); in ieee80211_sta_ps_get_frames()
1553 &sta->ps_tx_buf[ac]); in ieee80211_sta_ps_get_frames()
1568 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in ieee80211_sta_ps_get_frames()
1569 !skb_queue_empty(&sta->ps_tx_buf[ac])) in ieee80211_sta_ps_get_frames()
1575 ieee80211_sta_ps_deliver_response(struct sta_info *sta, in ieee80211_sta_ps_deliver_response() argument
1579 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_deliver_response()
1586 set_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_ps_deliver_response()
1590 ieee80211_sta_ps_get_frames(sta, n_frames, ignored_acs, reason, in ieee80211_sta_ps_deliver_response()
1593 more_data = ieee80211_sta_ps_more_data(sta, ignored_acs, reason, driver_release_tids); in ieee80211_sta_ps_deliver_response()
1623 ieee80211_send_null_response(sta, tid, reason, true, false); in ieee80211_sta_ps_deliver_response()
1716 drv_allow_buffered_frames(local, sta, tids, num, in ieee80211_sta_ps_deliver_response()
1723 sta, find_highest_prio_tid(tids), in ieee80211_sta_ps_deliver_response()
1726 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_response()
1740 drv_release_buffered_frames(local, sta, driver_release_tids, in ieee80211_sta_ps_deliver_response()
1753 if (!sta->sta.txq[0]) in ieee80211_sta_ps_deliver_response()
1756 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { in ieee80211_sta_ps_deliver_response()
1757 if (!sta->sta.txq[tid] || in ieee80211_sta_ps_deliver_response()
1759 txq_has_queue(sta->sta.txq[tid])) in ieee80211_sta_ps_deliver_response()
1762 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_response()
1768 void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta) in ieee80211_sta_ps_deliver_poll_response() argument
1770 u8 ignore_for_response = sta->sta.uapsd_queues; in ieee80211_sta_ps_deliver_poll_response()
1780 ieee80211_sta_ps_deliver_response(sta, 1, ignore_for_response, in ieee80211_sta_ps_deliver_poll_response()
1784 void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta) in ieee80211_sta_ps_deliver_uapsd() argument
1786 int n_frames = sta->sta.max_sp; in ieee80211_sta_ps_deliver_uapsd()
1787 u8 delivery_enabled = sta->sta.uapsd_queues; in ieee80211_sta_ps_deliver_uapsd()
1798 switch (sta->sta.max_sp) { in ieee80211_sta_ps_deliver_uapsd()
1814 ieee80211_sta_ps_deliver_response(sta, n_frames, ~delivery_enabled, in ieee80211_sta_ps_deliver_uapsd()
1821 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_block_awake() local
1823 trace_api_sta_block_awake(sta->local, pubsta, block); in ieee80211_sta_block_awake()
1826 set_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1827 ieee80211_clear_fast_xmit(sta); in ieee80211_sta_block_awake()
1831 if (!test_sta_flag(sta, WLAN_STA_PS_DRIVER)) in ieee80211_sta_block_awake()
1834 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in ieee80211_sta_block_awake()
1835 set_sta_flag(sta, WLAN_STA_PS_DELIVER); in ieee80211_sta_block_awake()
1836 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1837 ieee80211_queue_work(hw, &sta->drv_deliver_wk); in ieee80211_sta_block_awake()
1838 } else if (test_sta_flag(sta, WLAN_STA_PSPOLL) || in ieee80211_sta_block_awake()
1839 test_sta_flag(sta, WLAN_STA_UAPSD)) { in ieee80211_sta_block_awake()
1841 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1842 ieee80211_queue_work(hw, &sta->drv_deliver_wk); in ieee80211_sta_block_awake()
1844 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1845 ieee80211_check_fast_xmit(sta); in ieee80211_sta_block_awake()
1852 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_eosp() local
1853 struct ieee80211_local *local = sta->local; in ieee80211_sta_eosp()
1857 clear_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_eosp()
1863 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_send_eosp_nullfunc() local
1867 trace_api_send_eosp_nullfunc(sta->local, pubsta, tid); in ieee80211_send_eosp_nullfunc()
1870 more_data = ieee80211_sta_ps_more_data(sta, ~sta->sta.uapsd_queues, in ieee80211_send_eosp_nullfunc()
1873 ieee80211_send_null_response(sta, tid, reason, false, more_data); in ieee80211_send_eosp_nullfunc()
1880 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_set_buffered() local
1885 trace_api_sta_set_buffered(sta->local, pubsta, tid, buffered); in ieee80211_sta_set_buffered()
1888 set_bit(tid, &sta->driver_buffered_tids); in ieee80211_sta_set_buffered()
1890 clear_bit(tid, &sta->driver_buffered_tids); in ieee80211_sta_set_buffered()
1892 sta_info_recalc_tim(sta); in ieee80211_sta_set_buffered()
1899 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_register_airtime() local
1900 struct ieee80211_local *local = sta->sdata->local; in ieee80211_sta_register_airtime()
1904 if (sta->local->airtime_flags & AIRTIME_USE_TX) in ieee80211_sta_register_airtime()
1906 if (sta->local->airtime_flags & AIRTIME_USE_RX) in ieee80211_sta_register_airtime()
1910 sta->airtime[ac].tx_airtime += tx_airtime; in ieee80211_sta_register_airtime()
1911 sta->airtime[ac].rx_airtime += rx_airtime; in ieee80211_sta_register_airtime()
1912 sta->airtime[ac].deficit -= airtime; in ieee80211_sta_register_airtime()
1918 struct sta_info *sta, u8 ac, in ieee80211_sta_update_pending_airtime() argument
1927 if (sta) in ieee80211_sta_update_pending_airtime()
1929 &sta->airtime[ac].aql_tx_pending); in ieee80211_sta_update_pending_airtime()
1935 if (sta) { in ieee80211_sta_update_pending_airtime()
1937 &sta->airtime[ac].aql_tx_pending); in ieee80211_sta_update_pending_airtime()
1939 atomic_cmpxchg(&sta->airtime[ac].aql_tx_pending, in ieee80211_sta_update_pending_airtime()
1953 int sta_info_move_state(struct sta_info *sta, in sta_info_move_state() argument
1958 if (sta->sta_state == new_state) in sta_info_move_state()
1965 if (sta->sta_state != IEEE80211_STA_AUTH) in sta_info_move_state()
1969 if (sta->sta_state != IEEE80211_STA_NONE && in sta_info_move_state()
1970 sta->sta_state != IEEE80211_STA_ASSOC) in sta_info_move_state()
1974 if (sta->sta_state != IEEE80211_STA_AUTH && in sta_info_move_state()
1975 sta->sta_state != IEEE80211_STA_AUTHORIZED) in sta_info_move_state()
1979 if (sta->sta_state != IEEE80211_STA_ASSOC) in sta_info_move_state()
1987 sta_dbg(sta->sdata, "moving STA %pM to state %d\n", in sta_info_move_state()
1988 sta->sta.addr, new_state); in sta_info_move_state()
1994 if (test_sta_flag(sta, WLAN_STA_INSERTED)) { in sta_info_move_state()
1995 int err = drv_sta_state(sta->local, sta->sdata, sta, in sta_info_move_state()
1996 sta->sta_state, new_state); in sta_info_move_state()
2005 if (sta->sta_state == IEEE80211_STA_AUTH) in sta_info_move_state()
2006 clear_bit(WLAN_STA_AUTH, &sta->_flags); in sta_info_move_state()
2009 if (sta->sta_state == IEEE80211_STA_NONE) { in sta_info_move_state()
2010 set_bit(WLAN_STA_AUTH, &sta->_flags); in sta_info_move_state()
2011 } else if (sta->sta_state == IEEE80211_STA_ASSOC) { in sta_info_move_state()
2012 clear_bit(WLAN_STA_ASSOC, &sta->_flags); in sta_info_move_state()
2013 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_move_state()
2014 if (!sta->sta.support_p2p_ps) in sta_info_move_state()
2015 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_move_state()
2019 if (sta->sta_state == IEEE80211_STA_AUTH) { in sta_info_move_state()
2020 set_bit(WLAN_STA_ASSOC, &sta->_flags); in sta_info_move_state()
2021 sta->assoc_at = ktime_get_boottime_ns(); in sta_info_move_state()
2022 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_move_state()
2023 if (!sta->sta.support_p2p_ps) in sta_info_move_state()
2024 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_move_state()
2025 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { in sta_info_move_state()
2026 ieee80211_vif_dec_num_mcast(sta->sdata); in sta_info_move_state()
2027 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); in sta_info_move_state()
2028 ieee80211_clear_fast_xmit(sta); in sta_info_move_state()
2029 ieee80211_clear_fast_rx(sta); in sta_info_move_state()
2033 if (sta->sta_state == IEEE80211_STA_ASSOC) { in sta_info_move_state()
2034 ieee80211_vif_inc_num_mcast(sta->sdata); in sta_info_move_state()
2035 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); in sta_info_move_state()
2036 ieee80211_check_fast_xmit(sta); in sta_info_move_state()
2037 ieee80211_check_fast_rx(sta); in sta_info_move_state()
2039 if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN || in sta_info_move_state()
2040 sta->sdata->vif.type == NL80211_IFTYPE_AP) in sta_info_move_state()
2041 cfg80211_send_layer2_update(sta->sdata->dev, in sta_info_move_state()
2042 sta->sta.addr); in sta_info_move_state()
2048 sta->sta_state = new_state; in sta_info_move_state()
2053 u8 sta_info_tx_streams(struct sta_info *sta) in sta_info_tx_streams() argument
2055 struct ieee80211_sta_ht_cap *ht_cap = &sta->sta.ht_cap; in sta_info_tx_streams()
2058 if (!sta->sta.ht_cap.ht_supported) in sta_info_tx_streams()
2061 if (sta->sta.vht_cap.vht_supported) { in sta_info_tx_streams()
2064 le16_to_cpu(sta->sta.vht_cap.vht_mcs.tx_mcs_map); in sta_info_tx_streams()
2089 sta_get_last_rx_stats(struct sta_info *sta) in sta_get_last_rx_stats() argument
2091 struct ieee80211_sta_rx_stats *stats = &sta->rx_stats; in sta_get_last_rx_stats()
2092 struct ieee80211_local *local = sta->local; in sta_get_last_rx_stats()
2101 cpustats = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_get_last_rx_stats()
2162 static int sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo) in sta_set_rate_info_rx() argument
2164 u16 rate = READ_ONCE(sta_get_last_rx_stats(sta)->last_rate); in sta_set_rate_info_rx()
2169 sta_stats_decode_rate(sta->local, rate, rinfo); in sta_set_rate_info_rx()
2187 static void sta_set_tidstats(struct sta_info *sta, in sta_set_tidstats() argument
2191 struct ieee80211_local *local = sta->local; in sta_set_tidstats()
2197 sta_get_tidstats_msdu(&sta->rx_stats, tid); in sta_set_tidstats()
2199 if (sta->pcpu_rx_stats) { in sta_set_tidstats()
2203 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_tidstats()
2214 tidstats->tx_msdu = sta->tx_stats.msdu[tid]; in sta_set_tidstats()
2220 tidstats->tx_msdu_retries = sta->status_stats.msdu_retries[tid]; in sta_set_tidstats()
2226 tidstats->tx_msdu_failed = sta->status_stats.msdu_failed[tid]; in sta_set_tidstats()
2235 to_txq_info(sta->sta.txq[tid])); in sta_set_tidstats()
2255 void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, in sta_set_sinfo() argument
2258 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_set_sinfo()
2264 last_rxstats = sta_get_last_rx_stats(sta); in sta_set_sinfo()
2275 drv_sta_statistics(local, sdata, &sta->sta, sinfo); in sta_set_sinfo()
2289 sinfo->connected_time = ktime_get_seconds() - sta->last_connected; in sta_set_sinfo()
2290 sinfo->assoc_at = sta->assoc_at; in sta_set_sinfo()
2292 jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta)); in sta_set_sinfo()
2298 sinfo->tx_bytes += sta->tx_stats.bytes[ac]; in sta_set_sinfo()
2305 sinfo->tx_packets += sta->tx_stats.packets[ac]; in sta_set_sinfo()
2312 sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats); in sta_set_sinfo()
2314 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2318 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2327 sinfo->rx_packets = sta->rx_stats.packets; in sta_set_sinfo()
2328 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2332 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2340 sinfo->tx_retries = sta->status_stats.retry_count; in sta_set_sinfo()
2345 sinfo->tx_failed = sta->status_stats.retry_failed; in sta_set_sinfo()
2351 sinfo->rx_duration += sta->airtime[ac].rx_airtime; in sta_set_sinfo()
2357 sinfo->tx_duration += sta->airtime[ac].tx_airtime; in sta_set_sinfo()
2362 sinfo->airtime_weight = sta->airtime_weight; in sta_set_sinfo()
2366 sinfo->rx_dropped_misc = sta->rx_stats.dropped; in sta_set_sinfo()
2367 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2371 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2383 if (ieee80211_hw_check(&sta->local->hw, SIGNAL_DBM) || in sta_set_sinfo()
2384 ieee80211_hw_check(&sta->local->hw, SIGNAL_UNSPEC)) { in sta_set_sinfo()
2390 if (!sta->pcpu_rx_stats && in sta_set_sinfo()
2393 -ewma_signal_read(&sta->rx_stats_avg.signal); in sta_set_sinfo()
2406 if (!sta->pcpu_rx_stats) in sta_set_sinfo()
2415 -ewma_signal_read(&sta->rx_stats_avg.chain_signal[i]); in sta_set_sinfo()
2420 sta_set_rate_info_tx(sta, &sta->tx_stats.last_rate, in sta_set_sinfo()
2426 if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0) in sta_set_sinfo()
2432 sta_set_tidstats(sta, &sinfo->pertid[i], i); in sta_set_sinfo()
2446 sinfo->llid = sta->mesh->llid; in sta_set_sinfo()
2447 sinfo->plid = sta->mesh->plid; in sta_set_sinfo()
2448 sinfo->plink_state = sta->mesh->plink_state; in sta_set_sinfo()
2449 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { in sta_set_sinfo()
2451 sinfo->t_offset = sta->mesh->t_offset; in sta_set_sinfo()
2453 sinfo->local_pm = sta->mesh->local_pm; in sta_set_sinfo()
2454 sinfo->peer_pm = sta->mesh->peer_pm; in sta_set_sinfo()
2455 sinfo->nonpeer_pm = sta->mesh->nonpeer_pm; in sta_set_sinfo()
2456 sinfo->connected_to_gate = sta->mesh->connected_to_gate; in sta_set_sinfo()
2457 sinfo->connected_to_as = sta->mesh->connected_to_as; in sta_set_sinfo()
2479 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) in sta_set_sinfo()
2481 if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE)) in sta_set_sinfo()
2483 if (sta->sta.wme) in sta_set_sinfo()
2485 if (test_sta_flag(sta, WLAN_STA_MFP)) in sta_set_sinfo()
2487 if (test_sta_flag(sta, WLAN_STA_AUTH)) in sta_set_sinfo()
2489 if (test_sta_flag(sta, WLAN_STA_ASSOC)) in sta_set_sinfo()
2491 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) in sta_set_sinfo()
2494 thr = sta_get_expected_throughput(sta); in sta_set_sinfo()
2502 sta->status_stats.ack_signal_filled) { in sta_set_sinfo()
2503 sinfo->ack_signal = sta->status_stats.last_ack_signal; in sta_set_sinfo()
2508 sta->status_stats.ack_signal_filled) { in sta_set_sinfo()
2511 &sta->status_stats.avg_ack_signal); in sta_set_sinfo()
2519 airtime_link_metric_get(local, sta); in sta_set_sinfo()
2523 u32 sta_get_expected_throughput(struct sta_info *sta) in sta_get_expected_throughput() argument
2525 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_get_expected_throughput()
2530 if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) in sta_get_expected_throughput()
2535 thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv); in sta_get_expected_throughput()
2537 thr = drv_get_expected_throughput(local, sta); in sta_get_expected_throughput()
2542 unsigned long ieee80211_sta_last_active(struct sta_info *sta) in ieee80211_sta_last_active() argument
2544 struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta); in ieee80211_sta_last_active()
2546 if (!sta->status_stats.last_ack || in ieee80211_sta_last_active()
2547 time_after(stats->last_rx, sta->status_stats.last_ack)) in ieee80211_sta_last_active()
2549 return sta->status_stats.last_ack; in ieee80211_sta_last_active()
2552 static void sta_update_codel_params(struct sta_info *sta, u32 thr) in sta_update_codel_params() argument
2554 if (!sta->sdata->local->ops->wake_tx_queue) in sta_update_codel_params()
2557 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) { in sta_update_codel_params()
2558 sta->cparams.target = MS2TIME(50); in sta_update_codel_params()
2559 sta->cparams.interval = MS2TIME(300); in sta_update_codel_params()
2560 sta->cparams.ecn = false; in sta_update_codel_params()
2562 sta->cparams.target = MS2TIME(20); in sta_update_codel_params()
2563 sta->cparams.interval = MS2TIME(100); in sta_update_codel_params()
2564 sta->cparams.ecn = true; in sta_update_codel_params()
2571 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_set_expected_throughput() local
2573 sta_update_codel_params(sta, thr); in ieee80211_sta_set_expected_throughput()