Lines Matching refs:sta
57 * Note that the sta can get destroyed before the BA tear down is
142 void ieee80211_assign_tid_tx(struct sta_info *sta, int tid,
145 lockdep_assert_held(&sta->ampdu_mlme.mtx);
146 lockdep_assert_held(&sta->lock);
147 rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], tid_tx);
190 ieee80211_agg_stop_txq(struct sta_info *sta, int tid)
192 struct ieee80211_txq *txq = sta->sta.txq[tid];
211 ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable)
213 struct ieee80211_txq *txq = sta->sta.txq[tid];
216 lockdep_assert_held(&sta->ampdu_mlme.mtx);
231 schedule_and_wake_txq(sta->sdata->local, txqi);
270 static void ieee80211_remove_tid_tx(struct sta_info *sta, int tid)
274 lockdep_assert_held(&sta->ampdu_mlme.mtx);
275 lockdep_assert_held(&sta->lock);
277 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
289 ieee80211_agg_splice_packets(sta->sdata, tid_tx, tid);
292 ieee80211_assign_tid_tx(sta, tid, NULL);
294 ieee80211_agg_splice_finish(sta->sdata, tid);
299 int ___ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
302 struct ieee80211_local *local = sta->local;
305 .sta = &sta->sta,
314 lockdep_assert_held(&sta->ampdu_mlme.mtx);
330 spin_lock_bh(&sta->lock);
333 tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
335 sta->ampdu_mlme.tid_start_tx[tid] = NULL;
337 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
339 spin_unlock_bh(&sta->lock);
348 spin_unlock_bh(&sta->lock);
352 ret = drv_ampdu_action(local, sta->sdata, ¶ms);
359 ieee80211_assign_tid_tx(sta, tid, NULL);
360 spin_unlock_bh(&sta->lock);
367 ieee80211_agg_stop_txq(sta, tid);
369 spin_unlock_bh(&sta->lock);
371 ht_dbg(sta->sdata, "Tx BA session stop requested for %pM tid %u\n",
372 sta->sta.addr, tid);
404 ret = drv_ampdu_action(local, sta->sdata, ¶ms);
435 struct sta_info *sta = tid_tx->sta;
440 ht_dbg(sta->sdata,
442 sta->sta.addr, tid);
446 ht_dbg(sta->sdata, "addBA response timer expired on %pM tid %d\n",
447 sta->sta.addr, tid);
449 ieee80211_stop_tx_ba_session(&sta->sta, tid);
452 static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
455 struct ieee80211_sub_if_data *sdata = sta->sdata;
456 struct ieee80211_local *local = sta->local;
464 lockdep_assert_held(&sta->ampdu_mlme.mtx);
469 sta->sta.addr, tid);
471 spin_lock_bh(&sta->lock);
472 sta->ampdu_mlme.last_addba_req_time[tid] = jiffies;
473 sta->ampdu_mlme.addba_req_num[tid]++;
474 spin_unlock_bh(&sta->lock);
476 if (sta->sta.deflink.he_cap.has_he) {
489 ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
496 void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
499 struct ieee80211_local *local = sta->local;
502 .sta = &sta->sta,
511 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
528 sdata = sta->sdata;
529 params.ssn = sta->tid_seq[tid] >> 4;
547 sta->sta.addr, tid);
548 spin_lock_bh(&sta->lock);
550 ieee80211_assign_tid_tx(sta, tid, NULL);
552 spin_unlock_bh(&sta->lock);
554 ieee80211_agg_start_txq(sta, tid, false);
560 ieee80211_send_addba_with_timeout(sta, tid_tx);
566 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
572 tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
587 struct sta_info *sta = tid_tx->sta;
601 ht_dbg(sta->sdata, "tx session timer expired on %pM tid %d\n",
602 sta->sta.addr, tid);
604 ieee80211_stop_tx_ba_session(&sta->sta, tid);
610 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
611 struct ieee80211_sub_if_data *sdata = sta->sdata;
618 if (WARN(sta->reserved_tid == tid,
623 sta->sdata->vif.bss_conf.chandef.chan->band != NL80211_BAND_6GHZ)
647 if (test_sta_flag(sta, WLAN_STA_BLOCK_BA)) {
650 sta->sta.addr, tid);
654 if (test_sta_flag(sta, WLAN_STA_MFP) &&
655 !test_sta_flag(sta, WLAN_STA_AUTHORIZED)) {
658 sta->sta.addr, tid);
674 if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC &&
675 !sta->sta.deflink.ht_cap.ht_supported) {
682 spin_lock_bh(&sta->lock);
685 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_MAX_RETRIES) {
695 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES &&
696 time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] +
700 sta->ampdu_mlme.addba_req_num[tid], sta->sta.addr, tid);
705 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
707 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) {
710 sta->sta.addr, tid);
726 tid_tx->sta = sta;
737 sta->ampdu_mlme.dialog_token_allocator++;
738 tid_tx->dialog_token = sta->ampdu_mlme.dialog_token_allocator;
744 sta->ampdu_mlme.tid_start_tx[tid] = tid_tx;
746 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work);
750 spin_unlock_bh(&sta->lock);
756 struct sta_info *sta, u16 tid)
760 .sta = &sta->sta,
767 lockdep_assert_held(&sta->ampdu_mlme.mtx);
769 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
773 ht_dbg(sta->sdata, "Aggregation is on for %pM tid %d\n",
774 sta->sta.addr, tid);
776 drv_ampdu_action(local, sta->sdata, ¶ms);
782 spin_lock_bh(&sta->lock);
784 ieee80211_agg_splice_packets(sta->sdata, tid_tx, tid);
791 ieee80211_agg_splice_finish(sta->sdata, tid);
793 spin_unlock_bh(&sta->lock);
795 ieee80211_agg_start_txq(sta, tid, true);
798 void ieee80211_start_tx_ba_cb(struct sta_info *sta, int tid,
801 struct ieee80211_sub_if_data *sdata = sta->sdata;
804 lockdep_assert_held(&sta->ampdu_mlme.mtx);
814 ieee80211_send_addba_with_timeout(sta, tid_tx);
820 ieee80211_agg_tx_operational(local, sta, tid);
825 const u8 *ra, u16 tid, struct sta_info **sta)
835 *sta = sta_info_get_bss(sdata, ra);
836 if (!*sta) {
841 tid_tx = rcu_dereference((*sta)->ampdu_mlme.tid_tx[tid]);
854 struct sta_info *sta;
860 tid_tx = ieee80211_lookup_tid_tx(sdata, ra, tid, &sta);
865 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work);
871 int __ieee80211_stop_tx_ba_session(struct sta_info *sta, u16 tid,
876 mutex_lock(&sta->ampdu_mlme.mtx);
878 ret = ___ieee80211_stop_tx_ba_session(sta, tid, reason);
880 mutex_unlock(&sta->ampdu_mlme.mtx);
887 struct sta_info *sta = container_of(pubsta, struct sta_info, sta);
888 struct ieee80211_sub_if_data *sdata = sta->sdata;
901 spin_lock_bh(&sta->lock);
902 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
909 WARN(sta->reserved_tid == tid,
919 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work);
922 spin_unlock_bh(&sta->lock);
927 void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid,
930 struct ieee80211_sub_if_data *sdata = sta->sdata;
935 sta->sta.addr, tid);
937 spin_lock_bh(&sta->lock);
942 sta->sta.addr, tid);
949 ieee80211_remove_tid_tx(sta, tid);
953 spin_unlock_bh(&sta->lock);
956 ieee80211_agg_start_txq(sta, tid, false);
959 ieee80211_send_delba(sdata, sta->sta.addr, tid,
968 struct sta_info *sta;
974 tid_tx = ieee80211_lookup_tid_tx(sdata, ra, tid, &sta);
979 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work);
987 struct sta_info *sta,
1002 txq = sta->sta.txq[tid];
1006 mutex_lock(&sta->ampdu_mlme.mtx);
1008 tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
1013 ht_dbg(sta->sdata, "wrong addBA response token, %pM tid %d\n",
1014 sta->sta.addr, tid);
1020 ht_dbg(sta->sdata, "switched off addBA timer for %pM tid %d\n",
1021 sta->sta.addr, tid);
1030 ht_dbg(sta->sdata,
1032 sta->sta.addr, tid);
1054 ieee80211_agg_tx_operational(local, sta, tid);
1056 sta->ampdu_mlme.addba_req_num[tid] = 0;
1068 ___ieee80211_stop_tx_ba_session(sta, tid, AGG_STOP_DECLINED);
1072 mutex_unlock(&sta->ampdu_mlme.mtx);