Lines Matching refs:sta
317 if (tx->sta) in ieee80211_tx_h_check_assoc()
318 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_check_assoc()
353 struct sta_info *sta; in purge_old_ps_buffers() local
377 list_for_each_entry_rcu(sta, &local->sta_list, list) { in purge_old_ps_buffers()
381 skb = skb_dequeue(&sta->ps_tx_buf[ac]); in purge_old_ps_buffers()
382 total += skb_queue_len(&sta->ps_tx_buf[ac]); in purge_old_ps_buffers()
460 static int ieee80211_use_mfp(__le16 fc, struct sta_info *sta, in ieee80211_use_mfp() argument
466 if (sta == NULL || !test_sta_flag(sta, WLAN_STA_MFP)) in ieee80211_use_mfp()
478 struct sta_info *sta = tx->sta; in ieee80211_tx_h_unicast_ps_buf() local
483 if (unlikely(!sta)) in ieee80211_tx_h_unicast_ps_buf()
486 if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) || in ieee80211_tx_h_unicast_ps_buf()
487 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || in ieee80211_tx_h_unicast_ps_buf()
488 test_sta_flag(sta, WLAN_STA_PS_DELIVER)) && in ieee80211_tx_h_unicast_ps_buf()
498 ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n", in ieee80211_tx_h_unicast_ps_buf()
499 sta->sta.addr, sta->sta.aid, ac); in ieee80211_tx_h_unicast_ps_buf()
504 spin_lock(&sta->ps_lock); in ieee80211_tx_h_unicast_ps_buf()
510 if (!test_sta_flag(sta, WLAN_STA_PS_STA) && in ieee80211_tx_h_unicast_ps_buf()
511 !test_sta_flag(sta, WLAN_STA_PS_DRIVER) && in ieee80211_tx_h_unicast_ps_buf()
512 !test_sta_flag(sta, WLAN_STA_PS_DELIVER)) { in ieee80211_tx_h_unicast_ps_buf()
513 spin_unlock(&sta->ps_lock); in ieee80211_tx_h_unicast_ps_buf()
517 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) { in ieee80211_tx_h_unicast_ps_buf()
518 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]); in ieee80211_tx_h_unicast_ps_buf()
521 sta->sta.addr, ac); in ieee80211_tx_h_unicast_ps_buf()
530 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); in ieee80211_tx_h_unicast_ps_buf()
531 spin_unlock(&sta->ps_lock); in ieee80211_tx_h_unicast_ps_buf()
542 sta_info_recalc_tim(sta); in ieee80211_tx_h_unicast_ps_buf()
545 } else if (unlikely(test_sta_flag(sta, WLAN_STA_PS_STA))) { in ieee80211_tx_h_unicast_ps_buf()
548 sta->sta.addr); in ieee80211_tx_h_unicast_ps_buf()
590 else if (tx->sta && in ieee80211_tx_h_select_key()
591 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) in ieee80211_tx_h_select_key()
624 !ieee80211_use_mfp(hdr->frame_control, tx->sta, in ieee80211_tx_h_select_key()
708 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
713 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
714 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
721 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
733 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
735 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
736 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
759 if (tx->sta && ieee80211_is_data(hdr->frame_control)) in ieee80211_tx_h_rate_ctrl()
760 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
761 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
762 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
777 static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid) in ieee80211_tx_next_seq() argument
779 u16 *seq = &sta->tid_seq[tid]; in ieee80211_tx_next_seq()
826 if (tx->sta) in ieee80211_tx_h_sequence()
827 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
836 if (!tx->sta) in ieee80211_tx_h_sequence()
843 tx->sta->tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
845 if (!tx->sta->sta.txq[0]) in ieee80211_tx_h_sequence()
846 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
992 if (!tx->sta) in ieee80211_tx_h_stats()
997 tx->sta->tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1000 tx->sta->tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1086 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1087 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1106 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1124 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1145 struct sta_info *sta, struct sk_buff *skb) in ieee80211_tx_prepare() argument
1168 if (likely(sta)) { in ieee80211_tx_prepare()
1169 if (!IS_ERR(sta)) in ieee80211_tx_prepare()
1170 tx->sta = sta; in ieee80211_tx_prepare()
1173 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1174 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1179 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1181 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) in ieee80211_tx_prepare()
1182 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1185 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1194 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1219 if (!tx->sta) in ieee80211_tx_prepare()
1221 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1223 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1240 .sta = pubsta, in ieee80211_drv_tx()
1302 if (txq->sta && ieee80211_is_data_qos(hdr->frame_control)) { in ieee80211_tx_dequeue()
1303 struct sta_info *sta = container_of(txq->sta, struct sta_info, in ieee80211_tx_dequeue() local
1304 sta); in ieee80211_tx_dequeue()
1307 hdr->seq_ctrl = ieee80211_tx_next_seq(sta, txq->tid); in ieee80211_tx_dequeue()
1323 struct ieee80211_sta *sta, in ieee80211_tx_frags() argument
1386 ieee80211_drv_tx(local, vif, sta, skb); in ieee80211_tx_frags()
1397 struct sta_info *sta, bool txpending) in __ieee80211_tx() argument
1414 if (sta && !sta->uploaded) in __ieee80211_tx()
1415 sta = NULL; in __ieee80211_tx()
1417 if (sta) in __ieee80211_tx()
1418 pubsta = &sta->sta; in __ieee80211_tx()
1516 int band, struct ieee80211_sta **sta) in ieee80211_tx_prepare_skb() argument
1533 if (sta) { in ieee80211_tx_prepare_skb()
1534 if (tx.sta) in ieee80211_tx_prepare_skb()
1535 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1537 *sta = NULL; in ieee80211_tx_prepare_skb()
1556 struct sta_info *sta, struct sk_buff *skb, in ieee80211_tx() argument
1573 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1590 tx.sta, txpending); in ieee80211_tx()
1630 struct sta_info *sta, struct sk_buff *skb) in ieee80211_xmit() argument
1665 ieee80211_tx(sdata, sta, skb, false); in ieee80211_xmit()
1911 struct sta_info *sta; in ieee80211_lookup_ra_sta() local
1915 sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_lookup_ra_sta()
1916 if (sta) { in ieee80211_lookup_ra_sta()
1917 *sta_out = sta; in ieee80211_lookup_ra_sta()
1930 sta = sta_info_get_bss(sdata, skb->data); in ieee80211_lookup_ra_sta()
1933 sta = sta_info_get(sdata, sdata->u.wds.remote_addr); in ieee80211_lookup_ra_sta()
1943 sta = sta_info_get(sdata, skb->data); in ieee80211_lookup_ra_sta()
1944 if (sta) { in ieee80211_lookup_ra_sta()
1947 tdls_peer = test_sta_flag(sta, in ieee80211_lookup_ra_sta()
1949 tdls_auth = test_sta_flag(sta, in ieee80211_lookup_ra_sta()
1953 *sta_out = sta; in ieee80211_lookup_ra_sta()
1971 sta = sta_info_get(sdata, sdata->u.mgd.bssid); in ieee80211_lookup_ra_sta()
1972 if (!sta) in ieee80211_lookup_ra_sta()
1979 *sta_out = sta ?: ERR_PTR(-ENOENT); in ieee80211_lookup_ra_sta()
2003 struct sta_info *sta) in ieee80211_build_hdr() argument
2025 if (IS_ERR(sta)) in ieee80211_build_hdr()
2026 sta = NULL; in ieee80211_build_hdr()
2038 memcpy(hdr.addr1, sta->sta.addr, ETH_ALEN); in ieee80211_build_hdr()
2043 authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); in ieee80211_build_hdr()
2044 wme_sta = sta->sta.wme; in ieee80211_build_hdr()
2159 tdls_peer = test_sta_flag(sta, WLAN_STA_TDLS_PEER); in ieee80211_build_hdr()
2226 if (sta) { in ieee80211_build_hdr()
2227 authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED); in ieee80211_build_hdr()
2228 wme_sta = sta->sta.wme; in ieee80211_build_hdr()
2421 void ieee80211_check_fast_xmit(struct sta_info *sta) in ieee80211_check_fast_xmit() argument
2424 struct ieee80211_local *local = sta->local; in ieee80211_check_fast_xmit()
2425 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_check_fast_xmit()
2445 spin_lock_bh(&sta->lock); in ieee80211_check_fast_xmit()
2451 if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED)) in ieee80211_check_fast_xmit()
2454 if (test_sta_flag(sta, WLAN_STA_PS_STA) || in ieee80211_check_fast_xmit()
2455 test_sta_flag(sta, WLAN_STA_PS_DRIVER) || in ieee80211_check_fast_xmit()
2456 test_sta_flag(sta, WLAN_STA_PS_DELIVER) || in ieee80211_check_fast_xmit()
2457 test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT)) in ieee80211_check_fast_xmit()
2488 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) { in ieee80211_check_fast_xmit()
2521 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN); in ieee80211_check_fast_xmit()
2542 if (sta->sta.wme) { in ieee80211_check_fast_xmit()
2552 build.key = rcu_access_pointer(sta->ptk[sta->ptk_idx]); in ieee80211_check_fast_xmit()
2643 old = rcu_dereference_protected(sta->fast_tx, in ieee80211_check_fast_xmit()
2644 lockdep_is_held(&sta->lock)); in ieee80211_check_fast_xmit()
2645 rcu_assign_pointer(sta->fast_tx, fast_tx); in ieee80211_check_fast_xmit()
2648 spin_unlock_bh(&sta->lock); in ieee80211_check_fast_xmit()
2653 struct sta_info *sta; in ieee80211_check_fast_xmit_all() local
2656 list_for_each_entry_rcu(sta, &local->sta_list, list) in ieee80211_check_fast_xmit_all()
2657 ieee80211_check_fast_xmit(sta); in ieee80211_check_fast_xmit_all()
2664 struct sta_info *sta; in ieee80211_check_fast_xmit_iface() local
2668 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_check_fast_xmit_iface()
2669 if (sdata != sta->sdata && in ieee80211_check_fast_xmit_iface()
2670 (!sta->sdata->bss || sta->sdata->bss != sdata->bss)) in ieee80211_check_fast_xmit_iface()
2672 ieee80211_check_fast_xmit(sta); in ieee80211_check_fast_xmit_iface()
2678 void ieee80211_clear_fast_xmit(struct sta_info *sta) in ieee80211_clear_fast_xmit() argument
2682 spin_lock_bh(&sta->lock); in ieee80211_clear_fast_xmit()
2683 fast_tx = rcu_dereference_protected(sta->fast_tx, in ieee80211_clear_fast_xmit()
2684 lockdep_is_held(&sta->lock)); in ieee80211_clear_fast_xmit()
2685 RCU_INIT_POINTER(sta->fast_tx, NULL); in ieee80211_clear_fast_xmit()
2686 spin_unlock_bh(&sta->lock); in ieee80211_clear_fast_xmit()
2693 struct net_device *dev, struct sta_info *sta, in ieee80211_xmit_fast() argument
2723 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); in ieee80211_xmit_fast()
2773 if (!sta->sta.txq[0]) in ieee80211_xmit_fast()
2774 hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid); in ieee80211_xmit_fast()
2782 sta->tx_stats.msdu[tid] += in ieee80211_xmit_fast()
2785 sta->tx_stats.msdu[tid]++; in ieee80211_xmit_fast()
2794 tx.sta = sta; in ieee80211_xmit_fast()
2816 sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len; in ieee80211_xmit_fast()
2817 sta->tx_stats.packets[skb_get_queue_mapping(skb)]++; in ieee80211_xmit_fast()
2844 ieee80211_tx_frags(local, &sdata->vif, &sta->sta, &tx.skbs, false); in ieee80211_xmit_fast()
2853 struct sta_info *sta; in __ieee80211_subif_start_xmit() local
2863 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) in __ieee80211_subif_start_xmit()
2866 if (!IS_ERR_OR_NULL(sta)) { in __ieee80211_subif_start_xmit()
2869 fast_tx = rcu_dereference(sta->fast_tx); in __ieee80211_subif_start_xmit()
2872 ieee80211_xmit_fast(sdata, dev, sta, fast_tx, skb)) in __ieee80211_subif_start_xmit()
2913 skb = ieee80211_build_hdr(sdata, skb, info_flags, sta); in __ieee80211_subif_start_xmit()
2919 ieee80211_xmit(sdata, sta, skb); in __ieee80211_subif_start_xmit()
2951 struct sta_info *sta; in ieee80211_build_data_template() local
2955 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) { in ieee80211_build_data_template()
2961 skb = ieee80211_build_hdr(sdata, skb, info_flags, sta); in ieee80211_build_data_template()
2966 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
3005 struct sta_info *sta; in ieee80211_tx_pending_skb() local
3027 sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_pending_skb()
3029 result = __ieee80211_tx(local, &skbs, skb->len, sta, true); in ieee80211_tx_pending_skb()
3803 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_reserve_tid() local
3804 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_reserve_tid()
3825 if (sta->reserved_tid == tid) { in ieee80211_reserve_tid()
3830 if (sta->reserved_tid != IEEE80211_TID_UNRESERVED) { in ieee80211_reserve_tid()
3843 set_sta_flag(sta, WLAN_STA_BLOCK_BA); in ieee80211_reserve_tid()
3844 __ieee80211_stop_tx_ba_session(sta, tid, in ieee80211_reserve_tid()
3851 sta->reserved_tid = tid; in ieee80211_reserve_tid()
3857 clear_sta_flag(sta, WLAN_STA_BLOCK_BA); in ieee80211_reserve_tid()
3867 struct sta_info *sta = container_of(pubsta, struct sta_info, sta); in ieee80211_unreserve_tid() local
3868 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_unreserve_tid()
3883 if (tid != sta->reserved_tid) { in ieee80211_unreserve_tid()
3888 sta->reserved_tid = IEEE80211_TID_UNRESERVED; in ieee80211_unreserve_tid()