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 ieee80211_init_frag_cache(&sta->frags); in sta_info_alloc()
397 sta->sta_state = IEEE80211_STA_NONE; in sta_info_alloc()
400 sta->reserved_tid = IEEE80211_TID_UNRESERVED; in sta_info_alloc()
402 sta->last_connected = ktime_get_seconds(); in sta_info_alloc()
403 ewma_signal_init(&sta->rx_stats_avg.signal); in sta_info_alloc()
404 ewma_avg_signal_init(&sta->status_stats.avg_ack_signal); in sta_info_alloc()
405 for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++) in sta_info_alloc()
406 ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]); in sta_info_alloc()
413 txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); in sta_info_alloc()
417 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in sta_info_alloc()
421 ieee80211_txq_init(sdata, sta, txq, i); in sta_info_alloc()
425 if (sta_prepare_rate_control(local, sta, gfp)) in sta_info_alloc()
428 sta->airtime_weight = IEEE80211_DEFAULT_AIRTIME_WEIGHT; in sta_info_alloc()
431 skb_queue_head_init(&sta->ps_tx_buf[i]); in sta_info_alloc()
432 skb_queue_head_init(&sta->tx_filtered[i]); in sta_info_alloc()
433 sta->airtime[i].deficit = sta->airtime_weight; in sta_info_alloc()
434 atomic_set(&sta->airtime[i].aql_tx_pending, 0); in sta_info_alloc()
435 sta->airtime[i].aql_limit_low = local->aql_txq_limit_low[i]; in sta_info_alloc()
436 sta->airtime[i].aql_limit_high = local->aql_txq_limit_high[i]; in sta_info_alloc()
440 sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX); in sta_info_alloc()
479 sta->sta.supp_rates[i] |= BIT(r); in sta_info_alloc()
483 sta->sta.smps_mode = IEEE80211_SMPS_OFF; in sta_info_alloc()
501 sta->known_smps_mode = IEEE80211_SMPS_OFF; in sta_info_alloc()
504 sta->known_smps_mode = IEEE80211_SMPS_STATIC; in sta_info_alloc()
507 sta->known_smps_mode = IEEE80211_SMPS_DYNAMIC; in sta_info_alloc()
514 sta->sta.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; in sta_info_alloc()
516 sta->cparams.ce_threshold = CODEL_DISABLED_THRESHOLD; in sta_info_alloc()
517 sta->cparams.target = MS2TIME(20); in sta_info_alloc()
518 sta->cparams.interval = MS2TIME(100); in sta_info_alloc()
519 sta->cparams.ecn = true; in sta_info_alloc()
521 sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); in sta_info_alloc()
523 return sta; in sta_info_alloc()
526 if (sta->sta.txq[0]) in sta_info_alloc()
527 kfree(to_txq_info(sta->sta.txq[0])); in sta_info_alloc()
529 free_percpu(sta->pcpu_rx_stats); in sta_info_alloc()
531 kfree(sta->mesh); in sta_info_alloc()
533 kfree(sta); in sta_info_alloc()
537 static int sta_info_insert_check(struct sta_info *sta) in sta_info_insert_check() argument
539 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_info_insert_check()
549 if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) || in sta_info_insert_check()
550 is_multicast_ether_addr(sta->sta.addr))) in sta_info_insert_check()
560 ieee80211_find_sta_by_ifaddr(&sdata->local->hw, sta->addr, NULL)) { in sta_info_insert_check()
571 struct sta_info *sta) in sta_info_insert_drv_state() argument
576 for (state = IEEE80211_STA_NOTEXIST; state < sta->sta_state; state++) { in sta_info_insert_drv_state()
577 err = drv_sta_state(local, sdata, sta, state, state + 1); in sta_info_insert_drv_state()
588 sta->uploaded = true; in sta_info_insert_drv_state()
595 sta->sta.addr, state + 1, err); in sta_info_insert_drv_state()
601 WARN_ON(drv_sta_state(local, sdata, sta, state, state - 1)); in sta_info_insert_drv_state()
611 struct sta_info *sta; in ieee80211_recalc_p2p_go_ps_allowed() local
614 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_p2p_go_ps_allowed()
615 if (sdata != sta->sdata || in ieee80211_recalc_p2p_go_ps_allowed()
616 !test_sta_flag(sta, WLAN_STA_ASSOC)) in ieee80211_recalc_p2p_go_ps_allowed()
618 if (!sta->sta.support_p2p_ps) { in ieee80211_recalc_p2p_go_ps_allowed()
636 static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) in sta_info_insert_finish() argument
638 struct ieee80211_local *local = sta->local; in sta_info_insert_finish()
639 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_info_insert_finish()
646 if (sta_info_get_bss(sdata, sta->sta.addr)) { in sta_info_insert_finish()
662 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in sta_info_insert_finish()
665 err = sta_info_hash_add(local, sta); in sta_info_insert_finish()
669 list_add_tail_rcu(&sta->list, &local->sta_list); in sta_info_insert_finish()
672 err = sta_info_insert_drv_state(local, sdata, sta); in sta_info_insert_finish()
676 set_sta_flag(sta, WLAN_STA_INSERTED); in sta_info_insert_finish()
678 if (sta->sta_state >= IEEE80211_STA_ASSOC) { in sta_info_insert_finish()
679 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_insert_finish()
680 if (!sta->sta.support_p2p_ps) in sta_info_insert_finish()
681 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_insert_finish()
685 clear_sta_flag(sta, WLAN_STA_BLOCK_BA); in sta_info_insert_finish()
687 ieee80211_sta_debugfs_add(sta); in sta_info_insert_finish()
688 rate_control_add_sta_debugfs(sta); in sta_info_insert_finish()
691 cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); in sta_info_insert_finish()
694 sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); in sta_info_insert_finish()
705 sta_info_hash_del(local, sta); in sta_info_insert_finish()
706 list_del_rcu(&sta->list); in sta_info_insert_finish()
710 cleanup_single_sta(sta); in sta_info_insert_finish()
718 int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) in sta_info_insert_rcu() argument
720 struct ieee80211_local *local = sta->local; in sta_info_insert_rcu()
727 err = sta_info_insert_check(sta); in sta_info_insert_rcu()
729 sta_info_free(local, sta); in sta_info_insert_rcu()
735 return sta_info_insert_finish(sta); in sta_info_insert_rcu()
738 int sta_info_insert(struct sta_info *sta) in sta_info_insert() argument
740 int err = sta_info_insert_rcu(sta); in sta_info_insert()
792 static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending) in __sta_info_recalc_tim() argument
794 struct ieee80211_local *local = sta->local; in __sta_info_recalc_tim()
797 u8 ignore_for_tim = sta->sta.uapsd_queues; in __sta_info_recalc_tim()
799 u16 id = sta->sta.aid; in __sta_info_recalc_tim()
801 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || in __sta_info_recalc_tim()
802 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in __sta_info_recalc_tim()
803 if (WARN_ON_ONCE(!sta->sdata->bss)) in __sta_info_recalc_tim()
806 ps = &sta->sdata->bss->ps; in __sta_info_recalc_tim()
808 } else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) { in __sta_info_recalc_tim()
809 ps = &sta->sdata->u.mesh.ps; in __sta_info_recalc_tim()
819 if (sta->dead) in __sta_info_recalc_tim()
840 indicate_tim |= !skb_queue_empty(&sta->tx_filtered[ac]) || in __sta_info_recalc_tim()
841 !skb_queue_empty(&sta->ps_tx_buf[ac]); in __sta_info_recalc_tim()
848 sta->driver_buffered_tids & tids; in __sta_info_recalc_tim()
850 sta->txq_buffered_tids & tids; in __sta_info_recalc_tim()
864 if (local->ops->set_tim && !WARN_ON(sta->dead)) { in __sta_info_recalc_tim()
866 drv_set_tim(local, &sta->sta, indicate_tim); in __sta_info_recalc_tim()
874 void sta_info_recalc_tim(struct sta_info *sta) in sta_info_recalc_tim() argument
876 __sta_info_recalc_tim(sta, false); in sta_info_recalc_tim()
879 static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb) in sta_info_buffer_expired() argument
890 timeout = (sta->listen_interval * in sta_info_buffer_expired()
891 sta->sdata->vif.bss_conf.beacon_int * in sta_info_buffer_expired()
900 struct sta_info *sta, int ac) in sta_info_cleanup_expire_buffered_ac() argument
913 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
914 skb = skb_peek(&sta->tx_filtered[ac]); in sta_info_cleanup_expire_buffered_ac()
915 if (sta_info_buffer_expired(sta, skb)) in sta_info_cleanup_expire_buffered_ac()
916 skb = __skb_dequeue(&sta->tx_filtered[ac]); in sta_info_cleanup_expire_buffered_ac()
919 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
939 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
940 skb = skb_peek(&sta->ps_tx_buf[ac]); in sta_info_cleanup_expire_buffered_ac()
941 if (sta_info_buffer_expired(sta, skb)) in sta_info_cleanup_expire_buffered_ac()
942 skb = __skb_dequeue(&sta->ps_tx_buf[ac]); in sta_info_cleanup_expire_buffered_ac()
945 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
956 ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", in sta_info_cleanup_expire_buffered_ac()
957 sta->sta.addr); in sta_info_cleanup_expire_buffered_ac()
966 sta_info_recalc_tim(sta); in sta_info_cleanup_expire_buffered_ac()
973 return !(skb_queue_empty(&sta->ps_tx_buf[ac]) && in sta_info_cleanup_expire_buffered_ac()
974 skb_queue_empty(&sta->tx_filtered[ac])); in sta_info_cleanup_expire_buffered_ac()
978 struct sta_info *sta) in sta_info_cleanup_expire_buffered() argument
984 if (!sta->sdata->bss && in sta_info_cleanup_expire_buffered()
985 !ieee80211_vif_is_mesh(&sta->sdata->vif)) in sta_info_cleanup_expire_buffered()
990 sta_info_cleanup_expire_buffered_ac(local, sta, ac); in sta_info_cleanup_expire_buffered()
995 static int __must_check __sta_info_destroy_part1(struct sta_info *sta) in __sta_info_destroy_part1() argument
1003 if (!sta) in __sta_info_destroy_part1()
1006 local = sta->local; in __sta_info_destroy_part1()
1007 sdata = sta->sdata; in __sta_info_destroy_part1()
1017 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in __sta_info_destroy_part1()
1018 ieee80211_sta_tear_down_BA_sessions(sta, AGG_STOP_DESTROY_STA); in __sta_info_destroy_part1()
1025 drv_sync_rx_queues(local, sta); in __sta_info_destroy_part1()
1027 ret = sta_info_hash_del(local, sta); in __sta_info_destroy_part1()
1035 if (test_sta_flag(sta, WLAN_STA_TDLS_OFF_CHANNEL)) { in __sta_info_destroy_part1()
1036 drv_tdls_cancel_channel_switch(local, sdata, &sta->sta); in __sta_info_destroy_part1()
1037 clear_sta_flag(sta, WLAN_STA_TDLS_OFF_CHANNEL); in __sta_info_destroy_part1()
1040 list_del_rcu(&sta->list); in __sta_info_destroy_part1()
1041 sta->removed = true; in __sta_info_destroy_part1()
1043 drv_sta_pre_rcu_remove(local, sta->sdata, sta); in __sta_info_destroy_part1()
1046 rcu_access_pointer(sdata->u.vlan.sta) == sta) in __sta_info_destroy_part1()
1047 RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); in __sta_info_destroy_part1()
1052 static void __sta_info_destroy_part2(struct sta_info *sta) in __sta_info_destroy_part2() argument
1054 struct ieee80211_local *local = sta->local; in __sta_info_destroy_part2()
1055 struct ieee80211_sub_if_data *sdata = sta->sdata; in __sta_info_destroy_part2()
1067 if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { in __sta_info_destroy_part2()
1068 ret = sta_info_move_state(sta, IEEE80211_STA_ASSOC); in __sta_info_destroy_part2()
1073 ieee80211_free_sta_keys(local, sta); in __sta_info_destroy_part2()
1076 __sta_info_recalc_tim(sta, true); in __sta_info_destroy_part2()
1078 sta->dead = true; in __sta_info_destroy_part2()
1083 while (sta->sta_state > IEEE80211_STA_NONE) { in __sta_info_destroy_part2()
1084 ret = sta_info_move_state(sta, sta->sta_state - 1); in __sta_info_destroy_part2()
1091 if (sta->uploaded) { in __sta_info_destroy_part2()
1092 ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE, in __sta_info_destroy_part2()
1097 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); in __sta_info_destroy_part2()
1101 sta_set_sinfo(sta, sinfo, true); in __sta_info_destroy_part2()
1102 cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); in __sta_info_destroy_part2()
1105 ieee80211_sta_debugfs_remove(sta); in __sta_info_destroy_part2()
1107 ieee80211_destroy_frag_cache(&sta->frags); in __sta_info_destroy_part2()
1109 cleanup_single_sta(sta); in __sta_info_destroy_part2()
1112 int __must_check __sta_info_destroy(struct sta_info *sta) in __sta_info_destroy() argument
1114 int err = __sta_info_destroy_part1(sta); in __sta_info_destroy()
1121 __sta_info_destroy_part2(sta); in __sta_info_destroy()
1128 struct sta_info *sta; in sta_info_destroy_addr() local
1132 sta = sta_info_get(sdata, addr); in sta_info_destroy_addr()
1133 ret = __sta_info_destroy(sta); in sta_info_destroy_addr()
1142 struct sta_info *sta; in sta_info_destroy_addr_bss() local
1146 sta = sta_info_get_bss(sdata, addr); in sta_info_destroy_addr_bss()
1147 ret = __sta_info_destroy(sta); in sta_info_destroy_addr_bss()
1156 struct sta_info *sta; in sta_info_cleanup() local
1160 list_for_each_entry_rcu(sta, &local->sta_list, list) in sta_info_cleanup()
1161 if (sta_info_cleanup_expire_buffered(local, sta)) in sta_info_cleanup()
1201 struct sta_info *sta, *tmp; in __sta_info_flush() local
1211 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in __sta_info_flush()
1212 if (sdata == sta->sdata || in __sta_info_flush()
1213 (vlans && sdata->bss == sta->sdata->bss)) { in __sta_info_flush()
1214 if (!WARN_ON(__sta_info_destroy_part1(sta))) in __sta_info_flush()
1215 list_add(&sta->free_list, &free_list); in __sta_info_flush()
1222 list_for_each_entry_safe(sta, tmp, &free_list, free_list) in __sta_info_flush()
1223 __sta_info_destroy_part2(sta); in __sta_info_flush()
1234 struct sta_info *sta, *tmp; in ieee80211_sta_expire() local
1238 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in ieee80211_sta_expire()
1239 unsigned long last_active = ieee80211_sta_last_active(sta); in ieee80211_sta_expire()
1241 if (sdata != sta->sdata) in ieee80211_sta_expire()
1245 sta_dbg(sta->sdata, "expiring inactive STA %pM\n", in ieee80211_sta_expire()
1246 sta->sta.addr); in ieee80211_sta_expire()
1249 test_sta_flag(sta, WLAN_STA_PS_STA)) in ieee80211_sta_expire()
1252 WARN_ON(__sta_info_destroy(sta)); in ieee80211_sta_expire()
1265 struct sta_info *sta; in ieee80211_find_sta_by_ifaddr() local
1271 for_each_sta_info(local, addr, sta, tmp) { in ieee80211_find_sta_by_ifaddr()
1273 !ether_addr_equal(sta->sdata->vif.addr, localaddr)) in ieee80211_find_sta_by_ifaddr()
1275 if (!sta->uploaded) in ieee80211_find_sta_by_ifaddr()
1277 return &sta->sta; in ieee80211_find_sta_by_ifaddr()
1287 struct sta_info *sta; in ieee80211_find_sta() local
1292 sta = sta_info_get_bss(vif_to_sdata(vif), addr); in ieee80211_find_sta()
1293 if (!sta) in ieee80211_find_sta()
1296 if (!sta->uploaded) in ieee80211_find_sta()
1299 return &sta->sta; in ieee80211_find_sta()
1304 void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) in ieee80211_sta_ps_deliver_wakeup() argument
1306 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_deliver_wakeup()
1324 clear_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_ps_deliver_wakeup()
1327 sta->driver_buffered_tids = 0; in ieee80211_sta_ps_deliver_wakeup()
1328 sta->txq_buffered_tids = 0; in ieee80211_sta_ps_deliver_wakeup()
1331 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); in ieee80211_sta_ps_deliver_wakeup()
1333 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in ieee80211_sta_ps_deliver_wakeup()
1334 if (!sta->sta.txq[i] || !txq_has_queue(sta->sta.txq[i])) in ieee80211_sta_ps_deliver_wakeup()
1337 schedule_and_wake_txq(local, to_txq_info(sta->sta.txq[i])); in ieee80211_sta_ps_deliver_wakeup()
1343 spin_lock(&sta->ps_lock); in ieee80211_sta_ps_deliver_wakeup()
1348 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1349 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending); in ieee80211_sta_ps_deliver_wakeup()
1350 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1355 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1356 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); in ieee80211_sta_ps_deliver_wakeup()
1357 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1365 clear_sta_flag(sta, WLAN_STA_PS_DELIVER); in ieee80211_sta_ps_deliver_wakeup()
1370 clear_sta_flag(sta, WLAN_STA_PSPOLL); in ieee80211_sta_ps_deliver_wakeup()
1371 clear_sta_flag(sta, WLAN_STA_UAPSD); in ieee80211_sta_ps_deliver_wakeup()
1372 spin_unlock(&sta->ps_lock); in ieee80211_sta_ps_deliver_wakeup()
1378 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_wakeup()
1382 sta->sta.addr, sta->sta.aid, filtered, buffered); in ieee80211_sta_ps_deliver_wakeup()
1384 ieee80211_check_fast_xmit(sta); in ieee80211_sta_ps_deliver_wakeup()
1387 static void ieee80211_send_null_response(struct sta_info *sta, int tid, in ieee80211_send_null_response() argument
1391 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_send_null_response()
1397 bool qos = sta->sta.wme; in ieee80211_send_null_response()
1421 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in ieee80211_send_null_response()
1455 drv_allow_buffered_frames(local, sta, BIT(tid), 1, in ieee80211_send_null_response()
1469 ieee80211_xmit(sdata, sta, skb); in ieee80211_send_null_response()
1490 ieee80211_sta_ps_more_data(struct sta_info *sta, u8 ignored_acs, in ieee80211_sta_ps_more_data() argument
1509 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in ieee80211_sta_ps_more_data()
1510 !skb_queue_empty(&sta->ps_tx_buf[ac])) in ieee80211_sta_ps_more_data()
1518 ieee80211_sta_ps_get_frames(struct sta_info *sta, int n_frames, u8 ignored_acs, in ieee80211_sta_ps_get_frames() argument
1523 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_get_frames()
1541 sta->driver_buffered_tids & tids; in ieee80211_sta_ps_get_frames()
1542 *driver_release_tids |= sta->txq_buffered_tids & tids; in ieee80211_sta_ps_get_frames()
1549 skb = skb_dequeue(&sta->tx_filtered[ac]); in ieee80211_sta_ps_get_frames()
1552 &sta->ps_tx_buf[ac]); in ieee80211_sta_ps_get_frames()
1567 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in ieee80211_sta_ps_get_frames()
1568 !skb_queue_empty(&sta->ps_tx_buf[ac])) in ieee80211_sta_ps_get_frames()
1574 ieee80211_sta_ps_deliver_response(struct sta_info *sta, in ieee80211_sta_ps_deliver_response() argument
1578 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_deliver_response()
1585 set_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_ps_deliver_response()
1589 ieee80211_sta_ps_get_frames(sta, n_frames, ignored_acs, reason, in ieee80211_sta_ps_deliver_response()
1592 more_data = ieee80211_sta_ps_more_data(sta, ignored_acs, reason, driver_release_tids); in ieee80211_sta_ps_deliver_response()
1622 ieee80211_send_null_response(sta, tid, reason, true, false); in ieee80211_sta_ps_deliver_response()
1715 drv_allow_buffered_frames(local, sta, tids, num, in ieee80211_sta_ps_deliver_response()
1722 sta, find_highest_prio_tid(tids), in ieee80211_sta_ps_deliver_response()
1725 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_response()
1739 drv_release_buffered_frames(local, sta, driver_release_tids, in ieee80211_sta_ps_deliver_response()
1752 if (!sta->sta.txq[0]) in ieee80211_sta_ps_deliver_response()
1755 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { in ieee80211_sta_ps_deliver_response()
1756 if (!sta->sta.txq[tid] || in ieee80211_sta_ps_deliver_response()
1758 txq_has_queue(sta->sta.txq[tid])) in ieee80211_sta_ps_deliver_response()
1761 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_response()
1767 void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta) in ieee80211_sta_ps_deliver_poll_response() argument
1769 u8 ignore_for_response = sta->sta.uapsd_queues; in ieee80211_sta_ps_deliver_poll_response()
1779 ieee80211_sta_ps_deliver_response(sta, 1, ignore_for_response, in ieee80211_sta_ps_deliver_poll_response()
1783 void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta) in ieee80211_sta_ps_deliver_uapsd() argument
1785 int n_frames = sta->sta.max_sp; in ieee80211_sta_ps_deliver_uapsd()
1786 u8 delivery_enabled = sta->sta.uapsd_queues; in ieee80211_sta_ps_deliver_uapsd()
1797 switch (sta->sta.max_sp) { in ieee80211_sta_ps_deliver_uapsd()
1813 ieee80211_sta_ps_deliver_response(sta, n_frames, ~delivery_enabled, in ieee80211_sta_ps_deliver_uapsd()
1820 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_block_awake() local
1822 trace_api_sta_block_awake(sta->local, pubsta, block); in ieee80211_sta_block_awake()
1825 set_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1826 ieee80211_clear_fast_xmit(sta); in ieee80211_sta_block_awake()
1830 if (!test_sta_flag(sta, WLAN_STA_PS_DRIVER)) in ieee80211_sta_block_awake()
1833 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in ieee80211_sta_block_awake()
1834 set_sta_flag(sta, WLAN_STA_PS_DELIVER); in ieee80211_sta_block_awake()
1835 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1836 ieee80211_queue_work(hw, &sta->drv_deliver_wk); in ieee80211_sta_block_awake()
1837 } else if (test_sta_flag(sta, WLAN_STA_PSPOLL) || in ieee80211_sta_block_awake()
1838 test_sta_flag(sta, WLAN_STA_UAPSD)) { in ieee80211_sta_block_awake()
1840 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1841 ieee80211_queue_work(hw, &sta->drv_deliver_wk); in ieee80211_sta_block_awake()
1843 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1844 ieee80211_check_fast_xmit(sta); in ieee80211_sta_block_awake()
1851 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_eosp() local
1852 struct ieee80211_local *local = sta->local; in ieee80211_sta_eosp()
1856 clear_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_eosp()
1862 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_send_eosp_nullfunc() local
1866 trace_api_send_eosp_nullfunc(sta->local, pubsta, tid); in ieee80211_send_eosp_nullfunc()
1869 more_data = ieee80211_sta_ps_more_data(sta, ~sta->sta.uapsd_queues, in ieee80211_send_eosp_nullfunc()
1872 ieee80211_send_null_response(sta, tid, reason, false, more_data); in ieee80211_send_eosp_nullfunc()
1879 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_set_buffered() local
1884 trace_api_sta_set_buffered(sta->local, pubsta, tid, buffered); in ieee80211_sta_set_buffered()
1887 set_bit(tid, &sta->driver_buffered_tids); in ieee80211_sta_set_buffered()
1889 clear_bit(tid, &sta->driver_buffered_tids); in ieee80211_sta_set_buffered()
1891 sta_info_recalc_tim(sta); in ieee80211_sta_set_buffered()
1898 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_register_airtime() local
1899 struct ieee80211_local *local = sta->sdata->local; in ieee80211_sta_register_airtime()
1903 if (sta->local->airtime_flags & AIRTIME_USE_TX) in ieee80211_sta_register_airtime()
1905 if (sta->local->airtime_flags & AIRTIME_USE_RX) in ieee80211_sta_register_airtime()
1909 sta->airtime[ac].tx_airtime += tx_airtime; in ieee80211_sta_register_airtime()
1910 sta->airtime[ac].rx_airtime += rx_airtime; in ieee80211_sta_register_airtime()
1911 sta->airtime[ac].deficit -= airtime; in ieee80211_sta_register_airtime()
1917 struct sta_info *sta, u8 ac, in ieee80211_sta_update_pending_airtime() argument
1926 if (sta) in ieee80211_sta_update_pending_airtime()
1928 &sta->airtime[ac].aql_tx_pending); in ieee80211_sta_update_pending_airtime()
1934 if (sta) { in ieee80211_sta_update_pending_airtime()
1936 &sta->airtime[ac].aql_tx_pending); in ieee80211_sta_update_pending_airtime()
1938 atomic_cmpxchg(&sta->airtime[ac].aql_tx_pending, in ieee80211_sta_update_pending_airtime()
1952 int sta_info_move_state(struct sta_info *sta, in sta_info_move_state() argument
1957 if (sta->sta_state == new_state) in sta_info_move_state()
1964 if (sta->sta_state != IEEE80211_STA_AUTH) in sta_info_move_state()
1968 if (sta->sta_state != IEEE80211_STA_NONE && in sta_info_move_state()
1969 sta->sta_state != IEEE80211_STA_ASSOC) in sta_info_move_state()
1973 if (sta->sta_state != IEEE80211_STA_AUTH && in sta_info_move_state()
1974 sta->sta_state != IEEE80211_STA_AUTHORIZED) in sta_info_move_state()
1978 if (sta->sta_state != IEEE80211_STA_ASSOC) in sta_info_move_state()
1986 sta_dbg(sta->sdata, "moving STA %pM to state %d\n", in sta_info_move_state()
1987 sta->sta.addr, new_state); in sta_info_move_state()
1993 if (test_sta_flag(sta, WLAN_STA_INSERTED)) { in sta_info_move_state()
1994 int err = drv_sta_state(sta->local, sta->sdata, sta, in sta_info_move_state()
1995 sta->sta_state, new_state); in sta_info_move_state()
2004 if (sta->sta_state == IEEE80211_STA_AUTH) in sta_info_move_state()
2005 clear_bit(WLAN_STA_AUTH, &sta->_flags); in sta_info_move_state()
2008 if (sta->sta_state == IEEE80211_STA_NONE) { in sta_info_move_state()
2009 set_bit(WLAN_STA_AUTH, &sta->_flags); in sta_info_move_state()
2010 } else if (sta->sta_state == IEEE80211_STA_ASSOC) { in sta_info_move_state()
2011 clear_bit(WLAN_STA_ASSOC, &sta->_flags); in sta_info_move_state()
2012 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_move_state()
2013 if (!sta->sta.support_p2p_ps) in sta_info_move_state()
2014 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_move_state()
2018 if (sta->sta_state == IEEE80211_STA_AUTH) { in sta_info_move_state()
2019 set_bit(WLAN_STA_ASSOC, &sta->_flags); in sta_info_move_state()
2020 sta->assoc_at = ktime_get_boottime_ns(); in sta_info_move_state()
2021 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_move_state()
2022 if (!sta->sta.support_p2p_ps) in sta_info_move_state()
2023 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_move_state()
2024 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { in sta_info_move_state()
2025 ieee80211_vif_dec_num_mcast(sta->sdata); in sta_info_move_state()
2026 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); in sta_info_move_state()
2027 ieee80211_clear_fast_xmit(sta); in sta_info_move_state()
2028 ieee80211_clear_fast_rx(sta); in sta_info_move_state()
2032 if (sta->sta_state == IEEE80211_STA_ASSOC) { in sta_info_move_state()
2033 ieee80211_vif_inc_num_mcast(sta->sdata); in sta_info_move_state()
2034 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); in sta_info_move_state()
2035 ieee80211_check_fast_xmit(sta); in sta_info_move_state()
2036 ieee80211_check_fast_rx(sta); in sta_info_move_state()
2038 if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN || in sta_info_move_state()
2039 sta->sdata->vif.type == NL80211_IFTYPE_AP) in sta_info_move_state()
2040 cfg80211_send_layer2_update(sta->sdata->dev, in sta_info_move_state()
2041 sta->sta.addr); in sta_info_move_state()
2047 sta->sta_state = new_state; in sta_info_move_state()
2052 u8 sta_info_tx_streams(struct sta_info *sta) in sta_info_tx_streams() argument
2054 struct ieee80211_sta_ht_cap *ht_cap = &sta->sta.ht_cap; in sta_info_tx_streams()
2057 if (!sta->sta.ht_cap.ht_supported) in sta_info_tx_streams()
2060 if (sta->sta.vht_cap.vht_supported) { in sta_info_tx_streams()
2063 le16_to_cpu(sta->sta.vht_cap.vht_mcs.tx_mcs_map); in sta_info_tx_streams()
2088 sta_get_last_rx_stats(struct sta_info *sta) in sta_get_last_rx_stats() argument
2090 struct ieee80211_sta_rx_stats *stats = &sta->rx_stats; in sta_get_last_rx_stats()
2093 if (!sta->pcpu_rx_stats) in sta_get_last_rx_stats()
2099 cpustats = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_get_last_rx_stats()
2160 static int sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo) in sta_set_rate_info_rx() argument
2162 u16 rate = READ_ONCE(sta_get_last_rx_stats(sta)->last_rate); in sta_set_rate_info_rx()
2167 sta_stats_decode_rate(sta->local, rate, rinfo); in sta_set_rate_info_rx()
2185 static void sta_set_tidstats(struct sta_info *sta, in sta_set_tidstats() argument
2189 struct ieee80211_local *local = sta->local; in sta_set_tidstats()
2193 tidstats->rx_msdu += sta_get_tidstats_msdu(&sta->rx_stats, tid); in sta_set_tidstats()
2195 if (sta->pcpu_rx_stats) { in sta_set_tidstats()
2199 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_tidstats()
2210 tidstats->tx_msdu = sta->tx_stats.msdu[tid]; in sta_set_tidstats()
2216 tidstats->tx_msdu_retries = sta->status_stats.msdu_retries[tid]; in sta_set_tidstats()
2222 tidstats->tx_msdu_failed = sta->status_stats.msdu_failed[tid]; in sta_set_tidstats()
2231 to_txq_info(sta->sta.txq[tid])); in sta_set_tidstats()
2251 void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, in sta_set_sinfo() argument
2254 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_set_sinfo()
2260 last_rxstats = sta_get_last_rx_stats(sta); in sta_set_sinfo()
2271 drv_sta_statistics(local, sdata, &sta->sta, sinfo); in sta_set_sinfo()
2284 sinfo->connected_time = ktime_get_seconds() - sta->last_connected; in sta_set_sinfo()
2285 sinfo->assoc_at = sta->assoc_at; in sta_set_sinfo()
2287 jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta)); in sta_set_sinfo()
2293 sinfo->tx_bytes += sta->tx_stats.bytes[ac]; in sta_set_sinfo()
2300 sinfo->tx_packets += sta->tx_stats.packets[ac]; in sta_set_sinfo()
2306 sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats); in sta_set_sinfo()
2308 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2312 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2321 sinfo->rx_packets = sta->rx_stats.packets; in sta_set_sinfo()
2322 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2326 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2334 sinfo->tx_retries = sta->status_stats.retry_count; in sta_set_sinfo()
2339 sinfo->tx_failed = sta->status_stats.retry_failed; in sta_set_sinfo()
2345 sinfo->rx_duration += sta->airtime[ac].rx_airtime; in sta_set_sinfo()
2351 sinfo->tx_duration += sta->airtime[ac].tx_airtime; in sta_set_sinfo()
2356 sinfo->airtime_weight = sta->airtime_weight; in sta_set_sinfo()
2360 sinfo->rx_dropped_misc = sta->rx_stats.dropped; in sta_set_sinfo()
2361 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2365 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2377 if (ieee80211_hw_check(&sta->local->hw, SIGNAL_DBM) || in sta_set_sinfo()
2378 ieee80211_hw_check(&sta->local->hw, SIGNAL_UNSPEC)) { in sta_set_sinfo()
2384 if (!sta->pcpu_rx_stats && in sta_set_sinfo()
2387 -ewma_signal_read(&sta->rx_stats_avg.signal); in sta_set_sinfo()
2400 if (!sta->pcpu_rx_stats) in sta_set_sinfo()
2409 -ewma_signal_read(&sta->rx_stats_avg.chain_signal[i]); in sta_set_sinfo()
2414 sta_set_rate_info_tx(sta, &sta->tx_stats.last_rate, in sta_set_sinfo()
2420 if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0) in sta_set_sinfo()
2426 sta_set_tidstats(sta, &sinfo->pertid[i], i); in sta_set_sinfo()
2440 sinfo->llid = sta->mesh->llid; in sta_set_sinfo()
2441 sinfo->plid = sta->mesh->plid; in sta_set_sinfo()
2442 sinfo->plink_state = sta->mesh->plink_state; in sta_set_sinfo()
2443 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { in sta_set_sinfo()
2445 sinfo->t_offset = sta->mesh->t_offset; in sta_set_sinfo()
2447 sinfo->local_pm = sta->mesh->local_pm; in sta_set_sinfo()
2448 sinfo->peer_pm = sta->mesh->peer_pm; in sta_set_sinfo()
2449 sinfo->nonpeer_pm = sta->mesh->nonpeer_pm; in sta_set_sinfo()
2450 sinfo->connected_to_gate = sta->mesh->connected_to_gate; in sta_set_sinfo()
2451 sinfo->connected_to_as = sta->mesh->connected_to_as; in sta_set_sinfo()
2473 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) in sta_set_sinfo()
2475 if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE)) in sta_set_sinfo()
2477 if (sta->sta.wme) in sta_set_sinfo()
2479 if (test_sta_flag(sta, WLAN_STA_MFP)) in sta_set_sinfo()
2481 if (test_sta_flag(sta, WLAN_STA_AUTH)) in sta_set_sinfo()
2483 if (test_sta_flag(sta, WLAN_STA_ASSOC)) in sta_set_sinfo()
2485 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) in sta_set_sinfo()
2488 thr = sta_get_expected_throughput(sta); in sta_set_sinfo()
2496 sta->status_stats.ack_signal_filled) { in sta_set_sinfo()
2497 sinfo->ack_signal = sta->status_stats.last_ack_signal; in sta_set_sinfo()
2502 sta->status_stats.ack_signal_filled) { in sta_set_sinfo()
2505 &sta->status_stats.avg_ack_signal); in sta_set_sinfo()
2513 airtime_link_metric_get(local, sta); in sta_set_sinfo()
2517 u32 sta_get_expected_throughput(struct sta_info *sta) in sta_get_expected_throughput() argument
2519 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_get_expected_throughput()
2524 if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) in sta_get_expected_throughput()
2529 thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv); in sta_get_expected_throughput()
2531 thr = drv_get_expected_throughput(local, sta); in sta_get_expected_throughput()
2536 unsigned long ieee80211_sta_last_active(struct sta_info *sta) in ieee80211_sta_last_active() argument
2538 struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta); in ieee80211_sta_last_active()
2540 if (!sta->status_stats.last_ack || in ieee80211_sta_last_active()
2541 time_after(stats->last_rx, sta->status_stats.last_ack)) in ieee80211_sta_last_active()
2543 return sta->status_stats.last_ack; in ieee80211_sta_last_active()
2546 static void sta_update_codel_params(struct sta_info *sta, u32 thr) in sta_update_codel_params() argument
2548 if (!sta->sdata->local->ops->wake_tx_queue) in sta_update_codel_params()
2551 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) { in sta_update_codel_params()
2552 sta->cparams.target = MS2TIME(50); in sta_update_codel_params()
2553 sta->cparams.interval = MS2TIME(300); in sta_update_codel_params()
2554 sta->cparams.ecn = false; in sta_update_codel_params()
2556 sta->cparams.target = MS2TIME(20); in sta_update_codel_params()
2557 sta->cparams.interval = MS2TIME(100); in sta_update_codel_params()
2558 sta->cparams.ecn = true; in sta_update_codel_params()
2565 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_set_expected_throughput() local
2567 sta_update_codel_params(sta, thr); in ieee80211_sta_set_expected_throughput()