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_idx() local
220 list_for_each_entry_rcu(sta, &local->sta_list, list) { in sta_info_get_by_idx()
221 if (sdata != sta->sdata) in sta_info_get_by_idx()
227 return sta; in sta_info_get_by_idx()
244 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta) in sta_info_free() argument
246 if (sta->rate_ctrl) in sta_info_free()
247 rate_control_free_sta(sta); in sta_info_free()
249 sta_dbg(sta->sdata, "Destroyed STA %pM\n", sta->sta.addr); in sta_info_free()
251 if (sta->sta.txq[0]) in sta_info_free()
252 kfree(to_txq_info(sta->sta.txq[0])); in sta_info_free()
253 kfree(rcu_dereference_raw(sta->sta.rates)); in sta_info_free()
255 kfree(sta->mesh); in sta_info_free()
257 free_percpu(sta->pcpu_rx_stats); in sta_info_free()
258 kfree(sta); in sta_info_free()
263 struct sta_info *sta) in sta_info_hash_add() argument
265 return rhltable_insert(&local->sta_hash, &sta->hash_node, in sta_info_hash_add()
271 struct sta_info *sta; in sta_deliver_ps_frames() local
273 sta = container_of(wk, struct sta_info, drv_deliver_wk); in sta_deliver_ps_frames()
275 if (sta->dead) in sta_deliver_ps_frames()
279 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) in sta_deliver_ps_frames()
280 ieee80211_sta_ps_deliver_wakeup(sta); in sta_deliver_ps_frames()
281 else if (test_and_clear_sta_flag(sta, WLAN_STA_PSPOLL)) in sta_deliver_ps_frames()
282 ieee80211_sta_ps_deliver_poll_response(sta); in sta_deliver_ps_frames()
283 else if (test_and_clear_sta_flag(sta, WLAN_STA_UAPSD)) in sta_deliver_ps_frames()
284 ieee80211_sta_ps_deliver_uapsd(sta); in sta_deliver_ps_frames()
289 struct sta_info *sta, gfp_t gfp) in sta_prepare_rate_control() argument
294 sta->rate_ctrl = local->rate_ctrl; in sta_prepare_rate_control()
295 sta->rate_ctrl_priv = rate_control_alloc_sta(sta->rate_ctrl, in sta_prepare_rate_control()
296 sta, gfp); in sta_prepare_rate_control()
297 if (!sta->rate_ctrl_priv) in sta_prepare_rate_control()
308 struct sta_info *sta; in sta_info_alloc() local
311 sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp); in sta_info_alloc()
312 if (!sta) in sta_info_alloc()
316 sta->pcpu_rx_stats = in sta_info_alloc()
318 if (!sta->pcpu_rx_stats) in sta_info_alloc()
322 spin_lock_init(&sta->lock); in sta_info_alloc()
323 spin_lock_init(&sta->ps_lock); in sta_info_alloc()
324 INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames); in sta_info_alloc()
325 INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work); in sta_info_alloc()
326 mutex_init(&sta->ampdu_mlme.mtx); in sta_info_alloc()
329 sta->mesh = kzalloc(sizeof(*sta->mesh), gfp); in sta_info_alloc()
330 if (!sta->mesh) in sta_info_alloc()
332 sta->mesh->plink_sta = sta; in sta_info_alloc()
333 spin_lock_init(&sta->mesh->plink_lock); in sta_info_alloc()
336 timer_setup(&sta->mesh->plink_timer, mesh_plink_timer, in sta_info_alloc()
338 sta->mesh->nonpeer_pm = NL80211_MESH_POWER_ACTIVE; in sta_info_alloc()
342 memcpy(sta->addr, addr, ETH_ALEN); in sta_info_alloc()
343 memcpy(sta->sta.addr, addr, ETH_ALEN); in sta_info_alloc()
344 sta->sta.max_rx_aggregation_subframes = in sta_info_alloc()
353 BUILD_BUG_ON(ARRAY_SIZE(sta->ptk) <= INVALID_PTK_KEYIDX); in sta_info_alloc()
354 sta->ptk_idx = INVALID_PTK_KEYIDX; in sta_info_alloc()
356 sta->local = local; in sta_info_alloc()
357 sta->sdata = sdata; in sta_info_alloc()
358 sta->rx_stats.last_rx = jiffies; in sta_info_alloc()
360 u64_stats_init(&sta->rx_stats.syncp); in sta_info_alloc()
362 sta->sta_state = IEEE80211_STA_NONE; in sta_info_alloc()
365 sta->reserved_tid = IEEE80211_TID_UNRESERVED; in sta_info_alloc()
367 sta->last_connected = ktime_get_seconds(); in sta_info_alloc()
368 ewma_signal_init(&sta->rx_stats_avg.signal); in sta_info_alloc()
369 ewma_avg_signal_init(&sta->status_stats.avg_ack_signal); in sta_info_alloc()
370 for (i = 0; i < ARRAY_SIZE(sta->rx_stats_avg.chain_signal); i++) in sta_info_alloc()
371 ewma_signal_init(&sta->rx_stats_avg.chain_signal[i]); in sta_info_alloc()
378 txq_data = kcalloc(ARRAY_SIZE(sta->sta.txq), size, gfp); in sta_info_alloc()
382 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in sta_info_alloc()
386 ieee80211_txq_init(sdata, sta, txq, i); in sta_info_alloc()
390 if (sta_prepare_rate_control(local, sta, gfp)) in sta_info_alloc()
393 sta->airtime_weight = IEEE80211_DEFAULT_AIRTIME_WEIGHT; in sta_info_alloc()
396 skb_queue_head_init(&sta->ps_tx_buf[i]); in sta_info_alloc()
397 skb_queue_head_init(&sta->tx_filtered[i]); in sta_info_alloc()
398 sta->airtime[i].deficit = sta->airtime_weight; in sta_info_alloc()
402 sta->last_seq_ctrl[i] = cpu_to_le16(USHRT_MAX); in sta_info_alloc()
441 sta->sta.supp_rates[i] |= BIT(r); in sta_info_alloc()
445 sta->sta.smps_mode = IEEE80211_SMPS_OFF; in sta_info_alloc()
463 sta->known_smps_mode = IEEE80211_SMPS_OFF; in sta_info_alloc()
466 sta->known_smps_mode = IEEE80211_SMPS_STATIC; in sta_info_alloc()
469 sta->known_smps_mode = IEEE80211_SMPS_DYNAMIC; in sta_info_alloc()
476 sta->sta.max_rc_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_BA; in sta_info_alloc()
478 sta->cparams.ce_threshold = CODEL_DISABLED_THRESHOLD; in sta_info_alloc()
479 sta->cparams.target = MS2TIME(20); in sta_info_alloc()
480 sta->cparams.interval = MS2TIME(100); in sta_info_alloc()
481 sta->cparams.ecn = true; in sta_info_alloc()
483 sta_dbg(sdata, "Allocated STA %pM\n", sta->sta.addr); in sta_info_alloc()
485 return sta; in sta_info_alloc()
488 if (sta->sta.txq[0]) in sta_info_alloc()
489 kfree(to_txq_info(sta->sta.txq[0])); in sta_info_alloc()
491 free_percpu(sta->pcpu_rx_stats); in sta_info_alloc()
493 kfree(sta->mesh); in sta_info_alloc()
495 kfree(sta); in sta_info_alloc()
499 static int sta_info_insert_check(struct sta_info *sta) in sta_info_insert_check() argument
501 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_info_insert_check()
511 if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) || in sta_info_insert_check()
512 is_multicast_ether_addr(sta->sta.addr))) in sta_info_insert_check()
522 ieee80211_find_sta_by_ifaddr(&sdata->local->hw, sta->addr, NULL)) { in sta_info_insert_check()
533 struct sta_info *sta) in sta_info_insert_drv_state() argument
538 for (state = IEEE80211_STA_NOTEXIST; state < sta->sta_state; state++) { in sta_info_insert_drv_state()
539 err = drv_sta_state(local, sdata, sta, state, state + 1); in sta_info_insert_drv_state()
550 sta->uploaded = true; in sta_info_insert_drv_state()
557 sta->sta.addr, state + 1, err); in sta_info_insert_drv_state()
563 WARN_ON(drv_sta_state(local, sdata, sta, state, state - 1)); in sta_info_insert_drv_state()
573 struct sta_info *sta; in ieee80211_recalc_p2p_go_ps_allowed() local
576 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_p2p_go_ps_allowed()
577 if (sdata != sta->sdata || in ieee80211_recalc_p2p_go_ps_allowed()
578 !test_sta_flag(sta, WLAN_STA_ASSOC)) in ieee80211_recalc_p2p_go_ps_allowed()
580 if (!sta->sta.support_p2p_ps) { in ieee80211_recalc_p2p_go_ps_allowed()
598 static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) in sta_info_insert_finish() argument
600 struct ieee80211_local *local = sta->local; in sta_info_insert_finish()
601 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_info_insert_finish()
608 if (sta_info_get_bss(sdata, sta->sta.addr)) { in sta_info_insert_finish()
624 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in sta_info_insert_finish()
627 err = sta_info_hash_add(local, sta); in sta_info_insert_finish()
631 list_add_tail_rcu(&sta->list, &local->sta_list); in sta_info_insert_finish()
634 err = sta_info_insert_drv_state(local, sdata, sta); in sta_info_insert_finish()
638 set_sta_flag(sta, WLAN_STA_INSERTED); in sta_info_insert_finish()
640 if (sta->sta_state >= IEEE80211_STA_ASSOC) { in sta_info_insert_finish()
641 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_insert_finish()
642 if (!sta->sta.support_p2p_ps) in sta_info_insert_finish()
643 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_insert_finish()
647 clear_sta_flag(sta, WLAN_STA_BLOCK_BA); in sta_info_insert_finish()
649 ieee80211_sta_debugfs_add(sta); in sta_info_insert_finish()
650 rate_control_add_sta_debugfs(sta); in sta_info_insert_finish()
653 cfg80211_new_sta(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); in sta_info_insert_finish()
656 sta_dbg(sdata, "Inserted STA %pM\n", sta->sta.addr); in sta_info_insert_finish()
667 sta_info_hash_del(local, sta); in sta_info_insert_finish()
668 list_del_rcu(&sta->list); in sta_info_insert_finish()
672 __cleanup_single_sta(sta); in sta_info_insert_finish()
680 int sta_info_insert_rcu(struct sta_info *sta) __acquires(RCU) in sta_info_insert_rcu() argument
682 struct ieee80211_local *local = sta->local; in sta_info_insert_rcu()
689 err = sta_info_insert_check(sta); in sta_info_insert_rcu()
696 err = sta_info_insert_finish(sta); in sta_info_insert_rcu()
702 sta_info_free(local, sta); in sta_info_insert_rcu()
706 int sta_info_insert(struct sta_info *sta) in sta_info_insert() argument
708 int err = sta_info_insert_rcu(sta); in sta_info_insert()
760 static void __sta_info_recalc_tim(struct sta_info *sta, bool ignore_pending) in __sta_info_recalc_tim() argument
762 struct ieee80211_local *local = sta->local; in __sta_info_recalc_tim()
765 u8 ignore_for_tim = sta->sta.uapsd_queues; in __sta_info_recalc_tim()
767 u16 id = sta->sta.aid; in __sta_info_recalc_tim()
769 if (sta->sdata->vif.type == NL80211_IFTYPE_AP || in __sta_info_recalc_tim()
770 sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in __sta_info_recalc_tim()
771 if (WARN_ON_ONCE(!sta->sdata->bss)) in __sta_info_recalc_tim()
774 ps = &sta->sdata->bss->ps; in __sta_info_recalc_tim()
776 } else if (ieee80211_vif_is_mesh(&sta->sdata->vif)) { in __sta_info_recalc_tim()
777 ps = &sta->sdata->u.mesh.ps; in __sta_info_recalc_tim()
787 if (sta->dead) in __sta_info_recalc_tim()
808 indicate_tim |= !skb_queue_empty(&sta->tx_filtered[ac]) || in __sta_info_recalc_tim()
809 !skb_queue_empty(&sta->ps_tx_buf[ac]); in __sta_info_recalc_tim()
816 sta->driver_buffered_tids & tids; in __sta_info_recalc_tim()
818 sta->txq_buffered_tids & tids; in __sta_info_recalc_tim()
832 if (local->ops->set_tim && !WARN_ON(sta->dead)) { in __sta_info_recalc_tim()
834 drv_set_tim(local, &sta->sta, indicate_tim); in __sta_info_recalc_tim()
842 void sta_info_recalc_tim(struct sta_info *sta) in sta_info_recalc_tim() argument
844 __sta_info_recalc_tim(sta, false); in sta_info_recalc_tim()
847 static bool sta_info_buffer_expired(struct sta_info *sta, struct sk_buff *skb) in sta_info_buffer_expired() argument
858 timeout = (sta->listen_interval * in sta_info_buffer_expired()
859 sta->sdata->vif.bss_conf.beacon_int * in sta_info_buffer_expired()
868 struct sta_info *sta, int ac) in sta_info_cleanup_expire_buffered_ac() argument
881 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
882 skb = skb_peek(&sta->tx_filtered[ac]); in sta_info_cleanup_expire_buffered_ac()
883 if (sta_info_buffer_expired(sta, skb)) in sta_info_cleanup_expire_buffered_ac()
884 skb = __skb_dequeue(&sta->tx_filtered[ac]); in sta_info_cleanup_expire_buffered_ac()
887 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
907 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
908 skb = skb_peek(&sta->ps_tx_buf[ac]); in sta_info_cleanup_expire_buffered_ac()
909 if (sta_info_buffer_expired(sta, skb)) in sta_info_cleanup_expire_buffered_ac()
910 skb = __skb_dequeue(&sta->ps_tx_buf[ac]); in sta_info_cleanup_expire_buffered_ac()
913 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); in sta_info_cleanup_expire_buffered_ac()
924 ps_dbg(sta->sdata, "Buffered frame expired (STA %pM)\n", in sta_info_cleanup_expire_buffered_ac()
925 sta->sta.addr); in sta_info_cleanup_expire_buffered_ac()
934 sta_info_recalc_tim(sta); in sta_info_cleanup_expire_buffered_ac()
941 return !(skb_queue_empty(&sta->ps_tx_buf[ac]) && in sta_info_cleanup_expire_buffered_ac()
942 skb_queue_empty(&sta->tx_filtered[ac])); in sta_info_cleanup_expire_buffered_ac()
946 struct sta_info *sta) in sta_info_cleanup_expire_buffered() argument
952 if (!sta->sdata->bss && in sta_info_cleanup_expire_buffered()
953 !ieee80211_vif_is_mesh(&sta->sdata->vif)) in sta_info_cleanup_expire_buffered()
958 sta_info_cleanup_expire_buffered_ac(local, sta, ac); in sta_info_cleanup_expire_buffered()
963 static int __must_check __sta_info_destroy_part1(struct sta_info *sta) in __sta_info_destroy_part1() argument
971 if (!sta) in __sta_info_destroy_part1()
974 local = sta->local; in __sta_info_destroy_part1()
975 sdata = sta->sdata; in __sta_info_destroy_part1()
985 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in __sta_info_destroy_part1()
986 ieee80211_sta_tear_down_BA_sessions(sta, AGG_STOP_DESTROY_STA); in __sta_info_destroy_part1()
993 drv_sync_rx_queues(local, sta); in __sta_info_destroy_part1()
995 ret = sta_info_hash_del(local, sta); in __sta_info_destroy_part1()
1003 if (test_sta_flag(sta, WLAN_STA_TDLS_OFF_CHANNEL)) { in __sta_info_destroy_part1()
1004 drv_tdls_cancel_channel_switch(local, sdata, &sta->sta); in __sta_info_destroy_part1()
1005 clear_sta_flag(sta, WLAN_STA_TDLS_OFF_CHANNEL); in __sta_info_destroy_part1()
1008 list_del_rcu(&sta->list); in __sta_info_destroy_part1()
1009 sta->removed = true; in __sta_info_destroy_part1()
1011 drv_sta_pre_rcu_remove(local, sta->sdata, sta); in __sta_info_destroy_part1()
1014 rcu_access_pointer(sdata->u.vlan.sta) == sta) in __sta_info_destroy_part1()
1015 RCU_INIT_POINTER(sdata->u.vlan.sta, NULL); in __sta_info_destroy_part1()
1020 static void __sta_info_destroy_part2(struct sta_info *sta) in __sta_info_destroy_part2() argument
1022 struct ieee80211_local *local = sta->local; in __sta_info_destroy_part2()
1023 struct ieee80211_sub_if_data *sdata = sta->sdata; in __sta_info_destroy_part2()
1036 ieee80211_free_sta_keys(local, sta); in __sta_info_destroy_part2()
1039 __sta_info_recalc_tim(sta, true); in __sta_info_destroy_part2()
1041 sta->dead = true; in __sta_info_destroy_part2()
1046 while (sta->sta_state > IEEE80211_STA_NONE) { in __sta_info_destroy_part2()
1047 ret = sta_info_move_state(sta, sta->sta_state - 1); in __sta_info_destroy_part2()
1054 if (sta->uploaded) { in __sta_info_destroy_part2()
1055 ret = drv_sta_state(local, sdata, sta, IEEE80211_STA_NONE, in __sta_info_destroy_part2()
1060 sta_dbg(sdata, "Removed STA %pM\n", sta->sta.addr); in __sta_info_destroy_part2()
1064 sta_set_sinfo(sta, sinfo, true); in __sta_info_destroy_part2()
1065 cfg80211_del_sta_sinfo(sdata->dev, sta->sta.addr, sinfo, GFP_KERNEL); in __sta_info_destroy_part2()
1068 ieee80211_sta_debugfs_remove(sta); in __sta_info_destroy_part2()
1070 cleanup_single_sta(sta); in __sta_info_destroy_part2()
1073 int __must_check __sta_info_destroy(struct sta_info *sta) in __sta_info_destroy() argument
1075 int err = __sta_info_destroy_part1(sta); in __sta_info_destroy()
1082 __sta_info_destroy_part2(sta); in __sta_info_destroy()
1089 struct sta_info *sta; in sta_info_destroy_addr() local
1093 sta = sta_info_get(sdata, addr); in sta_info_destroy_addr()
1094 ret = __sta_info_destroy(sta); in sta_info_destroy_addr()
1103 struct sta_info *sta; in sta_info_destroy_addr_bss() local
1107 sta = sta_info_get_bss(sdata, addr); in sta_info_destroy_addr_bss()
1108 ret = __sta_info_destroy(sta); in sta_info_destroy_addr_bss()
1117 struct sta_info *sta; in sta_info_cleanup() local
1121 list_for_each_entry_rcu(sta, &local->sta_list, list) in sta_info_cleanup()
1122 if (sta_info_cleanup_expire_buffered(local, sta)) in sta_info_cleanup()
1162 struct sta_info *sta, *tmp; in __sta_info_flush() local
1172 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in __sta_info_flush()
1173 if (sdata == sta->sdata || in __sta_info_flush()
1174 (vlans && sdata->bss == sta->sdata->bss)) { in __sta_info_flush()
1175 if (!WARN_ON(__sta_info_destroy_part1(sta))) in __sta_info_flush()
1176 list_add(&sta->free_list, &free_list); in __sta_info_flush()
1183 list_for_each_entry_safe(sta, tmp, &free_list, free_list) in __sta_info_flush()
1184 __sta_info_destroy_part2(sta); in __sta_info_flush()
1195 struct sta_info *sta, *tmp; in ieee80211_sta_expire() local
1199 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) { in ieee80211_sta_expire()
1200 unsigned long last_active = ieee80211_sta_last_active(sta); in ieee80211_sta_expire()
1202 if (sdata != sta->sdata) in ieee80211_sta_expire()
1206 sta_dbg(sta->sdata, "expiring inactive STA %pM\n", in ieee80211_sta_expire()
1207 sta->sta.addr); in ieee80211_sta_expire()
1210 test_sta_flag(sta, WLAN_STA_PS_STA)) in ieee80211_sta_expire()
1213 WARN_ON(__sta_info_destroy(sta)); in ieee80211_sta_expire()
1226 struct sta_info *sta; in ieee80211_find_sta_by_ifaddr() local
1232 for_each_sta_info(local, addr, sta, tmp) { in ieee80211_find_sta_by_ifaddr()
1234 !ether_addr_equal(sta->sdata->vif.addr, localaddr)) in ieee80211_find_sta_by_ifaddr()
1236 if (!sta->uploaded) in ieee80211_find_sta_by_ifaddr()
1238 return &sta->sta; in ieee80211_find_sta_by_ifaddr()
1248 struct sta_info *sta; in ieee80211_find_sta() local
1253 sta = sta_info_get_bss(vif_to_sdata(vif), addr); in ieee80211_find_sta()
1254 if (!sta) in ieee80211_find_sta()
1257 if (!sta->uploaded) in ieee80211_find_sta()
1260 return &sta->sta; in ieee80211_find_sta()
1265 void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta) in ieee80211_sta_ps_deliver_wakeup() argument
1267 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_deliver_wakeup()
1285 clear_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_ps_deliver_wakeup()
1288 sta->driver_buffered_tids = 0; in ieee80211_sta_ps_deliver_wakeup()
1289 sta->txq_buffered_tids = 0; in ieee80211_sta_ps_deliver_wakeup()
1292 drv_sta_notify(local, sdata, STA_NOTIFY_AWAKE, &sta->sta); in ieee80211_sta_ps_deliver_wakeup()
1294 for (i = 0; i < ARRAY_SIZE(sta->sta.txq); i++) { in ieee80211_sta_ps_deliver_wakeup()
1295 if (!sta->sta.txq[i] || !txq_has_queue(sta->sta.txq[i])) in ieee80211_sta_ps_deliver_wakeup()
1298 schedule_and_wake_txq(local, to_txq_info(sta->sta.txq[i])); in ieee80211_sta_ps_deliver_wakeup()
1304 spin_lock(&sta->ps_lock); in ieee80211_sta_ps_deliver_wakeup()
1309 spin_lock_irqsave(&sta->tx_filtered[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1310 skb_queue_splice_tail_init(&sta->tx_filtered[ac], &pending); in ieee80211_sta_ps_deliver_wakeup()
1311 spin_unlock_irqrestore(&sta->tx_filtered[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1316 spin_lock_irqsave(&sta->ps_tx_buf[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1317 skb_queue_splice_tail_init(&sta->ps_tx_buf[ac], &pending); in ieee80211_sta_ps_deliver_wakeup()
1318 spin_unlock_irqrestore(&sta->ps_tx_buf[ac].lock, flags); in ieee80211_sta_ps_deliver_wakeup()
1326 clear_sta_flag(sta, WLAN_STA_PS_DELIVER); in ieee80211_sta_ps_deliver_wakeup()
1331 clear_sta_flag(sta, WLAN_STA_PSPOLL); in ieee80211_sta_ps_deliver_wakeup()
1332 clear_sta_flag(sta, WLAN_STA_UAPSD); in ieee80211_sta_ps_deliver_wakeup()
1333 spin_unlock(&sta->ps_lock); in ieee80211_sta_ps_deliver_wakeup()
1339 !ieee80211_smps_is_restrictive(sta->known_smps_mode, in ieee80211_sta_ps_deliver_wakeup()
1341 sta->known_smps_mode != sdata->bss->req_smps && in ieee80211_sta_ps_deliver_wakeup()
1342 sta_info_tx_streams(sta) != 1) { in ieee80211_sta_ps_deliver_wakeup()
1345 sta->sta.addr); in ieee80211_sta_ps_deliver_wakeup()
1347 sta->sta.addr, in ieee80211_sta_ps_deliver_wakeup()
1353 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_wakeup()
1357 sta->sta.addr, sta->sta.aid, filtered, buffered); in ieee80211_sta_ps_deliver_wakeup()
1359 ieee80211_check_fast_xmit(sta); in ieee80211_sta_ps_deliver_wakeup()
1362 static void ieee80211_send_null_response(struct sta_info *sta, int tid, in ieee80211_send_null_response() argument
1366 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_send_null_response()
1372 bool qos = sta->sta.wme; in ieee80211_send_null_response()
1401 memcpy(nullfunc->addr1, sta->sta.addr, ETH_ALEN); in ieee80211_send_null_response()
1435 drv_allow_buffered_frames(local, sta, BIT(tid), 1, in ieee80211_send_null_response()
1449 ieee80211_xmit(sdata, sta, skb, 0); in ieee80211_send_null_response()
1470 ieee80211_sta_ps_more_data(struct sta_info *sta, u8 ignored_acs, in ieee80211_sta_ps_more_data() argument
1489 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in ieee80211_sta_ps_more_data()
1490 !skb_queue_empty(&sta->ps_tx_buf[ac])) in ieee80211_sta_ps_more_data()
1498 ieee80211_sta_ps_get_frames(struct sta_info *sta, int n_frames, u8 ignored_acs, in ieee80211_sta_ps_get_frames() argument
1503 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_get_frames()
1521 sta->driver_buffered_tids & tids; in ieee80211_sta_ps_get_frames()
1522 *driver_release_tids |= sta->txq_buffered_tids & tids; in ieee80211_sta_ps_get_frames()
1529 skb = skb_dequeue(&sta->tx_filtered[ac]); in ieee80211_sta_ps_get_frames()
1532 &sta->ps_tx_buf[ac]); in ieee80211_sta_ps_get_frames()
1547 if (!skb_queue_empty(&sta->tx_filtered[ac]) || in ieee80211_sta_ps_get_frames()
1548 !skb_queue_empty(&sta->ps_tx_buf[ac])) in ieee80211_sta_ps_get_frames()
1554 ieee80211_sta_ps_deliver_response(struct sta_info *sta, in ieee80211_sta_ps_deliver_response() argument
1558 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_sta_ps_deliver_response()
1565 set_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_ps_deliver_response()
1569 ieee80211_sta_ps_get_frames(sta, n_frames, ignored_acs, reason, in ieee80211_sta_ps_deliver_response()
1572 more_data = ieee80211_sta_ps_more_data(sta, ignored_acs, reason, driver_release_tids); in ieee80211_sta_ps_deliver_response()
1602 ieee80211_send_null_response(sta, tid, reason, true, false); in ieee80211_sta_ps_deliver_response()
1695 drv_allow_buffered_frames(local, sta, tids, num, in ieee80211_sta_ps_deliver_response()
1702 sta, find_highest_prio_tid(tids), in ieee80211_sta_ps_deliver_response()
1705 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_response()
1719 drv_release_buffered_frames(local, sta, driver_release_tids, in ieee80211_sta_ps_deliver_response()
1732 if (!sta->sta.txq[0]) in ieee80211_sta_ps_deliver_response()
1735 for (tid = 0; tid < ARRAY_SIZE(sta->sta.txq); tid++) { in ieee80211_sta_ps_deliver_response()
1736 if (!sta->sta.txq[tid] || in ieee80211_sta_ps_deliver_response()
1738 txq_has_queue(sta->sta.txq[tid])) in ieee80211_sta_ps_deliver_response()
1741 sta_info_recalc_tim(sta); in ieee80211_sta_ps_deliver_response()
1747 void ieee80211_sta_ps_deliver_poll_response(struct sta_info *sta) in ieee80211_sta_ps_deliver_poll_response() argument
1749 u8 ignore_for_response = sta->sta.uapsd_queues; in ieee80211_sta_ps_deliver_poll_response()
1759 ieee80211_sta_ps_deliver_response(sta, 1, ignore_for_response, in ieee80211_sta_ps_deliver_poll_response()
1763 void ieee80211_sta_ps_deliver_uapsd(struct sta_info *sta) in ieee80211_sta_ps_deliver_uapsd() argument
1765 int n_frames = sta->sta.max_sp; in ieee80211_sta_ps_deliver_uapsd()
1766 u8 delivery_enabled = sta->sta.uapsd_queues; in ieee80211_sta_ps_deliver_uapsd()
1777 switch (sta->sta.max_sp) { in ieee80211_sta_ps_deliver_uapsd()
1793 ieee80211_sta_ps_deliver_response(sta, n_frames, ~delivery_enabled, in ieee80211_sta_ps_deliver_uapsd()
1800 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_block_awake() local
1802 trace_api_sta_block_awake(sta->local, pubsta, block); in ieee80211_sta_block_awake()
1805 set_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1806 ieee80211_clear_fast_xmit(sta); in ieee80211_sta_block_awake()
1810 if (!test_sta_flag(sta, WLAN_STA_PS_DRIVER)) in ieee80211_sta_block_awake()
1813 if (!test_sta_flag(sta, WLAN_STA_PS_STA)) { in ieee80211_sta_block_awake()
1814 set_sta_flag(sta, WLAN_STA_PS_DELIVER); in ieee80211_sta_block_awake()
1815 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1816 ieee80211_queue_work(hw, &sta->drv_deliver_wk); in ieee80211_sta_block_awake()
1817 } else if (test_sta_flag(sta, WLAN_STA_PSPOLL) || in ieee80211_sta_block_awake()
1818 test_sta_flag(sta, WLAN_STA_UAPSD)) { in ieee80211_sta_block_awake()
1820 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1821 ieee80211_queue_work(hw, &sta->drv_deliver_wk); in ieee80211_sta_block_awake()
1823 clear_sta_flag(sta, WLAN_STA_PS_DRIVER); in ieee80211_sta_block_awake()
1824 ieee80211_check_fast_xmit(sta); in ieee80211_sta_block_awake()
1831 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_eosp() local
1832 struct ieee80211_local *local = sta->local; in ieee80211_sta_eosp()
1836 clear_sta_flag(sta, WLAN_STA_SP); in ieee80211_sta_eosp()
1842 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_send_eosp_nullfunc() local
1846 trace_api_send_eosp_nullfunc(sta->local, pubsta, tid); in ieee80211_send_eosp_nullfunc()
1849 more_data = ieee80211_sta_ps_more_data(sta, ~sta->sta.uapsd_queues, in ieee80211_send_eosp_nullfunc()
1852 ieee80211_send_null_response(sta, tid, reason, false, more_data); in ieee80211_send_eosp_nullfunc()
1859 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_set_buffered() local
1864 trace_api_sta_set_buffered(sta->local, pubsta, tid, buffered); in ieee80211_sta_set_buffered()
1867 set_bit(tid, &sta->driver_buffered_tids); in ieee80211_sta_set_buffered()
1869 clear_bit(tid, &sta->driver_buffered_tids); in ieee80211_sta_set_buffered()
1871 sta_info_recalc_tim(sta); in ieee80211_sta_set_buffered()
1878 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_register_airtime() local
1879 struct ieee80211_local *local = sta->sdata->local; in ieee80211_sta_register_airtime()
1883 if (sta->local->airtime_flags & AIRTIME_USE_TX) in ieee80211_sta_register_airtime()
1885 if (sta->local->airtime_flags & AIRTIME_USE_RX) in ieee80211_sta_register_airtime()
1889 sta->airtime[ac].tx_airtime += tx_airtime; in ieee80211_sta_register_airtime()
1890 sta->airtime[ac].rx_airtime += rx_airtime; in ieee80211_sta_register_airtime()
1891 sta->airtime[ac].deficit -= airtime; in ieee80211_sta_register_airtime()
1896 int sta_info_move_state(struct sta_info *sta, in sta_info_move_state() argument
1901 if (sta->sta_state == new_state) in sta_info_move_state()
1908 if (sta->sta_state != IEEE80211_STA_AUTH) in sta_info_move_state()
1912 if (sta->sta_state != IEEE80211_STA_NONE && in sta_info_move_state()
1913 sta->sta_state != IEEE80211_STA_ASSOC) in sta_info_move_state()
1917 if (sta->sta_state != IEEE80211_STA_AUTH && in sta_info_move_state()
1918 sta->sta_state != IEEE80211_STA_AUTHORIZED) in sta_info_move_state()
1922 if (sta->sta_state != IEEE80211_STA_ASSOC) in sta_info_move_state()
1930 sta_dbg(sta->sdata, "moving STA %pM to state %d\n", in sta_info_move_state()
1931 sta->sta.addr, new_state); in sta_info_move_state()
1937 if (test_sta_flag(sta, WLAN_STA_INSERTED)) { in sta_info_move_state()
1938 int err = drv_sta_state(sta->local, sta->sdata, sta, in sta_info_move_state()
1939 sta->sta_state, new_state); in sta_info_move_state()
1948 if (sta->sta_state == IEEE80211_STA_AUTH) in sta_info_move_state()
1949 clear_bit(WLAN_STA_AUTH, &sta->_flags); in sta_info_move_state()
1952 if (sta->sta_state == IEEE80211_STA_NONE) { in sta_info_move_state()
1953 set_bit(WLAN_STA_AUTH, &sta->_flags); in sta_info_move_state()
1954 } else if (sta->sta_state == IEEE80211_STA_ASSOC) { in sta_info_move_state()
1955 clear_bit(WLAN_STA_ASSOC, &sta->_flags); in sta_info_move_state()
1956 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_move_state()
1957 if (!sta->sta.support_p2p_ps) in sta_info_move_state()
1958 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_move_state()
1962 if (sta->sta_state == IEEE80211_STA_AUTH) { in sta_info_move_state()
1963 set_bit(WLAN_STA_ASSOC, &sta->_flags); in sta_info_move_state()
1964 sta->assoc_at = ktime_get_boottime_ns(); in sta_info_move_state()
1965 ieee80211_recalc_min_chandef(sta->sdata); in sta_info_move_state()
1966 if (!sta->sta.support_p2p_ps) in sta_info_move_state()
1967 ieee80211_recalc_p2p_go_ps_allowed(sta->sdata); in sta_info_move_state()
1968 } else if (sta->sta_state == IEEE80211_STA_AUTHORIZED) { in sta_info_move_state()
1969 ieee80211_vif_dec_num_mcast(sta->sdata); in sta_info_move_state()
1970 clear_bit(WLAN_STA_AUTHORIZED, &sta->_flags); in sta_info_move_state()
1971 ieee80211_clear_fast_xmit(sta); in sta_info_move_state()
1972 ieee80211_clear_fast_rx(sta); in sta_info_move_state()
1976 if (sta->sta_state == IEEE80211_STA_ASSOC) { in sta_info_move_state()
1977 ieee80211_vif_inc_num_mcast(sta->sdata); in sta_info_move_state()
1978 set_bit(WLAN_STA_AUTHORIZED, &sta->_flags); in sta_info_move_state()
1979 ieee80211_check_fast_xmit(sta); in sta_info_move_state()
1980 ieee80211_check_fast_rx(sta); in sta_info_move_state()
1982 if (sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN || in sta_info_move_state()
1983 sta->sdata->vif.type == NL80211_IFTYPE_AP) in sta_info_move_state()
1984 cfg80211_send_layer2_update(sta->sdata->dev, in sta_info_move_state()
1985 sta->sta.addr); in sta_info_move_state()
1991 sta->sta_state = new_state; in sta_info_move_state()
1996 u8 sta_info_tx_streams(struct sta_info *sta) in sta_info_tx_streams() argument
1998 struct ieee80211_sta_ht_cap *ht_cap = &sta->sta.ht_cap; in sta_info_tx_streams()
2001 if (!sta->sta.ht_cap.ht_supported) in sta_info_tx_streams()
2004 if (sta->sta.vht_cap.vht_supported) { in sta_info_tx_streams()
2007 le16_to_cpu(sta->sta.vht_cap.vht_mcs.tx_mcs_map); in sta_info_tx_streams()
2032 sta_get_last_rx_stats(struct sta_info *sta) in sta_get_last_rx_stats() argument
2034 struct ieee80211_sta_rx_stats *stats = &sta->rx_stats; in sta_get_last_rx_stats()
2035 struct ieee80211_local *local = sta->local; in sta_get_last_rx_stats()
2044 cpustats = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_get_last_rx_stats()
2101 static int sta_set_rate_info_rx(struct sta_info *sta, struct rate_info *rinfo) in sta_set_rate_info_rx() argument
2103 u16 rate = READ_ONCE(sta_get_last_rx_stats(sta)->last_rate); in sta_set_rate_info_rx()
2108 sta_stats_decode_rate(sta->local, rate, rinfo); in sta_set_rate_info_rx()
2112 static void sta_set_tidstats(struct sta_info *sta, in sta_set_tidstats() argument
2116 struct ieee80211_local *local = sta->local; in sta_set_tidstats()
2122 start = u64_stats_fetch_begin(&sta->rx_stats.syncp); in sta_set_tidstats()
2123 tidstats->rx_msdu = sta->rx_stats.msdu[tid]; in sta_set_tidstats()
2124 } while (u64_stats_fetch_retry(&sta->rx_stats.syncp, start)); in sta_set_tidstats()
2131 tidstats->tx_msdu = sta->tx_stats.msdu[tid]; in sta_set_tidstats()
2137 tidstats->tx_msdu_retries = sta->status_stats.msdu_retries[tid]; in sta_set_tidstats()
2143 tidstats->tx_msdu_failed = sta->status_stats.msdu_failed[tid]; in sta_set_tidstats()
2152 to_txq_info(sta->sta.txq[tid])); in sta_set_tidstats()
2172 void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo, in sta_set_sinfo() argument
2175 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_set_sinfo()
2181 last_rxstats = sta_get_last_rx_stats(sta); in sta_set_sinfo()
2192 drv_sta_statistics(local, sdata, &sta->sta, sinfo); in sta_set_sinfo()
2206 sinfo->connected_time = ktime_get_seconds() - sta->last_connected; in sta_set_sinfo()
2207 sinfo->assoc_at = sta->assoc_at; in sta_set_sinfo()
2209 jiffies_to_msecs(jiffies - ieee80211_sta_last_active(sta)); in sta_set_sinfo()
2215 sinfo->tx_bytes += sta->tx_stats.bytes[ac]; in sta_set_sinfo()
2222 sinfo->tx_packets += sta->tx_stats.packets[ac]; in sta_set_sinfo()
2228 sinfo->rx_bytes += sta_get_stats_bytes(&sta->rx_stats); in sta_set_sinfo()
2230 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2234 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2243 sinfo->rx_packets = sta->rx_stats.packets; in sta_set_sinfo()
2244 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2248 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2256 sinfo->tx_retries = sta->status_stats.retry_count; in sta_set_sinfo()
2261 sinfo->tx_failed = sta->status_stats.retry_failed; in sta_set_sinfo()
2267 sinfo->rx_duration += sta->airtime[ac].rx_airtime; in sta_set_sinfo()
2273 sinfo->tx_duration += sta->airtime[ac].tx_airtime; in sta_set_sinfo()
2278 sinfo->airtime_weight = sta->airtime_weight; in sta_set_sinfo()
2282 sinfo->rx_dropped_misc = sta->rx_stats.dropped; in sta_set_sinfo()
2283 if (sta->pcpu_rx_stats) { in sta_set_sinfo()
2287 cpurxs = per_cpu_ptr(sta->pcpu_rx_stats, cpu); in sta_set_sinfo()
2299 if (ieee80211_hw_check(&sta->local->hw, SIGNAL_DBM) || in sta_set_sinfo()
2300 ieee80211_hw_check(&sta->local->hw, SIGNAL_UNSPEC)) { in sta_set_sinfo()
2306 if (!sta->pcpu_rx_stats && in sta_set_sinfo()
2309 -ewma_signal_read(&sta->rx_stats_avg.signal); in sta_set_sinfo()
2322 if (!sta->pcpu_rx_stats) in sta_set_sinfo()
2331 -ewma_signal_read(&sta->rx_stats_avg.chain_signal[i]); in sta_set_sinfo()
2336 sta_set_rate_info_tx(sta, &sta->tx_stats.last_rate, in sta_set_sinfo()
2342 if (sta_set_rate_info_rx(sta, &sinfo->rxrate) == 0) in sta_set_sinfo()
2348 sta_set_tidstats(sta, &sinfo->pertid[i], i); in sta_set_sinfo()
2361 sinfo->llid = sta->mesh->llid; in sta_set_sinfo()
2362 sinfo->plid = sta->mesh->plid; in sta_set_sinfo()
2363 sinfo->plink_state = sta->mesh->plink_state; in sta_set_sinfo()
2364 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { in sta_set_sinfo()
2366 sinfo->t_offset = sta->mesh->t_offset; in sta_set_sinfo()
2368 sinfo->local_pm = sta->mesh->local_pm; in sta_set_sinfo()
2369 sinfo->peer_pm = sta->mesh->peer_pm; in sta_set_sinfo()
2370 sinfo->nonpeer_pm = sta->mesh->nonpeer_pm; in sta_set_sinfo()
2371 sinfo->connected_to_gate = sta->mesh->connected_to_gate; in sta_set_sinfo()
2393 if (test_sta_flag(sta, WLAN_STA_AUTHORIZED)) in sta_set_sinfo()
2395 if (test_sta_flag(sta, WLAN_STA_SHORT_PREAMBLE)) in sta_set_sinfo()
2397 if (sta->sta.wme) in sta_set_sinfo()
2399 if (test_sta_flag(sta, WLAN_STA_MFP)) in sta_set_sinfo()
2401 if (test_sta_flag(sta, WLAN_STA_AUTH)) in sta_set_sinfo()
2403 if (test_sta_flag(sta, WLAN_STA_ASSOC)) in sta_set_sinfo()
2405 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) in sta_set_sinfo()
2408 thr = sta_get_expected_throughput(sta); in sta_set_sinfo()
2416 sta->status_stats.ack_signal_filled) { in sta_set_sinfo()
2417 sinfo->ack_signal = sta->status_stats.last_ack_signal; in sta_set_sinfo()
2422 sta->status_stats.ack_signal_filled) { in sta_set_sinfo()
2425 &sta->status_stats.avg_ack_signal); in sta_set_sinfo()
2433 airtime_link_metric_get(local, sta); in sta_set_sinfo()
2437 u32 sta_get_expected_throughput(struct sta_info *sta) in sta_get_expected_throughput() argument
2439 struct ieee80211_sub_if_data *sdata = sta->sdata; in sta_get_expected_throughput()
2444 if (test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) in sta_get_expected_throughput()
2449 thr = ref->ops->get_expected_throughput(sta->rate_ctrl_priv); in sta_get_expected_throughput()
2451 thr = drv_get_expected_throughput(local, sta); in sta_get_expected_throughput()
2456 unsigned long ieee80211_sta_last_active(struct sta_info *sta) in ieee80211_sta_last_active() argument
2458 struct ieee80211_sta_rx_stats *stats = sta_get_last_rx_stats(sta); in ieee80211_sta_last_active()
2460 if (!sta->status_stats.last_ack || in ieee80211_sta_last_active()
2461 time_after(stats->last_rx, sta->status_stats.last_ack)) in ieee80211_sta_last_active()
2463 return sta->status_stats.last_ack; in ieee80211_sta_last_active()
2466 static void sta_update_codel_params(struct sta_info *sta, u32 thr) in sta_update_codel_params() argument
2468 if (!sta->sdata->local->ops->wake_tx_queue) in sta_update_codel_params()
2471 if (thr && thr < STA_SLOW_THRESHOLD * sta->local->num_sta) { in sta_update_codel_params()
2472 sta->cparams.target = MS2TIME(50); in sta_update_codel_params()
2473 sta->cparams.interval = MS2TIME(300); in sta_update_codel_params()
2474 sta->cparams.ecn = false; in sta_update_codel_params()
2476 sta->cparams.target = MS2TIME(20); in sta_update_codel_params()
2477 sta->cparams.interval = MS2TIME(100); in sta_update_codel_params()
2478 sta->cparams.ecn = true; in sta_update_codel_params()
2485 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_sta_set_expected_throughput() local
2487 sta_update_codel_params(sta, thr); in ieee80211_sta_set_expected_throughput()