Lines Matching defs:sta

310 	if (tx->sta)
311 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC);
345 struct sta_info *sta;
369 list_for_each_entry_rcu(sta, &local->sta_list, list) {
373 skb = skb_dequeue(&sta->ps_tx_buf[ac]);
374 total += skb_queue_len(&sta->ps_tx_buf[ac]);
452 static int ieee80211_use_mfp(__le16 fc, struct sta_info *sta,
458 if (sta == NULL || !test_sta_flag(sta, WLAN_STA_MFP))
470 struct sta_info *sta = tx->sta;
475 if (unlikely(!sta))
478 if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) ||
479 test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
480 test_sta_flag(sta, WLAN_STA_PS_DELIVER)) &&
490 ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n",
491 sta->sta.addr, sta->sta.aid, ac);
496 spin_lock(&sta->ps_lock);
502 if (!test_sta_flag(sta, WLAN_STA_PS_STA) &&
503 !test_sta_flag(sta, WLAN_STA_PS_DRIVER) &&
504 !test_sta_flag(sta, WLAN_STA_PS_DELIVER)) {
505 spin_unlock(&sta->ps_lock);
509 if (skb_queue_len(&sta->ps_tx_buf[ac]) >= STA_MAX_TX_BUFFER) {
510 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf[ac]);
513 sta->sta.addr, ac);
522 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb);
523 spin_unlock(&sta->ps_lock);
534 sta_info_recalc_tim(sta);
537 } else if (unlikely(test_sta_flag(sta, WLAN_STA_PS_STA))) {
540 sta->sta.addr);
614 if (tx->sta &&
615 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx])))
642 !ieee80211_use_mfp(hdr->frame_control, tx->sta,
668 } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta &&
669 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) {
733 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE))))
742 if (tx->sta)
743 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC);
747 * talk to the sta. This should not happen.
750 !rate_usable_index_exists(sband, &tx->sta->sta),
760 * If we're associated with the sta at this point we know we can at
763 rate_control_get_rate(tx->sdata, tx->sta, &txrc);
765 if (tx->sta && !info->control.skip_table)
766 ratetbl = rcu_dereference(tx->sta->sta.rates);
789 if (tx->sta && ieee80211_is_tx_data(tx->skb))
790 tx->sta->deflink.tx_stats.last_rate = txrc.reported_rate;
791 } else if (tx->sta)
792 tx->sta->deflink.tx_stats.last_rate = txrc.reported_rate;
807 static __le16 ieee80211_tx_next_seq(struct sta_info *sta, int tid)
809 u16 *seq = &sta->tid_seq[tid];
868 if (tx->sta)
869 tx->sta->deflink.tx_stats.msdu[IEEE80211_NUM_TIDS]++;
878 if (!tx->sta)
883 tx->sta->deflink.tx_stats.msdu[tid]++;
885 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid);
1031 if (!tx->sta)
1036 tx->sta->deflink.tx_stats.bytes[ac] += skb->len;
1039 tx->sta->deflink.tx_stats.packets[ac]++;
1122 } else if (!tx->sta->sta.txq[tid]) {
1123 spin_lock(&tx->sta->lock);
1142 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid);
1151 clear_sta_flag(tx->sta, WLAN_STA_SP);
1152 ps_dbg(tx->sta->sdata,
1154 tx->sta->sta.addr, tx->sta->sta.aid);
1163 spin_unlock(&tx->sta->lock);
1177 struct sta_info *sta, struct sk_buff *skb)
1185 if (!sta || !sta->sta.deflink.ht_cap.ht_supported ||
1186 !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO ||
1191 if (likely(sta->ampdu_mlme.tid_tx[tid]))
1194 ieee80211_start_tx_ba_session(&sta->sta, tid, 0);
1205 struct sta_info *sta, struct sk_buff *skb)
1228 if (likely(sta)) {
1229 if (!IS_ERR(sta))
1230 tx->sta = sta;
1233 tx->sta = rcu_dereference(sdata->u.vlan.sta);
1234 if (!tx->sta && sdata->wdev.use_4addr)
1237 tx->sta = sta_info_get_bss(sdata, hdr->addr1);
1239 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) {
1240 tx->sta = sta_info_get(sdata, hdr->addr1);
1245 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
1252 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
1254 ieee80211_aggr_check(sdata, tx->sta, skb);
1255 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
1282 if (!tx->sta)
1284 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) {
1286 ieee80211_check_fast_xmit(tx->sta);
1296 struct sta_info *sta,
1312 sta && sta->uploaded) {
1317 txq = sta->sta.txq[IEEE80211_NUM_TIDS];
1319 } else if (sta) {
1322 if (!sta->uploaded)
1325 txq = sta->sta.txq[tid];
1406 if (txqi->txq.sta) {
1407 struct sta_info *sta = container_of(txqi->txq.sta,
1408 struct sta_info, sta);
1409 cparams = &sta->cparams;
1504 struct sta_info *sta,
1515 if (!sta) {
1539 txqi->txq.sta = &sta->sta;
1541 sta->sta.txq[tid] = &txqi->txq;
1643 struct sta_info *sta,
1657 txqi = ieee80211_get_txq(local, vif, sta, skb);
1671 struct sta_info *sta,
1733 control.sta = sta ? &sta->sta : NULL;
1746 struct sk_buff_head *skbs, struct sta_info *sta,
1761 if (sta && !sta->uploaded)
1762 sta = NULL;
1790 result = ieee80211_tx_frags(local, vif, sta, skbs, txpending);
1839 * Late handlers can be called while the sta lock is held. Handlers that can
1893 int band, struct ieee80211_sta **sta)
1910 if (sta) {
1911 if (tx.sta)
1912 *sta = &tx.sta->sta;
1914 *sta = NULL;
1933 struct sta_info *sta, struct sk_buff *skb,
1948 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb);
1966 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb))
1970 result = __ieee80211_tx(local, &tx.skbs, tx.sta, txpending);
2021 struct sta_info *sta, struct sk_buff *skb)
2062 ieee80211_tx(sdata, sta, skb, false);
2476 struct sta_info *sta;
2480 sta = rcu_dereference(sdata->u.vlan.sta);
2481 if (sta) {
2482 *sta_out = sta;
2495 sta = sta_info_get_bss(sdata, skb->data);
2505 sta = sta_info_get(sdata, skb->data);
2506 if (sta && test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
2507 if (test_sta_flag(sta,
2509 *sta_out = sta;
2517 * after a TDLS sta is removed due to being
2526 sta = sta_info_get(sdata, sdata->vif.cfg.ap_addr);
2527 if (!sta)
2534 *sta_out = sta ?: ERR_PTR(-ENOENT);
2580 * @sta: the station pointer
2598 struct sta_info *sta, u32 ctrl_flags,
2620 if (IS_ERR(sta))
2621 sta = NULL;
2642 memcpy(hdr.addr1, sta->sta.addr, ETH_ALEN);
2647 authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
2648 wme_sta = sta->sta.wme;
2668 if (ieee80211_vif_is_mld(&sdata->vif) && sta && !sta->sta.mlo) {
2671 link_id = sta->deflink.link_id;
2679 (sta && sta->sta.mlo)) {
2773 tdls_peer = test_sta_flag(sta, WLAN_STA_TDLS_PEER);
2777 int tdls_link_id = sta->sta.valid_links ?
2778 __ffs(sta->sta.valid_links) : 0;
2842 /* sta is always NULL for mesh */
2843 if (sta) {
2844 authorized = test_sta_flag(sta, WLAN_STA_AUTHORIZED);
2845 wme_sta = sta->sta.wme;
3010 * checks that are needed to get the sta->fast_tx pointer assigned, after which
3026 void ieee80211_check_fast_xmit(struct sta_info *sta)
3029 struct ieee80211_local *local = sta->local;
3030 struct ieee80211_sub_if_data *sdata = sta->sdata;
3039 mesh_fast_tx_flush_sta(sdata, sta);
3053 spin_lock_bh(&sta->lock);
3059 if (!test_sta_flag(sta, WLAN_STA_AUTHORIZED) || !sta->uploaded)
3062 if (test_sta_flag(sta, WLAN_STA_PS_STA) ||
3063 test_sta_flag(sta, WLAN_STA_PS_DRIVER) ||
3064 test_sta_flag(sta, WLAN_STA_PS_DELIVER) ||
3065 test_sta_flag(sta, WLAN_STA_CLEAR_PS_FILT))
3102 if (test_sta_flag(sta, WLAN_STA_TDLS_PEER)) {
3104 int tdls_link_id = sta->sta.valid_links ?
3105 __ffs(sta->sta.valid_links) : 0;
3144 memcpy(hdr->addr1, sta->sta.addr, ETH_ALEN);
3156 if (sta->sta.mlo || !ieee80211_vif_is_mld(&sdata->vif)) {
3159 unsigned int link_id = sta->deflink.link_id;
3179 if (sta->sta.wme) {
3189 build.key = rcu_access_pointer(sta->ptk[sta->ptk_idx]);
3267 old = rcu_dereference_protected(sta->fast_tx,
3268 lockdep_is_held(&sta->lock));
3269 rcu_assign_pointer(sta->fast_tx, fast_tx);
3272 spin_unlock_bh(&sta->lock);
3277 struct sta_info *sta;
3280 list_for_each_entry_rcu(sta, &local->sta_list, list)
3281 ieee80211_check_fast_xmit(sta);
3288 struct sta_info *sta;
3292 list_for_each_entry_rcu(sta, &local->sta_list, list) {
3293 if (sdata != sta->sdata &&
3294 (!sta->sdata->bss || sta->sdata->bss != sdata->bss))
3296 ieee80211_check_fast_xmit(sta);
3302 void ieee80211_clear_fast_xmit(struct sta_info *sta)
3306 spin_lock_bh(&sta->lock);
3307 fast_tx = rcu_dereference_protected(sta->fast_tx,
3308 lockdep_is_held(&sta->lock));
3309 RCU_INIT_POINTER(sta->fast_tx, NULL);
3310 spin_unlock_bh(&sta->lock);
3400 struct sta_info *sta,
3410 struct ieee80211_txq *txq = sta->sta.txq[tid];
3414 u8 max_subframes = sta->sta.max_amsdu_subframes;
3416 int max_amsdu_len = sta->sta.cur->max_amsdu_len;
3445 if (sta->sta.cur->max_rc_amsdu_len)
3447 sta->sta.cur->max_rc_amsdu_len);
3449 if (sta->sta.cur->max_tid_amsdu_len[tid])
3451 sta->sta.cur->max_tid_amsdu_len[tid]);
3546 * Can be called while the sta lock is held. Anything that can cause packets to
3551 struct sta_info *sta, u8 pn_offs,
3571 hdr->seq_ctrl = ieee80211_tx_next_seq(sta, tid);
3579 sta->deflink.tx_stats.msdu[tid] +=
3582 sta->deflink.tx_stats.msdu[tid]++;
3589 sta->deflink.tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
3590 sta->deflink.tx_stats.packets[skb_get_queue_mapping(skb)]++;
3669 struct sta_info *sta,
3687 ieee80211_amsdu_aggregate(sdata, sta, fast_tx, skb, da, sa))
3731 tx.sta = sta;
3734 if (ieee80211_queue_skb(local, sdata, sta, skb))
3738 r = ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs,
3749 ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false);
3757 struct sta_info *sta,
3782 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
3800 __ieee80211_xmit_fast(sdata, sta, fast_tx, skb, tid_tx,
3871 if (txq->sta) {
3872 tx.sta = container_of(txq->sta, struct sta_info, sta);
3882 !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) &&
3919 struct sta_info *sta = container_of(txq->sta, struct sta_info,
3920 sta);
3927 r = ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs,
3986 if (tx.sta &&
3991 airtime = ieee80211_calc_expected_tx_airtime(hw, vif, txq->sta,
3995 ieee80211_sta_update_pending_airtime(local, tx.sta,
4011 static inline s32 ieee80211_sta_deficit(struct sta_info *sta, u8 ac)
4013 struct airtime_info *air_info = &sta->airtime[ac];
4021 struct sta_info *sta;
4023 if (!txqi->txq.sta)
4026 sta = container_of(txqi->txq.sta, struct sta_info, sta);
4027 sta->airtime[txqi->txq.ac].last_active = jiffies;
4033 struct sta_info *sta;
4035 if (!txqi->txq.sta)
4038 sta = container_of(txqi->txq.sta, struct sta_info, sta);
4039 if (ieee80211_sta_deficit(sta, txqi->txq.ac) >= 0)
4042 return ieee80211_sta_keep_active(sta, txqi->txq.ac);
4074 if (txqi->txq.sta) {
4075 struct sta_info *sta = container_of(txqi->txq.sta,
4076 struct sta_info, sta);
4078 s32 deficit = ieee80211_sta_deficit(sta, txqi->txq.ac);
4084 sta->airtime[txqi->txq.ac].deficit +=
4085 sta->airtime_weight;
4127 if (txqi->txq.sta && local->airtime_flags && has_queue &&
4148 struct sta_info *sta;
4157 if (!txq->sta)
4163 sta = container_of(txq->sta, struct sta_info, sta);
4164 if (atomic_read(&sta->airtime[txq->ac].aql_tx_pending) <
4165 sta->airtime[txq->ac].aql_limit_low)
4170 atomic_read(&sta->airtime[txq->ac].aql_tx_pending) <
4171 sta->airtime[txq->ac].aql_limit_high)
4202 struct sta_info *sta;
4207 if (!txqi->txq.sta)
4221 if (!iter->txq.sta) {
4226 sta = container_of(iter->txq.sta, struct sta_info, sta);
4227 if (ieee80211_sta_deficit(sta, ac) < 0)
4228 sta->airtime[ac].deficit += sta->airtime_weight;
4232 sta = container_of(txqi->txq.sta, struct sta_info, sta);
4233 if (sta->airtime[ac].deficit >= 0)
4236 sta->airtime[ac].deficit += sta->airtime_weight;
4276 struct sta_info *sta;
4294 if (ieee80211_lookup_ra_sta(sdata, skb, &sta))
4297 if (IS_ERR(sta))
4298 sta = NULL;
4300 skb_set_queue_mapping(skb, ieee80211_select_queue(sdata, sta, skb));
4301 ieee80211_aggr_check(sdata, sta, skb);
4303 if (sta) {
4306 fast_tx = rcu_dereference(sta->fast_tx);
4309 ieee80211_xmit_fast(sdata, sta, fast_tx, skb))
4330 sta, ctrl_flags, cookie);
4338 ieee80211_xmit(sdata, sta, skb);
4350 static int ieee80211_change_da(struct sk_buff *skb, struct sta_info *sta)
4360 ether_addr_copy(eth->h_dest, sta->sta.addr);
4375 if (sdata->u.vlan.sta)
4412 struct sta_info *sta, *first = NULL;
4417 list_for_each_entry_rcu(sta, &local->sta_list, list) {
4418 if (sdata != sta->sdata)
4421 if (unlikely(ether_addr_equal(eth->h_source, sta->sta.addr)))
4425 first = sta;
4431 if (unlikely(ieee80211_change_da(cloned_skb, sta))) {
4543 struct sk_buff *skb, struct sta_info *sta,
4569 if (sta && sta->uploaded)
4570 pubsta = &sta->sta;
4572 control.sta = pubsta;
4580 struct sk_buff *skb, struct sta_info *sta,
4587 if (ieee80211_queue_skb(local, sdata, sta, skb))
4592 if (!__ieee80211_tx_8023(sdata, skb, sta, txpending))
4600 struct net_device *dev, struct sta_info *sta,
4611 queue = ieee80211_select_queue(sdata, sta, skb);
4622 ieee80211_aggr_check(sdata, sta, skb);
4625 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
4674 sta->deflink.tx_stats.packets[queue] += skbs;
4675 sta->deflink.tx_stats.bytes[queue] += len;
4679 ieee80211_tx_8023(sdata, skb, sta, false);
4693 struct sta_info *sta;
4702 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) {
4707 if (unlikely(IS_ERR_OR_NULL(sta) || !sta->uploaded ||
4708 !test_sta_flag(sta, WLAN_STA_AUTHORIZED) ||
4712 key = rcu_dereference(sta->ptk[sta->ptk_idx]);
4721 ieee80211_8023_xmit(sdata, dev, sta, key, skb);
4741 struct sta_info *sta;
4745 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) {
4751 skb = ieee80211_build_hdr(sdata, skb, info_flags, sta,
4757 tx.sta = sta_info_get(sdata, hdr->addr1);
4796 struct sta_info *sta;
4816 if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) {
4821 if (IS_ERR(sta) || (sta && !sta->uploaded))
4822 sta = NULL;
4824 result = ieee80211_tx_8023(sdata, skb, sta, true);
4832 sta = sta_info_get(sdata, hdr->addr1);
4834 result = __ieee80211_tx(local, &skbs, sta, true);
5767 struct sta_info *sta;
5769 sta = sta_info_get(sdata, vif->cfg.ap_addr);
5770 qos = sta && sta->sta.wme;
5961 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
5962 struct ieee80211_sub_if_data *sdata = sta->sdata;
5983 if (sta->reserved_tid == tid) {
5988 if (sta->reserved_tid != IEEE80211_TID_UNRESERVED) {
6001 set_sta_flag(sta, WLAN_STA_BLOCK_BA);
6002 __ieee80211_stop_tx_ba_session(sta, tid,
6009 sta->reserved_tid = tid;
6015 clear_sta_flag(sta, WLAN_STA_BLOCK_BA);
6025 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
6026 struct ieee80211_sub_if_data *sdata = sta->sdata;
6041 if (tid != sta->reserved_tid) {
6046 sta->reserved_tid = IEEE80211_TID_UNRESERVED;
6142 struct sta_info *sta;
6220 err = ieee80211_lookup_ra_sta(sdata, skb, &sta);
6227 if (!IS_ERR(sta)) {
6228 u16 queue = ieee80211_select_queue(sdata, sta, skb);
6236 if (sta && sta->sta.mlo)