Lines Matching +full:t +full:- +full:phy

1 // SPDX-License-Identifier: ISC
11 if (!txq->sta) in mt76_txq_get_qid()
14 return txq->ac; in mt76_txq_get_qid()
20 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; in mt76_tx_check_agg_ssn()
25 if (!sta || !ieee80211_is_data_qos(hdr->frame_control) || in mt76_tx_check_agg_ssn()
26 !ieee80211_is_data_present(hdr->frame_control)) in mt76_tx_check_agg_ssn()
29 tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; in mt76_tx_check_agg_ssn()
30 txq = sta->txq[tid]; in mt76_tx_check_agg_ssn()
31 mtxq = (struct mt76_txq *)txq->drv_priv; in mt76_tx_check_agg_ssn()
32 if (!mtxq->aggr) in mt76_tx_check_agg_ssn()
35 mtxq->agg_ssn = le16_to_cpu(hdr->seq_ctrl) + 0x10; in mt76_tx_check_agg_ssn()
41 __acquires(&dev->status_lock) in mt76_tx_status_lock()
44 spin_lock_bh(&dev->status_lock); in mt76_tx_status_lock()
50 __releases(&dev->status_lock) in mt76_tx_status_unlock()
55 spin_unlock_bh(&dev->status_lock); in mt76_tx_status_unlock()
67 wcid = rcu_dereference(dev->wcid[cb->wcid]); in mt76_tx_status_unlock()
70 if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { in mt76_tx_status_unlock()
71 rs.rate_idx = wcid->rate; in mt76_tx_status_unlock()
80 spin_lock_bh(&dev->rx_lock); in mt76_tx_status_unlock()
82 spin_unlock_bh(&dev->rx_lock); in mt76_tx_status_unlock()
96 flags |= cb->flags; in __mt76_tx_status_skb_done()
97 cb->flags = flags; in __mt76_tx_status_skb_done()
104 info->status.rates[0].count = 0; in __mt76_tx_status_skb_done()
105 info->status.rates[0].idx = -1; in __mt76_tx_status_skb_done()
106 info->flags |= IEEE80211_TX_STAT_ACK; in __mt76_tx_status_skb_done()
124 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; in mt76_tx_status_skb_add()
131 if (!wcid || !rcu_access_pointer(dev->wcid[wcid->idx])) in mt76_tx_status_skb_add()
134 if (info->flags & IEEE80211_TX_CTL_NO_ACK) in mt76_tx_status_skb_add()
137 if (!(info->flags & (IEEE80211_TX_CTL_REQ_TX_STATUS | in mt76_tx_status_skb_add()
139 if (mtk_wed_device_active(&dev->mmio.wed) && in mt76_tx_status_skb_add()
140 ((info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) || in mt76_tx_status_skb_add()
141 ieee80211_is_data(hdr->frame_control))) in mt76_tx_status_skb_add()
147 spin_lock_bh(&dev->status_lock); in mt76_tx_status_skb_add()
149 pid = idr_alloc(&wcid->pktid, skb, MT_PACKET_ID_FIRST, in mt76_tx_status_skb_add()
156 cb->wcid = wcid->idx; in mt76_tx_status_skb_add()
157 cb->pktid = pid; in mt76_tx_status_skb_add()
159 if (list_empty(&wcid->list)) in mt76_tx_status_skb_add()
160 list_add_tail(&wcid->list, &dev->wcid_list); in mt76_tx_status_skb_add()
163 spin_unlock_bh(&dev->status_lock); in mt76_tx_status_skb_add()
176 lockdep_assert_held(&dev->status_lock); in mt76_tx_status_skb_get()
178 skb = idr_remove(&wcid->pktid, pktid); in mt76_tx_status_skb_get()
183 idr_for_each_entry(&wcid->pktid, skb, id) { in mt76_tx_status_skb_get()
187 if (!(cb->flags & MT_TX_CB_DMA_DONE)) in mt76_tx_status_skb_get()
190 if (time_is_after_jiffies(cb->jiffies + in mt76_tx_status_skb_get()
198 idr_remove(&wcid->pktid, cb->pktid); in mt76_tx_status_skb_get()
204 if (idr_is_empty(&wcid->pktid)) in mt76_tx_status_skb_get()
205 list_del_init(&wcid->list); in mt76_tx_status_skb_get()
218 list_for_each_entry_safe(wcid, tmp, &dev->wcid_list, list) in mt76_tx_status_check()
219 mt76_tx_status_skb_get(dev, wcid, flush ? -1 : 0, &list); in mt76_tx_status_check()
231 if (!wcid || info->tx_time_est) in mt76_tx_check_non_aql()
234 pending = atomic_dec_return(&wcid->non_aql_packets); in mt76_tx_check_non_aql()
236 atomic_cmpxchg(&wcid->non_aql_packets, pending, 0); in mt76_tx_check_non_aql()
253 if (wcid_idx < ARRAY_SIZE(dev->wcid)) in __mt76_tx_complete_skb()
254 wcid = rcu_dereference(dev->wcid[wcid_idx]); in __mt76_tx_complete_skb()
260 struct mt76_phy *phy = hw->priv; in __mt76_tx_complete_skb() local
262 if (skb == phy->test.tx_skb) in __mt76_tx_complete_skb()
263 phy->test.tx_done++; in __mt76_tx_complete_skb()
264 if (phy->test.tx_queued == phy->test.tx_done) in __mt76_tx_complete_skb()
265 wake_up(&dev->tx_wait); in __mt76_tx_complete_skb()
272 if (cb->pktid < MT_PACKET_ID_FIRST) { in __mt76_tx_complete_skb()
277 if (status.sta && (wcid->rate.flags || wcid->rate.legacy)) { in __mt76_tx_complete_skb()
278 rs.rate_idx = wcid->rate; in __mt76_tx_complete_skb()
282 spin_lock_bh(&dev->rx_lock); in __mt76_tx_complete_skb()
284 spin_unlock_bh(&dev->rx_lock); in __mt76_tx_complete_skb()
289 cb->jiffies = jiffies; in __mt76_tx_complete_skb()
299 __mt76_tx_queue_skb(struct mt76_phy *phy, int qid, struct sk_buff *skb, in __mt76_tx_queue_skb() argument
304 struct mt76_queue *q = phy->q_tx[qid]; in __mt76_tx_queue_skb()
305 struct mt76_dev *dev = phy->dev; in __mt76_tx_queue_skb()
310 non_aql = !info->tx_time_est; in __mt76_tx_queue_skb()
311 idx = dev->queue_ops->tx_queue_skb(phy, q, qid, skb, wcid, sta); in __mt76_tx_queue_skb()
315 wcid = (struct mt76_wcid *)sta->drv_priv; in __mt76_tx_queue_skb()
316 if (!wcid->sta) in __mt76_tx_queue_skb()
319 q->entry[idx].wcid = wcid->idx; in __mt76_tx_queue_skb()
324 pending = atomic_inc_return(&wcid->non_aql_packets); in __mt76_tx_queue_skb()
332 mt76_tx(struct mt76_phy *phy, struct ieee80211_sta *sta, in mt76_tx() argument
338 if (mt76_testmode_enabled(phy)) { in mt76_tx()
339 ieee80211_free_txskb(phy->hw, skb); in mt76_tx()
346 if (wcid && !(wcid->tx_info & MT_WCID_TX_INFO_SET)) in mt76_tx()
347 ieee80211_get_tx_rates(info->control.vif, sta, skb, in mt76_tx()
348 info->control.rates, 1); in mt76_tx()
350 info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->band_idx); in mt76_tx()
352 if ((info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) || in mt76_tx()
353 (info->control.flags & IEEE80211_TX_CTRL_DONT_USE_RATE_MASK)) in mt76_tx()
354 head = &wcid->tx_offchannel; in mt76_tx()
356 head = &wcid->tx_pending; in mt76_tx()
358 spin_lock_bh(&head->lock); in mt76_tx()
360 spin_unlock_bh(&head->lock); in mt76_tx()
362 spin_lock_bh(&phy->tx_lock); in mt76_tx()
363 if (list_empty(&wcid->tx_list)) in mt76_tx()
364 list_add_tail(&wcid->tx_list, &phy->tx_list); in mt76_tx()
365 spin_unlock_bh(&phy->tx_lock); in mt76_tx()
367 mt76_worker_schedule(&phy->dev->tx_worker); in mt76_tx()
372 mt76_txq_dequeue(struct mt76_phy *phy, struct mt76_txq *mtxq) in mt76_txq_dequeue() argument
378 skb = ieee80211_tx_dequeue(phy->hw, txq); in mt76_txq_dequeue()
383 info->hw_queue |= FIELD_PREP(MT_TX_HW_QUEUE_PHY, phy->band_idx); in mt76_txq_dequeue()
389 mt76_queue_ps_skb(struct mt76_phy *phy, struct ieee80211_sta *sta, in mt76_queue_ps_skb() argument
392 struct mt76_wcid *wcid = (struct mt76_wcid *)sta->drv_priv; in mt76_queue_ps_skb()
395 info->control.flags |= IEEE80211_TX_CTRL_PS_RESPONSE; in mt76_queue_ps_skb()
397 info->flags |= IEEE80211_TX_STATUS_EOSP | in mt76_queue_ps_skb()
401 __mt76_tx_queue_skb(phy, MT_TXQ_PSD, skb, wcid, sta, NULL); in mt76_queue_ps_skb()
410 struct mt76_phy *phy = hw->priv; in mt76_release_buffered_frames() local
411 struct mt76_dev *dev = phy->dev; in mt76_release_buffered_frames()
413 struct mt76_queue *hwq = phy->q_tx[MT_TXQ_PSD]; in mt76_release_buffered_frames()
416 spin_lock_bh(&hwq->lock); in mt76_release_buffered_frames()
418 struct ieee80211_txq *txq = sta->txq[i]; in mt76_release_buffered_frames()
419 struct mt76_txq *mtxq = (struct mt76_txq *)txq->drv_priv; in mt76_release_buffered_frames()
426 skb = mt76_txq_dequeue(phy, mtxq); in mt76_release_buffered_frames()
430 nframes--; in mt76_release_buffered_frames()
432 mt76_queue_ps_skb(phy, sta, last_skb, false); in mt76_release_buffered_frames()
439 mt76_queue_ps_skb(phy, sta, last_skb, true); in mt76_release_buffered_frames()
440 dev->queue_ops->kick(dev, hwq); in mt76_release_buffered_frames()
445 spin_unlock_bh(&hwq->lock); in mt76_release_buffered_frames()
452 return q->stopped || q->blocked || in mt76_txq_stopped()
453 q->queued + MT_TXQ_FREE_THR >= q->ndesc; in mt76_txq_stopped()
457 mt76_txq_send_burst(struct mt76_phy *phy, struct mt76_queue *q, in mt76_txq_send_burst() argument
460 struct mt76_dev *dev = phy->dev; in mt76_txq_send_burst()
469 if (test_bit(MT_WCID_FLAG_PS, &wcid->flags)) in mt76_txq_send_burst()
472 if (atomic_read(&wcid->non_aql_packets) >= MT_MAX_NON_AQL_PKT) in mt76_txq_send_burst()
475 skb = mt76_txq_dequeue(phy, mtxq); in mt76_txq_send_burst()
480 if (!(wcid->tx_info & MT_WCID_TX_INFO_SET)) in mt76_txq_send_burst()
481 ieee80211_get_tx_rates(txq->vif, txq->sta, skb, in mt76_txq_send_burst()
482 info->control.rates, 1); in mt76_txq_send_burst()
484 spin_lock(&q->lock); in mt76_txq_send_burst()
485 idx = __mt76_tx_queue_skb(phy, qid, skb, wcid, txq->sta, &stop); in mt76_txq_send_burst()
486 spin_unlock(&q->lock); in mt76_txq_send_burst()
491 if (test_bit(MT76_RESET, &phy->state) || phy->offchannel) in mt76_txq_send_burst()
492 return -EBUSY; in mt76_txq_send_burst()
497 skb = mt76_txq_dequeue(phy, mtxq); in mt76_txq_send_burst()
502 if (!(wcid->tx_info & MT_WCID_TX_INFO_SET)) in mt76_txq_send_burst()
503 ieee80211_get_tx_rates(txq->vif, txq->sta, skb, in mt76_txq_send_burst()
504 info->control.rates, 1); in mt76_txq_send_burst()
506 spin_lock(&q->lock); in mt76_txq_send_burst()
507 idx = __mt76_tx_queue_skb(phy, qid, skb, wcid, txq->sta, &stop); in mt76_txq_send_burst()
508 spin_unlock(&q->lock); in mt76_txq_send_burst()
515 spin_lock(&q->lock); in mt76_txq_send_burst()
516 dev->queue_ops->kick(dev, q); in mt76_txq_send_burst()
517 spin_unlock(&q->lock); in mt76_txq_send_burst()
523 mt76_txq_schedule_list(struct mt76_phy *phy, enum mt76_txq_id qid) in mt76_txq_schedule_list() argument
525 struct mt76_queue *q = phy->q_tx[qid]; in mt76_txq_schedule_list()
526 struct mt76_dev *dev = phy->dev; in mt76_txq_schedule_list()
535 if (test_bit(MT76_RESET, &phy->state) || phy->offchannel) in mt76_txq_schedule_list()
536 return -EBUSY; in mt76_txq_schedule_list()
538 if (dev->queue_ops->tx_cleanup && in mt76_txq_schedule_list()
539 q->queued + 2 * MT_TXQ_FREE_THR >= q->ndesc) { in mt76_txq_schedule_list()
540 dev->queue_ops->tx_cleanup(dev, q, false); in mt76_txq_schedule_list()
543 txq = ieee80211_next_txq(phy->hw, qid); in mt76_txq_schedule_list()
547 mtxq = (struct mt76_txq *)txq->drv_priv; in mt76_txq_schedule_list()
548 wcid = rcu_dereference(dev->wcid[mtxq->wcid]); in mt76_txq_schedule_list()
549 if (!wcid || test_bit(MT_WCID_FLAG_PS, &wcid->flags)) in mt76_txq_schedule_list()
552 if (mtxq->send_bar && mtxq->aggr) { in mt76_txq_schedule_list()
554 struct ieee80211_sta *sta = txq->sta; in mt76_txq_schedule_list()
555 struct ieee80211_vif *vif = txq->vif; in mt76_txq_schedule_list()
556 u16 agg_ssn = mtxq->agg_ssn; in mt76_txq_schedule_list()
557 u8 tid = txq->tid; in mt76_txq_schedule_list()
559 mtxq->send_bar = false; in mt76_txq_schedule_list()
560 ieee80211_send_bar(vif, sta->addr, tid, agg_ssn); in mt76_txq_schedule_list()
564 n_frames = mt76_txq_send_burst(phy, q, mtxq, wcid); in mt76_txq_schedule_list()
566 ieee80211_return_txq(phy->hw, txq, false); in mt76_txq_schedule_list()
577 void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid) in mt76_txq_schedule() argument
581 if (qid >= 4 || phy->offchannel) in mt76_txq_schedule()
588 ieee80211_txq_schedule_start(phy->hw, qid); in mt76_txq_schedule()
589 len = mt76_txq_schedule_list(phy, qid); in mt76_txq_schedule()
590 ieee80211_txq_schedule_end(phy->hw, qid); in mt76_txq_schedule()
599 mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid, in mt76_txq_schedule_pending_wcid() argument
602 struct mt76_dev *dev = phy->dev; in mt76_txq_schedule_pending_wcid()
608 spin_lock(&head->lock); in mt76_txq_schedule_pending_wcid()
610 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; in mt76_txq_schedule_pending_wcid()
614 if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) && in mt76_txq_schedule_pending_wcid()
615 !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && in mt76_txq_schedule_pending_wcid()
616 !ieee80211_is_data(hdr->frame_control) && in mt76_txq_schedule_pending_wcid()
620 q = phy->q_tx[qid]; in mt76_txq_schedule_pending_wcid()
621 if (mt76_txq_stopped(q) || test_bit(MT76_RESET, &phy->state)) { in mt76_txq_schedule_pending_wcid()
622 ret = -1; in mt76_txq_schedule_pending_wcid()
627 spin_unlock(&head->lock); in mt76_txq_schedule_pending_wcid()
630 spin_lock(&q->lock); in mt76_txq_schedule_pending_wcid()
631 __mt76_tx_queue_skb(phy, qid, skb, wcid, sta, NULL); in mt76_txq_schedule_pending_wcid()
632 dev->queue_ops->kick(dev, q); in mt76_txq_schedule_pending_wcid()
633 spin_unlock(&q->lock); in mt76_txq_schedule_pending_wcid()
635 spin_lock(&head->lock); in mt76_txq_schedule_pending_wcid()
637 spin_unlock(&head->lock); in mt76_txq_schedule_pending_wcid()
642 static void mt76_txq_schedule_pending(struct mt76_phy *phy) in mt76_txq_schedule_pending() argument
646 if (list_empty(&phy->tx_list)) in mt76_txq_schedule_pending()
652 spin_lock(&phy->tx_lock); in mt76_txq_schedule_pending()
653 list_splice_init(&phy->tx_list, &tx_list); in mt76_txq_schedule_pending()
659 list_del_init(&wcid->tx_list); in mt76_txq_schedule_pending()
661 spin_unlock(&phy->tx_lock); in mt76_txq_schedule_pending()
662 ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel); in mt76_txq_schedule_pending()
663 if (ret >= 0 && !phy->offchannel) in mt76_txq_schedule_pending()
664 ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_pending); in mt76_txq_schedule_pending()
665 spin_lock(&phy->tx_lock); in mt76_txq_schedule_pending()
667 if (!skb_queue_empty(&wcid->tx_pending) && in mt76_txq_schedule_pending()
668 !skb_queue_empty(&wcid->tx_offchannel) && in mt76_txq_schedule_pending()
669 list_empty(&wcid->tx_list)) in mt76_txq_schedule_pending()
670 list_add_tail(&wcid->tx_list, &phy->tx_list); in mt76_txq_schedule_pending()
675 spin_unlock(&phy->tx_lock); in mt76_txq_schedule_pending()
681 void mt76_txq_schedule_all(struct mt76_phy *phy) in mt76_txq_schedule_all() argument
685 mt76_txq_schedule_pending(phy); in mt76_txq_schedule_all()
687 mt76_txq_schedule(phy, i); in mt76_txq_schedule_all()
693 struct mt76_phy *phy; in mt76_tx_worker_run() local
696 for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { in mt76_tx_worker_run()
697 phy = dev->phys[i]; in mt76_tx_worker_run()
698 if (!phy) in mt76_tx_worker_run()
701 mt76_txq_schedule_all(phy); in mt76_tx_worker_run()
705 for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { in mt76_tx_worker_run()
706 phy = dev->phys[i]; in mt76_tx_worker_run()
707 if (!phy || !phy->test.tx_pending) in mt76_tx_worker_run()
710 mt76_testmode_tx_pending(phy); in mt76_tx_worker_run()
723 void mt76_stop_tx_queues(struct mt76_phy *phy, struct ieee80211_sta *sta, in mt76_stop_tx_queues() argument
728 for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { in mt76_stop_tx_queues()
729 struct ieee80211_txq *txq = sta->txq[i]; in mt76_stop_tx_queues()
736 hwq = phy->q_tx[mt76_txq_get_qid(txq)]; in mt76_stop_tx_queues()
737 mtxq = (struct mt76_txq *)txq->drv_priv; in mt76_stop_tx_queues()
739 spin_lock_bh(&hwq->lock); in mt76_stop_tx_queues()
740 mtxq->send_bar = mtxq->aggr && send_bar; in mt76_stop_tx_queues()
741 spin_unlock_bh(&hwq->lock); in mt76_stop_tx_queues()
748 struct mt76_phy *phy = hw->priv; in mt76_wake_tx_queue() local
749 struct mt76_dev *dev = phy->dev; in mt76_wake_tx_queue()
751 if (!test_bit(MT76_STATE_RUNNING, &phy->state)) in mt76_wake_tx_queue()
754 mt76_worker_schedule(&dev->tx_worker); in mt76_wake_tx_queue()
778 /* First packet of a A-MSDU burst keeps track of the whole burst in mt76_skb_adjust_pad()
783 if (!iter->next) { in mt76_skb_adjust_pad()
784 skb->data_len += pad; in mt76_skb_adjust_pad()
785 skb->len += pad; in mt76_skb_adjust_pad()
791 return -ENOMEM; in mt76_skb_adjust_pad()
802 if (e->skb) in mt76_queue_tx_complete()
803 dev->drv->tx_complete_skb(dev, e); in mt76_queue_tx_complete()
805 spin_lock_bh(&q->lock); in mt76_queue_tx_complete()
806 q->tail = (q->tail + 1) % q->ndesc; in mt76_queue_tx_complete()
807 q->queued--; in mt76_queue_tx_complete()
808 spin_unlock_bh(&q->lock); in mt76_queue_tx_complete()
814 struct mt76_phy *phy = &dev->phy; in __mt76_set_tx_blocked() local
815 struct mt76_queue *q = phy->q_tx[0]; in __mt76_set_tx_blocked()
817 if (blocked == q->blocked) in __mt76_set_tx_blocked()
820 q->blocked = blocked; in __mt76_set_tx_blocked()
822 phy = dev->phys[MT_BAND1]; in __mt76_set_tx_blocked()
823 if (phy) { in __mt76_set_tx_blocked()
824 q = phy->q_tx[0]; in __mt76_set_tx_blocked()
825 q->blocked = blocked; in __mt76_set_tx_blocked()
827 phy = dev->phys[MT_BAND2]; in __mt76_set_tx_blocked()
828 if (phy) { in __mt76_set_tx_blocked()
829 q = phy->q_tx[0]; in __mt76_set_tx_blocked()
830 q->blocked = blocked; in __mt76_set_tx_blocked()
834 mt76_worker_schedule(&dev->tx_worker); in __mt76_set_tx_blocked()
842 spin_lock_bh(&dev->token_lock); in mt76_token_consume()
844 token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC); in mt76_token_consume()
846 dev->token_count++; in mt76_token_consume()
849 if (mtk_wed_device_active(&dev->mmio.wed) && in mt76_token_consume()
850 token >= dev->mmio.wed.wlan.token_start) in mt76_token_consume()
851 dev->wed_token_count++; in mt76_token_consume()
854 if (dev->token_count >= dev->token_size - MT76_TOKEN_FREE_THR) in mt76_token_consume()
857 spin_unlock_bh(&dev->token_lock); in mt76_token_consume()
864 struct mt76_txwi_cache *t, dma_addr_t phys) in mt76_rx_token_consume() argument
868 spin_lock_bh(&dev->rx_token_lock); in mt76_rx_token_consume()
869 token = idr_alloc(&dev->rx_token, t, 0, dev->rx_token_size, in mt76_rx_token_consume()
872 t->ptr = ptr; in mt76_rx_token_consume()
873 t->dma_addr = phys; in mt76_rx_token_consume()
875 spin_unlock_bh(&dev->rx_token_lock); in mt76_rx_token_consume()
886 spin_lock_bh(&dev->token_lock); in mt76_token_release()
888 txwi = idr_remove(&dev->token, token); in mt76_token_release()
890 dev->token_count--; in mt76_token_release()
893 if (mtk_wed_device_active(&dev->mmio.wed) && in mt76_token_release()
894 token >= dev->mmio.wed.wlan.token_start && in mt76_token_release()
895 --dev->wed_token_count == 0) in mt76_token_release()
896 wake_up(&dev->tx_wait); in mt76_token_release()
900 if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR && in mt76_token_release()
901 dev->phy.q_tx[0]->blocked) in mt76_token_release()
904 spin_unlock_bh(&dev->token_lock); in mt76_token_release()
913 struct mt76_txwi_cache *t; in mt76_rx_token_release() local
915 spin_lock_bh(&dev->rx_token_lock); in mt76_rx_token_release()
916 t = idr_remove(&dev->rx_token, token); in mt76_rx_token_release()
917 spin_unlock_bh(&dev->rx_token_lock); in mt76_rx_token_release()
919 return t; in mt76_rx_token_release()