• Home
  • Raw
  • Download

Lines Matching +full:local +full:- +full:timer +full:- +full:stop

5  * Copyright 2002-2005, Instant802 Networks, Inc.
6 * Copyright 2005-2006, Devicescape Software, Inc.
7 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
9 * Copyright 2007-2010, Intel Corporation
10 * Copyright(c) 2015-2017 Intel Deutschland GmbH
11 * Copyright (C) 2018 - 2019 Intel Corporation
23 #include "driver-ops.h"
27 * DOC: TX A-MPDU aggregation
31 * packets with a flag indicating A-MPDU aggregation. The driver
69 struct ieee80211_local *local = sdata->local; in ieee80211_send_addba_request() local
74 skb = dev_alloc_skb(sizeof(*mgmt) + local->hw.extra_tx_headroom); in ieee80211_send_addba_request()
79 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_send_addba_request()
81 memcpy(mgmt->da, da, ETH_ALEN); in ieee80211_send_addba_request()
82 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); in ieee80211_send_addba_request()
83 if (sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_send_addba_request()
84 sdata->vif.type == NL80211_IFTYPE_AP_VLAN || in ieee80211_send_addba_request()
85 sdata->vif.type == NL80211_IFTYPE_MESH_POINT) in ieee80211_send_addba_request()
86 memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); in ieee80211_send_addba_request()
87 else if (sdata->vif.type == NL80211_IFTYPE_STATION) in ieee80211_send_addba_request()
88 memcpy(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN); in ieee80211_send_addba_request()
89 else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) in ieee80211_send_addba_request()
90 memcpy(mgmt->bssid, sdata->u.ibss.bssid, ETH_ALEN); in ieee80211_send_addba_request()
92 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | in ieee80211_send_addba_request()
95 skb_put(skb, 1 + sizeof(mgmt->u.action.u.addba_req)); in ieee80211_send_addba_request()
97 mgmt->u.action.category = WLAN_CATEGORY_BACK; in ieee80211_send_addba_request()
98 mgmt->u.action.u.addba_req.action_code = WLAN_ACTION_ADDBA_REQ; in ieee80211_send_addba_request()
100 mgmt->u.action.u.addba_req.dialog_token = dialog_token; in ieee80211_send_addba_request()
101 capab = (u16)(1 << 0); /* bit 0 A-MSDU support */ in ieee80211_send_addba_request()
106 mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab); in ieee80211_send_addba_request()
108 mgmt->u.action.u.addba_req.timeout = cpu_to_le16(timeout); in ieee80211_send_addba_request()
109 mgmt->u.action.u.addba_req.start_seq_num = in ieee80211_send_addba_request()
118 struct ieee80211_local *local = sdata->local; in ieee80211_send_bar() local
123 skb = dev_alloc_skb(sizeof(*bar) + local->hw.extra_tx_headroom); in ieee80211_send_bar()
127 skb_reserve(skb, local->hw.extra_tx_headroom); in ieee80211_send_bar()
129 bar->frame_control = cpu_to_le16(IEEE80211_FTYPE_CTL | in ieee80211_send_bar()
131 memcpy(bar->ra, ra, ETH_ALEN); in ieee80211_send_bar()
132 memcpy(bar->ta, sdata->vif.addr, ETH_ALEN); in ieee80211_send_bar()
136 bar->control = cpu_to_le16(bar_control); in ieee80211_send_bar()
137 bar->start_seq_num = cpu_to_le16(ssn); in ieee80211_send_bar()
139 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT | in ieee80211_send_bar()
148 lockdep_assert_held(&sta->ampdu_mlme.mtx); in ieee80211_assign_tid_tx()
149 lockdep_assert_held(&sta->lock); in ieee80211_assign_tid_tx()
150 rcu_assign_pointer(sta->ampdu_mlme.tid_tx[tid], tid_tx); in ieee80211_assign_tid_tx()
156 * refcount the global queue stop caused by that in order
158 * setup or teardown re-enables queues before the other is
167 int queue = sdata->vif.hw_queue[ieee80211_ac_from_tid(tid)]; in __acquires()
171 if (atomic_inc_return(&sdata->local->agg_queue_stop[queue]) == 1) in __acquires()
173 &sdata->local->hw, queue, in __acquires()
182 int queue = sdata->vif.hw_queue[ieee80211_ac_from_tid(tid)]; in __releases()
184 if (atomic_dec_return(&sdata->local->agg_queue_stop[queue]) == 0) in __releases()
186 &sdata->local->hw, queue, in __releases()
195 struct ieee80211_txq *txq = sta->sta.txq[tid]; in ieee80211_agg_stop_txq()
204 sdata = vif_to_sdata(txq->vif); in ieee80211_agg_stop_txq()
205 fq = &sdata->local->fq; in ieee80211_agg_stop_txq()
208 spin_lock_bh(&fq->lock); in ieee80211_agg_stop_txq()
209 set_bit(IEEE80211_TXQ_STOP, &txqi->flags); in ieee80211_agg_stop_txq()
210 spin_unlock_bh(&fq->lock); in ieee80211_agg_stop_txq()
216 struct ieee80211_txq *txq = sta->sta.txq[tid]; in ieee80211_agg_start_txq()
225 set_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); in ieee80211_agg_start_txq()
227 clear_bit(IEEE80211_TXQ_AMPDU, &txqi->flags); in ieee80211_agg_start_txq()
229 clear_bit(IEEE80211_TXQ_STOP, &txqi->flags); in ieee80211_agg_start_txq()
232 drv_wake_tx_queue(sta->sdata->local, txqi); in ieee80211_agg_start_txq()
238 * splice packets from the STA's pending to the local pending,
245 struct ieee80211_local *local = sdata->local; in __acquires() local
246 int queue = sdata->vif.hw_queue[ieee80211_ac_from_tid(tid)]; in __acquires()
256 if (!skb_queue_empty(&tid_tx->pending)) { in __acquires()
257 spin_lock_irqsave(&local->queue_stop_reason_lock, flags); in __acquires()
259 skb_queue_splice_tail_init(&tid_tx->pending, in __acquires()
260 &local->pending[queue]); in __acquires()
261 spin_unlock_irqrestore(&local->queue_stop_reason_lock, flags); in __acquires()
275 lockdep_assert_held(&sta->ampdu_mlme.mtx); in ieee80211_remove_tid_tx()
276 lockdep_assert_held(&sta->lock); in ieee80211_remove_tid_tx()
284 * stop the queue now, we will not get any more packets, and any in ieee80211_remove_tid_tx()
290 ieee80211_agg_splice_packets(sta->sdata, tid_tx, tid); in ieee80211_remove_tid_tx()
295 ieee80211_agg_splice_finish(sta->sdata, tid); in ieee80211_remove_tid_tx()
304 struct ieee80211_local *local = sta->local; in ___ieee80211_stop_tx_ba_session() local
307 .sta = &sta->sta, in ___ieee80211_stop_tx_ba_session()
316 lockdep_assert_held(&sta->ampdu_mlme.mtx); in ___ieee80211_stop_tx_ba_session()
329 return -EINVAL; in ___ieee80211_stop_tx_ba_session()
332 spin_lock_bh(&sta->lock); in ___ieee80211_stop_tx_ba_session()
335 tid_tx = sta->ampdu_mlme.tid_start_tx[tid]; in ___ieee80211_stop_tx_ba_session()
337 sta->ampdu_mlme.tid_start_tx[tid] = NULL; in ___ieee80211_stop_tx_ba_session()
341 spin_unlock_bh(&sta->lock); in ___ieee80211_stop_tx_ba_session()
342 return -ENOENT; in ___ieee80211_stop_tx_ba_session()
346 * if we're already stopping ignore any new requests to stop in ___ieee80211_stop_tx_ba_session()
349 if (test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { in ___ieee80211_stop_tx_ba_session()
350 spin_unlock_bh(&sta->lock); in ___ieee80211_stop_tx_ba_session()
352 return -EALREADY; in ___ieee80211_stop_tx_ba_session()
354 ret = drv_ampdu_action(local, sta->sdata, &params); in ___ieee80211_stop_tx_ba_session()
359 if (test_bit(HT_AGG_STATE_WANT_START, &tid_tx->state)) { in ___ieee80211_stop_tx_ba_session()
362 spin_unlock_bh(&sta->lock); in ___ieee80211_stop_tx_ba_session()
367 set_bit(HT_AGG_STATE_STOPPING, &tid_tx->state); in ___ieee80211_stop_tx_ba_session()
371 spin_unlock_bh(&sta->lock); in ___ieee80211_stop_tx_ba_session()
373 ht_dbg(sta->sdata, "Tx BA session stop requested for %pM tid %u\n", in ___ieee80211_stop_tx_ba_session()
374 sta->sta.addr, tid); in ___ieee80211_stop_tx_ba_session()
376 del_timer_sync(&tid_tx->addba_resp_timer); in ___ieee80211_stop_tx_ba_session()
377 del_timer_sync(&tid_tx->session_timer); in ___ieee80211_stop_tx_ba_session()
381 * to the driver but are put onto tid_tx->pending instead, in ___ieee80211_stop_tx_ba_session()
384 clear_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state); in ___ieee80211_stop_tx_ba_session()
398 if (!local->in_reconfig) in ___ieee80211_stop_tx_ba_session()
401 tid_tx->stop_initiator = reason == AGG_STOP_PEER_REQUEST ? in ___ieee80211_stop_tx_ba_session()
404 tid_tx->tx_stop = reason == AGG_STOP_LOCAL_REQUEST; in ___ieee80211_stop_tx_ba_session()
406 ret = drv_ampdu_action(local, sta->sdata, &params); in ___ieee80211_stop_tx_ba_session()
430 * After sending add Block Ack request we activated a timer until
432 * If this timer expires sta_addba_resp_timer_expired will be executed.
437 struct sta_info *sta = tid_tx->sta; in sta_addba_resp_timer_expired()
438 u8 tid = tid_tx->tid; in sta_addba_resp_timer_expired()
441 if (test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) { in sta_addba_resp_timer_expired()
442 ht_dbg(sta->sdata, in sta_addba_resp_timer_expired()
443 "timer expired on %pM tid %d not expecting addBA response\n", in sta_addba_resp_timer_expired()
444 sta->sta.addr, tid); in sta_addba_resp_timer_expired()
448 ht_dbg(sta->sdata, "addBA response timer expired on %pM tid %d\n", in sta_addba_resp_timer_expired()
449 sta->sta.addr, tid); in sta_addba_resp_timer_expired()
451 ieee80211_stop_tx_ba_session(&sta->sta, tid); in sta_addba_resp_timer_expired()
457 struct ieee80211_local *local = sta->local; in ieee80211_tx_ba_session_handle_start() local
458 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_tx_ba_session_handle_start()
460 .sta = &sta->sta, in ieee80211_tx_ba_session_handle_start()
477 clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); in ieee80211_tx_ba_session_handle_start()
483 * we have a valid starting sequence number and that in-flight in ieee80211_tx_ba_session_handle_start()
489 params.ssn = sta->tid_seq[tid] >> 4; in ieee80211_tx_ba_session_handle_start()
490 ret = drv_ampdu_action(local, sdata, &params); in ieee80211_tx_ba_session_handle_start()
493 "BA request denied - HW unavailable for %pM tid %d\n", in ieee80211_tx_ba_session_handle_start()
494 sta->sta.addr, tid); in ieee80211_tx_ba_session_handle_start()
495 spin_lock_bh(&sta->lock); in ieee80211_tx_ba_session_handle_start()
499 spin_unlock_bh(&sta->lock); in ieee80211_tx_ba_session_handle_start()
507 /* activate the timer for the recipient's addBA response */ in ieee80211_tx_ba_session_handle_start()
508 mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL); in ieee80211_tx_ba_session_handle_start()
509 ht_dbg(sdata, "activated addBA response timer on %pM tid %d\n", in ieee80211_tx_ba_session_handle_start()
510 sta->sta.addr, tid); in ieee80211_tx_ba_session_handle_start()
512 spin_lock_bh(&sta->lock); in ieee80211_tx_ba_session_handle_start()
513 sta->ampdu_mlme.last_addba_req_time[tid] = jiffies; in ieee80211_tx_ba_session_handle_start()
514 sta->ampdu_mlme.addba_req_num[tid]++; in ieee80211_tx_ba_session_handle_start()
515 spin_unlock_bh(&sta->lock); in ieee80211_tx_ba_session_handle_start()
517 if (sta->sta.he_cap.has_he) { in ieee80211_tx_ba_session_handle_start()
518 buf_size = local->hw.max_tx_aggregation_subframes; in ieee80211_tx_ba_session_handle_start()
530 ieee80211_send_addba_request(sdata, sta->sta.addr, tid, in ieee80211_tx_ba_session_handle_start()
531 tid_tx->dialog_token, params.ssn, in ieee80211_tx_ba_session_handle_start()
532 buf_size, tid_tx->timeout); in ieee80211_tx_ba_session_handle_start()
536 * After accepting the AddBA Response we activated a timer,
542 struct sta_info *sta = tid_tx->sta; in sta_tx_agg_session_timer_expired()
543 u8 tid = tid_tx->tid; in sta_tx_agg_session_timer_expired()
546 if (test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { in sta_tx_agg_session_timer_expired()
550 timeout = tid_tx->last_tx + TU_TO_JIFFIES(tid_tx->timeout); in sta_tx_agg_session_timer_expired()
552 mod_timer(&tid_tx->session_timer, timeout); in sta_tx_agg_session_timer_expired()
556 ht_dbg(sta->sdata, "tx session timer expired on %pM tid %d\n", in sta_tx_agg_session_timer_expired()
557 sta->sta.addr, tid); in sta_tx_agg_session_timer_expired()
559 ieee80211_stop_tx_ba_session(&sta->sta, tid); in sta_tx_agg_session_timer_expired()
566 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_start_tx_ba_session()
567 struct ieee80211_local *local = sdata->local; in ieee80211_start_tx_ba_session() local
573 if (WARN(sta->reserved_tid == tid, in ieee80211_start_tx_ba_session()
575 return -EINVAL; in ieee80211_start_tx_ba_session()
577 if (!pubsta->ht_cap.ht_supported) in ieee80211_start_tx_ba_session()
578 return -EINVAL; in ieee80211_start_tx_ba_session()
580 if (WARN_ON_ONCE(!local->ops->ampdu_action)) in ieee80211_start_tx_ba_session()
581 return -EINVAL; in ieee80211_start_tx_ba_session()
584 !ieee80211_hw_check(&local->hw, AMPDU_AGGREGATION) || in ieee80211_start_tx_ba_session()
585 ieee80211_hw_check(&local->hw, TX_AMPDU_SETUP_IN_HW)) in ieee80211_start_tx_ba_session()
586 return -EINVAL; in ieee80211_start_tx_ba_session()
589 return -EINVAL; in ieee80211_start_tx_ba_session()
592 pubsta->addr, tid); in ieee80211_start_tx_ba_session()
594 if (sdata->vif.type != NL80211_IFTYPE_STATION && in ieee80211_start_tx_ba_session()
595 sdata->vif.type != NL80211_IFTYPE_MESH_POINT && in ieee80211_start_tx_ba_session()
596 sdata->vif.type != NL80211_IFTYPE_AP_VLAN && in ieee80211_start_tx_ba_session()
597 sdata->vif.type != NL80211_IFTYPE_AP && in ieee80211_start_tx_ba_session()
598 sdata->vif.type != NL80211_IFTYPE_ADHOC) in ieee80211_start_tx_ba_session()
599 return -EINVAL; in ieee80211_start_tx_ba_session()
603 "BA sessions blocked - Denying BA session request %pM tid %d\n", in ieee80211_start_tx_ba_session()
604 sta->sta.addr, tid); in ieee80211_start_tx_ba_session()
605 return -EINVAL; in ieee80211_start_tx_ba_session()
609 * 802.11n-2009 11.5.1.1: If the initiating STA is an HT STA, is a in ieee80211_start_tx_ba_session()
620 if (sta->sdata->vif.type == NL80211_IFTYPE_ADHOC && in ieee80211_start_tx_ba_session()
621 !sta->sta.ht_cap.ht_supported) { in ieee80211_start_tx_ba_session()
623 "BA request denied - IBSS STA %pM does not advertise HT support\n", in ieee80211_start_tx_ba_session()
624 pubsta->addr); in ieee80211_start_tx_ba_session()
625 return -EINVAL; in ieee80211_start_tx_ba_session()
628 spin_lock_bh(&sta->lock); in ieee80211_start_tx_ba_session()
630 /* we have tried too many times, receiver does not want A-MPDU */ in ieee80211_start_tx_ba_session()
631 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_MAX_RETRIES) { in ieee80211_start_tx_ba_session()
632 ret = -EBUSY; in ieee80211_start_tx_ba_session()
641 if (sta->ampdu_mlme.addba_req_num[tid] > HT_AGG_BURST_RETRIES && in ieee80211_start_tx_ba_session()
642 time_before(jiffies, sta->ampdu_mlme.last_addba_req_time[tid] + in ieee80211_start_tx_ba_session()
645 "BA request denied - %d failed requests on %pM tid %u\n", in ieee80211_start_tx_ba_session()
646 sta->ampdu_mlme.addba_req_num[tid], sta->sta.addr, tid); in ieee80211_start_tx_ba_session()
647 ret = -EBUSY; in ieee80211_start_tx_ba_session()
653 if (tid_tx || sta->ampdu_mlme.tid_start_tx[tid]) { in ieee80211_start_tx_ba_session()
655 "BA request denied - session is not idle on %pM tid %u\n", in ieee80211_start_tx_ba_session()
656 sta->sta.addr, tid); in ieee80211_start_tx_ba_session()
657 ret = -EAGAIN; in ieee80211_start_tx_ba_session()
661 /* prepare A-MPDU MLME for Tx aggregation */ in ieee80211_start_tx_ba_session()
664 ret = -ENOMEM; in ieee80211_start_tx_ba_session()
668 skb_queue_head_init(&tid_tx->pending); in ieee80211_start_tx_ba_session()
669 __set_bit(HT_AGG_STATE_WANT_START, &tid_tx->state); in ieee80211_start_tx_ba_session()
671 tid_tx->timeout = timeout; in ieee80211_start_tx_ba_session()
672 tid_tx->sta = sta; in ieee80211_start_tx_ba_session()
673 tid_tx->tid = tid; in ieee80211_start_tx_ba_session()
675 /* response timer */ in ieee80211_start_tx_ba_session()
676 timer_setup(&tid_tx->addba_resp_timer, sta_addba_resp_timer_expired, 0); in ieee80211_start_tx_ba_session()
678 /* tx timer */ in ieee80211_start_tx_ba_session()
679 timer_setup(&tid_tx->session_timer, in ieee80211_start_tx_ba_session()
683 sta->ampdu_mlme.dialog_token_allocator++; in ieee80211_start_tx_ba_session()
684 tid_tx->dialog_token = sta->ampdu_mlme.dialog_token_allocator; in ieee80211_start_tx_ba_session()
690 sta->ampdu_mlme.tid_start_tx[tid] = tid_tx; in ieee80211_start_tx_ba_session()
692 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work); in ieee80211_start_tx_ba_session()
696 spin_unlock_bh(&sta->lock); in ieee80211_start_tx_ba_session()
701 static void ieee80211_agg_tx_operational(struct ieee80211_local *local, in ieee80211_agg_tx_operational() argument
706 .sta = &sta->sta, in ieee80211_agg_tx_operational()
713 lockdep_assert_held(&sta->ampdu_mlme.mtx); in ieee80211_agg_tx_operational()
716 params.buf_size = tid_tx->buf_size; in ieee80211_agg_tx_operational()
717 params.amsdu = tid_tx->amsdu; in ieee80211_agg_tx_operational()
719 ht_dbg(sta->sdata, "Aggregation is on for %pM tid %d\n", in ieee80211_agg_tx_operational()
720 sta->sta.addr, tid); in ieee80211_agg_tx_operational()
722 drv_ampdu_action(local, sta->sdata, &params); in ieee80211_agg_tx_operational()
728 spin_lock_bh(&sta->lock); in ieee80211_agg_tx_operational()
730 ieee80211_agg_splice_packets(sta->sdata, tid_tx, tid); in ieee80211_agg_tx_operational()
733 * in the TX path, and lets it go lock-free in in ieee80211_agg_tx_operational()
736 set_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state); in ieee80211_agg_tx_operational()
737 ieee80211_agg_splice_finish(sta->sdata, tid); in ieee80211_agg_tx_operational()
739 spin_unlock_bh(&sta->lock); in ieee80211_agg_tx_operational()
747 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_start_tx_ba_cb()
748 struct ieee80211_local *local = sdata->local; in ieee80211_start_tx_ba_cb() local
750 if (WARN_ON(test_and_set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state))) in ieee80211_start_tx_ba_cb()
753 if (test_bit(HT_AGG_STATE_RESPONSE_RECEIVED, &tid_tx->state)) in ieee80211_start_tx_ba_cb()
754 ieee80211_agg_tx_operational(local, sta, tid); in ieee80211_start_tx_ba_cb()
775 tid_tx = rcu_dereference((*sta)->ampdu_mlme.tid_tx[tid]); in ieee80211_lookup_tid_tx()
787 struct ieee80211_local *local = sdata->local; in ieee80211_start_tx_ba_cb_irqsafe() local
798 set_bit(HT_AGG_STATE_START_CB, &tid_tx->state); in ieee80211_start_tx_ba_cb_irqsafe()
799 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work); in ieee80211_start_tx_ba_cb_irqsafe()
810 mutex_lock(&sta->ampdu_mlme.mtx); in __ieee80211_stop_tx_ba_session()
814 mutex_unlock(&sta->ampdu_mlme.mtx); in __ieee80211_stop_tx_ba_session()
822 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_stop_tx_ba_session()
823 struct ieee80211_local *local = sdata->local; in ieee80211_stop_tx_ba_session() local
829 if (!local->ops->ampdu_action) in ieee80211_stop_tx_ba_session()
830 return -EINVAL; in ieee80211_stop_tx_ba_session()
833 return -EINVAL; in ieee80211_stop_tx_ba_session()
835 spin_lock_bh(&sta->lock); in ieee80211_stop_tx_ba_session()
839 ret = -ENOENT; in ieee80211_stop_tx_ba_session()
843 WARN(sta->reserved_tid == tid, in ieee80211_stop_tx_ba_session()
844 "Requested to stop BA session on reserved tid=%d", tid); in ieee80211_stop_tx_ba_session()
846 if (test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { in ieee80211_stop_tx_ba_session()
852 set_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state); in ieee80211_stop_tx_ba_session()
853 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work); in ieee80211_stop_tx_ba_session()
856 spin_unlock_bh(&sta->lock); in ieee80211_stop_tx_ba_session()
864 struct ieee80211_sub_if_data *sdata = sta->sdata; in ieee80211_stop_tx_ba_cb()
868 sta->sta.addr, tid); in ieee80211_stop_tx_ba_cb()
870 spin_lock_bh(&sta->lock); in ieee80211_stop_tx_ba_cb()
872 if (!test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { in ieee80211_stop_tx_ba_cb()
874 "unexpected callback to A-MPDU stop for %pM tid %d\n", in ieee80211_stop_tx_ba_cb()
875 sta->sta.addr, tid); in ieee80211_stop_tx_ba_cb()
879 if (tid_tx->stop_initiator == WLAN_BACK_INITIATOR && tid_tx->tx_stop) in ieee80211_stop_tx_ba_cb()
885 spin_unlock_bh(&sta->lock); in ieee80211_stop_tx_ba_cb()
888 ieee80211_send_delba(sdata, sta->sta.addr, tid, in ieee80211_stop_tx_ba_cb()
896 struct ieee80211_local *local = sdata->local; in ieee80211_stop_tx_ba_cb_irqsafe() local
907 set_bit(HT_AGG_STATE_STOP_CB, &tid_tx->state); in ieee80211_stop_tx_ba_cb_irqsafe()
908 ieee80211_queue_work(&local->hw, &sta->ampdu_mlme.work); in ieee80211_stop_tx_ba_cb_irqsafe()
915 void ieee80211_process_addba_resp(struct ieee80211_local *local, in ieee80211_process_addba_resp() argument
925 capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab); in ieee80211_process_addba_resp()
929 buf_size = min(buf_size, local->hw.max_tx_aggregation_subframes); in ieee80211_process_addba_resp()
931 txq = sta->sta.txq[tid]; in ieee80211_process_addba_resp()
933 set_bit(IEEE80211_TXQ_NO_AMSDU, &to_txq_info(txq)->flags); in ieee80211_process_addba_resp()
935 mutex_lock(&sta->ampdu_mlme.mtx); in ieee80211_process_addba_resp()
941 if (mgmt->u.action.u.addba_resp.dialog_token != tid_tx->dialog_token) { in ieee80211_process_addba_resp()
942 ht_dbg(sta->sdata, "wrong addBA response token, %pM tid %d\n", in ieee80211_process_addba_resp()
943 sta->sta.addr, tid); in ieee80211_process_addba_resp()
947 del_timer_sync(&tid_tx->addba_resp_timer); in ieee80211_process_addba_resp()
949 ht_dbg(sta->sdata, "switched off addBA timer for %pM tid %d\n", in ieee80211_process_addba_resp()
950 sta->sta.addr, tid); in ieee80211_process_addba_resp()
954 * caused WANT_STOP to be set. If the stop then was already in ieee80211_process_addba_resp()
957 if (test_bit(HT_AGG_STATE_WANT_STOP, &tid_tx->state) || in ieee80211_process_addba_resp()
958 test_bit(HT_AGG_STATE_STOPPING, &tid_tx->state)) { in ieee80211_process_addba_resp()
959 ht_dbg(sta->sdata, in ieee80211_process_addba_resp()
961 sta->sta.addr, tid); in ieee80211_process_addba_resp()
966 * IEEE 802.11-2007 7.3.1.14: in ieee80211_process_addba_resp()
971 if (le16_to_cpu(mgmt->u.action.u.addba_resp.status) in ieee80211_process_addba_resp()
974 &tid_tx->state)) { in ieee80211_process_addba_resp()
979 tid_tx->buf_size = buf_size; in ieee80211_process_addba_resp()
980 tid_tx->amsdu = amsdu; in ieee80211_process_addba_resp()
982 if (test_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state)) in ieee80211_process_addba_resp()
983 ieee80211_agg_tx_operational(local, sta, tid); in ieee80211_process_addba_resp()
985 sta->ampdu_mlme.addba_req_num[tid] = 0; in ieee80211_process_addba_resp()
987 tid_tx->timeout = in ieee80211_process_addba_resp()
988 le16_to_cpu(mgmt->u.action.u.addba_resp.timeout); in ieee80211_process_addba_resp()
990 if (tid_tx->timeout) { in ieee80211_process_addba_resp()
991 mod_timer(&tid_tx->session_timer, in ieee80211_process_addba_resp()
992 TU_TO_EXP_TIME(tid_tx->timeout)); in ieee80211_process_addba_resp()
993 tid_tx->last_tx = jiffies; in ieee80211_process_addba_resp()
1001 mutex_unlock(&sta->ampdu_mlme.mtx); in ieee80211_process_addba_resp()