Lines Matching refs:sta

323 	if (tx->sta)  in ieee80211_tx_h_check_assoc()
324 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_check_assoc()
358 struct sta_info *sta; in purge_old_ps_buffers() local
382 list_for_each_entry_rcu(sta, &local->sta_list, list) { in purge_old_ps_buffers()
386 skb = skb_dequeue(&sta->ps_tx_buf[ac]); in purge_old_ps_buffers()
387 total += skb_queue_len(&sta->ps_tx_buf[ac]); in purge_old_ps_buffers()
465 static int ieee80211_use_mfp(__le16 fc, struct sta_info *sta, in ieee80211_use_mfp() argument
471 if (sta == NULL || !test_sta_flag(sta, WLAN_STA_MFP)) in ieee80211_use_mfp()
483 struct sta_info *sta = tx->sta; in ieee80211_tx_h_unicast_ps_buf() local
488 if (unlikely(!sta)) in ieee80211_tx_h_unicast_ps_buf()
491 if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) || in ieee80211_tx_h_unicast_ps_buf()
492 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || in ieee80211_tx_h_unicast_ps_buf()
493 test_sta_flag(sta, WLAN_STA_PS_DELIVER)) && in ieee80211_tx_h_unicast_ps_buf()
503 ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n", in ieee80211_tx_h_unicast_ps_buf()
504 sta->sta.addr, sta->sta.aid, ac); in ieee80211_tx_h_unicast_ps_buf()
509 spin_lock(&sta->ps_lock); in ieee80211_tx_h_unicast_ps_buf()
515 if (!test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_tx_h_unicast_ps_buf()
516 !test_sta_flag(sta, WLAN_STA_PS_DRIVER) && in ieee80211_tx_h_unicast_ps_buf()
517 !test_sta_flag(sta, WLAN_STA_PS_DELIVER)) { in ieee80211_tx_h_unicast_ps_buf()
518 spin_unlock(&sta->ps_lock); in ieee80211_tx_h_unicast_ps_buf()
522 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) { in ieee80211_tx_h_unicast_ps_buf()
523 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]); in ieee80211_tx_h_unicast_ps_buf()
526 sta->sta.addr, ac); in ieee80211_tx_h_unicast_ps_buf()
535 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); in ieee80211_tx_h_unicast_ps_buf()
536 spin_unlock(&sta->ps_lock); in ieee80211_tx_h_unicast_ps_buf()
547 sta_info_recalc_tim(sta); in ieee80211_tx_h_unicast_ps_buf()
550 } else if (unlikely(test_sta_flag(sta, WLAN_STA_PS_STA))) { in ieee80211_tx_h_unicast_ps_buf()
553 sta->sta.addr); in ieee80211_tx_h_unicast_ps_buf()
595 else if (tx->sta && in ieee80211_tx_h_select_key()
596 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) in ieee80211_tx_h_select_key()
632 !ieee80211_use_mfp(hdr->frame_control, tx->sta, in ieee80211_tx_h_select_key()
713 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
722 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
723 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
730 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
742 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
744 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
745 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
768 if (tx->sta && ieee80211_is_data(hdr->frame_control)) in ieee80211_tx_h_rate_ctrl()
769 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
770 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
771 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
786 static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid) in ieee80211_tx_next_seq() argument
788 u16 *seq = &sta->tid_seq[tid]; in ieee80211_tx_next_seq()
836 if (tx->sta) in ieee80211_tx_h_sequence()
837 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
846 if (!tx->sta) in ieee80211_tx_h_sequence()
851 tx->sta->tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
853 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
999 if (!tx->sta) in ieee80211_tx_h_stats()
1004 tx->sta->tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1007 tx->sta->tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1093 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1094 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1113 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1123 clear_sta_flag(tx->sta, WLAN_STA_SP); in ieee80211_tx_prep_agg()
1124 ps_dbg(tx->sta->sdata, in ieee80211_tx_prep_agg()
1126 tx->sta->sta.addr, tx->sta->sta.aid); in ieee80211_tx_prep_agg()
1135 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1156 struct sta_info *sta, struct sk_buff *skb) in ieee80211_tx_prepare() argument
1178 if (likely(sta)) { in ieee80211_tx_prepare()
1179 if (!IS_ERR(sta)) in ieee80211_tx_prepare()
1180 tx->sta = sta; in ieee80211_tx_prepare()
1183 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1184 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1189 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1191 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) in ieee80211_tx_prepare()
1192 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1195 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1203 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1228 if (!tx->sta) in ieee80211_tx_prepare()
1230 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1232 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1242 struct sta_info *sta, in ieee80211_get_txq() argument
1257 sta && sta->uploaded) { in ieee80211_get_txq()
1262 txq = sta->sta.txq[IEEE80211_NUM_TIDS]; in ieee80211_get_txq()
1264 } else if (sta) { in ieee80211_get_txq()
1267 if (!sta->uploaded) in ieee80211_get_txq()
1270 txq = sta->sta.txq[tid]; in ieee80211_get_txq()
1347 if (txqi->txq.sta) { in fq_tin_dequeue_func()
1348 struct sta_info *sta = container_of(txqi->txq.sta, in fq_tin_dequeue_func() local
1349 struct sta_info, sta); in fq_tin_dequeue_func()
1350 cparams = &sta->cparams; in fq_tin_dequeue_func()
1445 struct sta_info *sta, in ieee80211_txq_init() argument
1457 if (!sta) { in ieee80211_txq_init()
1481 txqi->txq.sta = &sta->sta; in ieee80211_txq_init()
1483 sta->sta.txq[tid] = &txqi->txq; in ieee80211_txq_init()
1591 struct sta_info *sta, in ieee80211_queue_skb() argument
1606 txqi = ieee80211_get_txq(local, vif, sta, skb); in ieee80211_queue_skb()
1620 struct ieee80211_sta *sta, in ieee80211_tx_frags() argument
1682 control.sta = sta; in ieee80211_tx_frags()
1696 struct sta_info *sta, bool txpending) in __ieee80211_tx() argument
1713 if (sta && !sta->uploaded) in __ieee80211_tx()
1714 sta = NULL; in __ieee80211_tx()
1716 if (sta) in __ieee80211_tx()
1717 pubsta = &sta->sta; in __ieee80211_tx()
1852 int band, struct ieee80211_sta **sta) in ieee80211_tx_prepare_skb() argument
1869 if (sta) { in ieee80211_tx_prepare_skb()
1870 if (tx.sta) in ieee80211_tx_prepare_skb()
1871 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1873 *sta = NULL; in ieee80211_tx_prepare_skb()
1892 struct sta_info *sta, struct sk_buff *skb, in ieee80211_tx() argument
1909 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1929 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb)) in ieee80211_tx()
1934 tx.sta, txpending); in ieee80211_tx()
1980 struct sta_info *sta, struct sk_buff *skb, in ieee80211_xmit() argument
2016 ieee80211_tx(sdata, sta, skb, false, txdata_flags); in ieee80211_xmit()
2362 struct sta_info *sta; in ieee80211_lookup_ra_sta() local
2366 sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_lookup_ra_sta()
2367 if (sta) { in ieee80211_lookup_ra_sta()
2368 *sta_out = sta; in ieee80211_lookup_ra_sta()
2381 sta = sta_info_get_bss(sdata, skb->data); in ieee80211_lookup_ra_sta()
2384 sta = sta_info_get(sdata, sdata->u.wds.remote_addr); in ieee80211_lookup_ra_sta()
2394 sta = sta_info_get(sdata, skb->data); in ieee80211_lookup_ra_sta()
2395 if (sta && test_sta_flag(sta, WLAN_STA_TDLS_PEER)) { in ieee80211_lookup_ra_sta()
2396 if (test_sta_flag(sta, in ieee80211_lookup_ra_sta()
2398 *sta_out = sta; in ieee80211_lookup_ra_sta()
2415 sta = sta_info_get(sdata, sdata->u.mgd.bssid); in ieee80211_lookup_ra_sta()
2416 if (!sta) in ieee80211_lookup_ra_sta()
2423 *sta_out = sta ?: ERR_PTR(-ENOENT); in ieee80211_lookup_ra_sta()
2448 struct sta_info *sta, u32 ctrl_flags) in ieee80211_build_hdr() argument
2469 if (IS_ERR(sta)) in ieee80211_build_hdr()
2470 sta = NULL; in ieee80211_build_hdr()
2487 memcpy(hdr.addr1, sta->sta.addr, ETH_ALEN); in ieee80211_build_hdr()
2492 authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); in ieee80211_build_hdr()
2493 wme_sta = sta->sta.wme; in ieee80211_build_hdr()
2618 tdls_peer = test_sta_flag(sta, WLAN_STA_TDLS_PEER); in ieee80211_build_hdr()
2685 if (sta) { in ieee80211_build_hdr()
2686 authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); in ieee80211_build_hdr()
2687 wme_sta = sta->sta.wme; in ieee80211_build_hdr()
2861 void ieee80211_check_fast_xmit(struct sta_info *sta) in ieee80211_check_fast_xmit() argument
2864 struct ieee80211_local *local = sta->local; in ieee80211_check_fast_xmit()
2865 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_check_fast_xmit()
2885 spin_lock_bh(&sta->lock); in ieee80211_check_fast_xmit()
2891 if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED)) in ieee80211_check_fast_xmit()
2894 if (test_sta_flag(sta, WLAN_STA_PS_STA) || in ieee80211_check_fast_xmit()
2895 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || in ieee80211_check_fast_xmit()
2896 test_sta_flag(sta, WLAN_STA_PS_DELIVER) || in ieee80211_check_fast_xmit()
2897 test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) in ieee80211_check_fast_xmit()
2928 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) { in ieee80211_check_fast_xmit()
2961 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); in ieee80211_check_fast_xmit()
2982 if (sta->sta.wme) { in ieee80211_check_fast_xmit()
2992 build.key = rcu_access_pointer(sta->ptk[sta->ptk_idx]); in ieee80211_check_fast_xmit()
3081 old = rcu_dereference_protected(sta->fast_tx, in ieee80211_check_fast_xmit()
3082 lockdep_is_held(&sta->lock)); in ieee80211_check_fast_xmit()
3083 rcu_assign_pointer(sta->fast_tx, fast_tx); in ieee80211_check_fast_xmit()
3086 spin_unlock_bh(&sta->lock); in ieee80211_check_fast_xmit()
3091 struct sta_info *sta; in ieee80211_check_fast_xmit_all() local
3094 list_for_each_entry_rcu(sta, &local->sta_list, list) in ieee80211_check_fast_xmit_all()
3095 ieee80211_check_fast_xmit(sta); in ieee80211_check_fast_xmit_all()
3102 struct sta_info *sta; in ieee80211_check_fast_xmit_iface() local
3106 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_check_fast_xmit_iface()
3107 if (sdata != sta->sdata && in ieee80211_check_fast_xmit_iface()
3108 (!sta->sdata->bss || sta->sdata->bss != sdata->bss)) in ieee80211_check_fast_xmit_iface()
3110 ieee80211_check_fast_xmit(sta); in ieee80211_check_fast_xmit_iface()
3116 void ieee80211_clear_fast_xmit(struct sta_info *sta) in ieee80211_clear_fast_xmit() argument
3120 spin_lock_bh(&sta->lock); in ieee80211_clear_fast_xmit()
3121 fast_tx = rcu_dereference_protected(sta->fast_tx, in ieee80211_clear_fast_xmit()
3122 lockdep_is_held(&sta->lock)); in ieee80211_clear_fast_xmit()
3123 RCU_INIT_POINTER(sta->fast_tx, NULL); in ieee80211_clear_fast_xmit()
3124 spin_unlock_bh(&sta->lock); in ieee80211_clear_fast_xmit()
3212 struct sta_info *sta, in ieee80211_amsdu_aggregate() argument
3221 struct ieee80211_txq *txq = sta->sta.txq[tid]; in ieee80211_amsdu_aggregate()
3225 u8 max_subframes = sta->sta.max_amsdu_subframes; in ieee80211_amsdu_aggregate()
3227 int max_amsdu_len = sta->sta.max_amsdu_len; in ieee80211_amsdu_aggregate()
3250 if (sta->sta.max_rc_amsdu_len) in ieee80211_amsdu_aggregate()
3252 sta->sta.max_rc_amsdu_len); in ieee80211_amsdu_aggregate()
3254 if (sta->sta.max_tid_amsdu_len[tid]) in ieee80211_amsdu_aggregate()
3256 sta->sta.max_tid_amsdu_len[tid]); in ieee80211_amsdu_aggregate()
3349 struct sta_info *sta, u8 pn_offs, in ieee80211_xmit_fast_finish() argument
3364 hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); in ieee80211_xmit_fast_finish()
3372 sta->tx_stats.msdu[tid] += in ieee80211_xmit_fast_finish()
3375 sta->tx_stats.msdu[tid]++; in ieee80211_xmit_fast_finish()
3382 sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; in ieee80211_xmit_fast_finish()
3383 sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; in ieee80211_xmit_fast_finish()
3408 struct sta_info *sta, in ieee80211_xmit_fast() argument
3438 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); in ieee80211_xmit_fast()
3460 ieee80211_amsdu_aggregate(sdata, sta, fast_tx, skb)) in ieee80211_xmit_fast()
3505 tx.sta = sta; in ieee80211_xmit_fast()
3521 if (ieee80211_queue_skb(local, sdata, sta, skb)) in ieee80211_xmit_fast()
3524 ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs, in ieee80211_xmit_fast()
3532 ieee80211_tx_frags(local, &sdata->vif, &sta->sta, &tx.skbs, false); in ieee80211_xmit_fast()
3584 if (txq->sta) in ieee80211_tx_dequeue()
3585 tx.sta = container_of(txq->sta, struct sta_info, sta); in ieee80211_tx_dequeue()
3603 struct sta_info *sta = container_of(txq->sta, struct sta_info, in ieee80211_tx_dequeue() local
3604 sta); in ieee80211_tx_dequeue()
3611 ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs, in ieee80211_tx_dequeue()
3686 if (txqi->txq.sta) { in ieee80211_next_txq()
3687 struct sta_info *sta = container_of(txqi->txq.sta, in ieee80211_next_txq() local
3688 struct sta_info, sta); in ieee80211_next_txq()
3690 if (sta->airtime[txqi->txq.ac].deficit < 0) { in ieee80211_next_txq()
3691 sta->airtime[txqi->txq.ac].deficit += in ieee80211_next_txq()
3692 sta->airtime_weight; in ieee80211_next_txq()
3732 if (txqi->txq.sta && in __ieee80211_schedule_txq()
3751 struct sta_info *sta; in ieee80211_txq_may_transmit() local
3756 if (!txqi->txq.sta) in ieee80211_txq_may_transmit()
3767 if (!iter->txq.sta) { in ieee80211_txq_may_transmit()
3772 sta = container_of(iter->txq.sta, struct sta_info, sta); in ieee80211_txq_may_transmit()
3773 if (sta->airtime[ac].deficit < 0) in ieee80211_txq_may_transmit()
3774 sta->airtime[ac].deficit += sta->airtime_weight; in ieee80211_txq_may_transmit()
3778 sta = container_of(txqi->txq.sta, struct sta_info, sta); in ieee80211_txq_may_transmit()
3779 if (sta->airtime[ac].deficit >= 0) in ieee80211_txq_may_transmit()
3782 sta->airtime[ac].deficit += sta->airtime_weight; in ieee80211_txq_may_transmit()
3813 struct sta_info *sta; in __ieee80211_subif_start_xmit() local
3823 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) in __ieee80211_subif_start_xmit()
3826 if (IS_ERR(sta)) in __ieee80211_subif_start_xmit()
3827 sta = NULL; in __ieee80211_subif_start_xmit()
3830 u16 queue = __ieee80211_select_queue(sdata, sta, skb); in __ieee80211_subif_start_xmit()
3834 if (sta) { in __ieee80211_subif_start_xmit()
3839 fast_tx = rcu_dereference(sta->fast_tx); in __ieee80211_subif_start_xmit()
3842 ieee80211_xmit_fast(sdata, sta, fast_tx, skb)) in __ieee80211_subif_start_xmit()
3884 sta, ctrl_flags); in __ieee80211_subif_start_xmit()
3890 ieee80211_xmit(sdata, sta, skb, 0); in __ieee80211_subif_start_xmit()
3899 static int ieee80211_change_da(struct sk_buff *skb, struct sta_info *sta) in ieee80211_change_da() argument
3909 ether_addr_copy(eth->h_dest, sta->sta.addr); in ieee80211_change_da()
3927 if (sdata->u.vlan.sta) in ieee80211_multicast_to_unicast()
3964 struct sta_info *sta, *first = NULL; in ieee80211_convert_to_unicast() local
3969 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_convert_to_unicast()
3970 if (sdata != sta->sdata) in ieee80211_convert_to_unicast()
3973 if (unlikely(ether_addr_equal(eth->h_source, sta->sta.addr))) in ieee80211_convert_to_unicast()
3977 first = sta; in ieee80211_convert_to_unicast()
3983 if (unlikely(ieee80211_change_da(cloned_skb, sta))) { in ieee80211_convert_to_unicast()
4041 struct sta_info *sta; in ieee80211_build_data_template() local
4045 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) { in ieee80211_build_data_template()
4051 skb = ieee80211_build_hdr(sdata, skb, info_flags, sta, 0); in ieee80211_build_data_template()
4056 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
4095 struct sta_info *sta; in ieee80211_tx_pending_skb() local
4117 sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_pending_skb()
4119 result = __ieee80211_tx(local, &skbs, skb->len, sta, true); in ieee80211_tx_pending_skb()
4750 struct sta_info *sta; in ieee80211_nullfunc_get() local
4753 sta = sta_info_get(sdata, ifmgd->bssid); in ieee80211_nullfunc_get()
4754 qos = sta && sta->sta.wme; in ieee80211_nullfunc_get()
4935 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_reserve_tid() local
4936 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_reserve_tid()
4957 if (sta->reserved_tid == tid) { in ieee80211_reserve_tid()
4962 if (sta->reserved_tid != IEEE80211_TID_UNRESERVED) { in ieee80211_reserve_tid()
4975 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in ieee80211_reserve_tid()
4976 __ieee80211_stop_tx_ba_session(sta, tid, in ieee80211_reserve_tid()
4983 sta->reserved_tid = tid; in ieee80211_reserve_tid()
4989 clear_sta_flag(sta, WLAN_STA_BLOCK_BA); in ieee80211_reserve_tid()
4999 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_unreserve_tid() local
5000 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_unreserve_tid()
5015 if (tid != sta->reserved_tid) { in ieee80211_unreserve_tid()
5020 sta->reserved_tid = IEEE80211_TID_UNRESERVED; in ieee80211_unreserve_tid()