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()
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_dev *dev = phy->dev; in mt76_txq_schedule_list()
535 txq = ieee80211_next_txq(phy->hw, qid); in mt76_txq_schedule_list()
539 mtxq = (struct mt76_txq *)txq->drv_priv; in mt76_txq_schedule_list()
540 wcid = rcu_dereference(dev->wcid[mtxq->wcid]); in mt76_txq_schedule_list()
541 if (!wcid || test_bit(MT_WCID_FLAG_PS, &wcid->flags)) in mt76_txq_schedule_list()
544 phy = mt76_dev_phy(dev, wcid->phy_idx); in mt76_txq_schedule_list()
545 if (test_bit(MT76_RESET, &phy->state) || phy->offchannel) in mt76_txq_schedule_list()
548 q = phy->q_tx[qid]; in mt76_txq_schedule_list()
549 if (dev->queue_ops->tx_cleanup && in mt76_txq_schedule_list()
550 q->queued + 2 * MT_TXQ_FREE_THR >= q->ndesc) { in mt76_txq_schedule_list()
551 dev->queue_ops->tx_cleanup(dev, q, false); in mt76_txq_schedule_list()
554 if (mtxq->send_bar && mtxq->aggr) { in mt76_txq_schedule_list()
556 struct ieee80211_sta *sta = txq->sta; in mt76_txq_schedule_list()
557 struct ieee80211_vif *vif = txq->vif; in mt76_txq_schedule_list()
558 u16 agg_ssn = mtxq->agg_ssn; in mt76_txq_schedule_list()
559 u8 tid = txq->tid; in mt76_txq_schedule_list()
561 mtxq->send_bar = false; in mt76_txq_schedule_list()
562 ieee80211_send_bar(vif, sta->addr, tid, agg_ssn); in mt76_txq_schedule_list()
566 n_frames = mt76_txq_send_burst(phy, q, mtxq, wcid); in mt76_txq_schedule_list()
568 ieee80211_return_txq(phy->hw, txq, false); in mt76_txq_schedule_list()
579 void mt76_txq_schedule(struct mt76_phy *phy, enum mt76_txq_id qid) in mt76_txq_schedule() argument
590 ieee80211_txq_schedule_start(phy->hw, qid); in mt76_txq_schedule()
591 len = mt76_txq_schedule_list(phy, qid); in mt76_txq_schedule()
592 ieee80211_txq_schedule_end(phy->hw, qid); in mt76_txq_schedule()
601 mt76_txq_schedule_pending_wcid(struct mt76_phy *phy, struct mt76_wcid *wcid, in mt76_txq_schedule_pending_wcid() argument
604 struct mt76_dev *dev = phy->dev; in mt76_txq_schedule_pending_wcid()
610 spin_lock(&head->lock); in mt76_txq_schedule_pending_wcid()
612 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; in mt76_txq_schedule_pending_wcid()
616 if ((dev->drv->drv_flags & MT_DRV_HW_MGMT_TXQ) && in mt76_txq_schedule_pending_wcid()
617 !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) && in mt76_txq_schedule_pending_wcid()
618 !ieee80211_is_data(hdr->frame_control) && in mt76_txq_schedule_pending_wcid()
622 q = phy->q_tx[qid]; in mt76_txq_schedule_pending_wcid()
623 if (mt76_txq_stopped(q) || test_bit(MT76_RESET, &phy->state)) { in mt76_txq_schedule_pending_wcid()
624 ret = -1; in mt76_txq_schedule_pending_wcid()
629 spin_unlock(&head->lock); in mt76_txq_schedule_pending_wcid()
632 spin_lock(&q->lock); in mt76_txq_schedule_pending_wcid()
633 __mt76_tx_queue_skb(phy, qid, skb, wcid, sta, NULL); in mt76_txq_schedule_pending_wcid()
634 dev->queue_ops->kick(dev, q); in mt76_txq_schedule_pending_wcid()
635 spin_unlock(&q->lock); in mt76_txq_schedule_pending_wcid()
637 spin_lock(&head->lock); in mt76_txq_schedule_pending_wcid()
639 spin_unlock(&head->lock); in mt76_txq_schedule_pending_wcid()
644 static void mt76_txq_schedule_pending(struct mt76_phy *phy) in mt76_txq_schedule_pending() argument
648 if (list_empty(&phy->tx_list)) in mt76_txq_schedule_pending()
654 spin_lock(&phy->tx_lock); in mt76_txq_schedule_pending()
655 list_splice_init(&phy->tx_list, &tx_list); in mt76_txq_schedule_pending()
661 list_del_init(&wcid->tx_list); in mt76_txq_schedule_pending()
663 spin_unlock(&phy->tx_lock); in mt76_txq_schedule_pending()
664 ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_offchannel); in mt76_txq_schedule_pending()
665 if (ret >= 0 && !phy->offchannel) in mt76_txq_schedule_pending()
666 ret = mt76_txq_schedule_pending_wcid(phy, wcid, &wcid->tx_pending); in mt76_txq_schedule_pending()
667 spin_lock(&phy->tx_lock); in mt76_txq_schedule_pending()
669 if (!skb_queue_empty(&wcid->tx_pending) && in mt76_txq_schedule_pending()
670 !skb_queue_empty(&wcid->tx_offchannel) && in mt76_txq_schedule_pending()
671 list_empty(&wcid->tx_list)) in mt76_txq_schedule_pending()
672 list_add_tail(&wcid->tx_list, &phy->tx_list); in mt76_txq_schedule_pending()
677 spin_unlock(&phy->tx_lock); in mt76_txq_schedule_pending()
683 void mt76_txq_schedule_all(struct mt76_phy *phy) in mt76_txq_schedule_all() argument
685 struct mt76_phy *main_phy = &phy->dev->phy; in mt76_txq_schedule_all()
688 mt76_txq_schedule_pending(phy); in mt76_txq_schedule_all()
690 if (phy != main_phy && phy->hw == main_phy->hw) in mt76_txq_schedule_all()
694 mt76_txq_schedule(phy, i); in mt76_txq_schedule_all()
700 struct mt76_phy *phy; in mt76_tx_worker_run() local
703 mt76_txq_schedule_all(&dev->phy); in mt76_tx_worker_run()
704 for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { in mt76_tx_worker_run()
705 phy = dev->phys[i]; in mt76_tx_worker_run()
706 if (!phy) in mt76_tx_worker_run()
709 mt76_txq_schedule_all(phy); in mt76_tx_worker_run()
713 for (i = 0; i < ARRAY_SIZE(dev->phys); i++) { in mt76_tx_worker_run()
714 phy = dev->phys[i]; in mt76_tx_worker_run()
715 if (!phy || !phy->test.tx_pending) in mt76_tx_worker_run()
718 mt76_testmode_tx_pending(phy); in mt76_tx_worker_run()
731 void mt76_stop_tx_queues(struct mt76_phy *phy, struct ieee80211_sta *sta, in mt76_stop_tx_queues() argument
736 for (i = 0; i < ARRAY_SIZE(sta->txq); i++) { in mt76_stop_tx_queues()
737 struct ieee80211_txq *txq = sta->txq[i]; in mt76_stop_tx_queues()
744 hwq = phy->q_tx[mt76_txq_get_qid(txq)]; in mt76_stop_tx_queues()
745 mtxq = (struct mt76_txq *)txq->drv_priv; in mt76_stop_tx_queues()
747 spin_lock_bh(&hwq->lock); in mt76_stop_tx_queues()
748 mtxq->send_bar = mtxq->aggr && send_bar; in mt76_stop_tx_queues()
749 spin_unlock_bh(&hwq->lock); in mt76_stop_tx_queues()
756 struct mt76_phy *phy = hw->priv; in mt76_wake_tx_queue() local
757 struct mt76_dev *dev = phy->dev; in mt76_wake_tx_queue()
759 mt76_worker_schedule(&dev->tx_worker); in mt76_wake_tx_queue()
783 /* First packet of a A-MSDU burst keeps track of the whole burst in mt76_skb_adjust_pad()
788 if (!iter->next) { in mt76_skb_adjust_pad()
789 skb->data_len += pad; in mt76_skb_adjust_pad()
790 skb->len += pad; in mt76_skb_adjust_pad()
796 return -ENOMEM; in mt76_skb_adjust_pad()
807 if (e->skb) in mt76_queue_tx_complete()
808 dev->drv->tx_complete_skb(dev, e); in mt76_queue_tx_complete()
810 spin_lock_bh(&q->lock); in mt76_queue_tx_complete()
811 q->tail = (q->tail + 1) % q->ndesc; in mt76_queue_tx_complete()
812 q->queued--; in mt76_queue_tx_complete()
813 spin_unlock_bh(&q->lock); in mt76_queue_tx_complete()
819 struct mt76_phy *phy = &dev->phy; in __mt76_set_tx_blocked() local
820 struct mt76_queue *q = phy->q_tx[0]; in __mt76_set_tx_blocked()
822 if (blocked == q->blocked) in __mt76_set_tx_blocked()
825 q->blocked = blocked; in __mt76_set_tx_blocked()
827 phy = dev->phys[MT_BAND1]; 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()
832 phy = dev->phys[MT_BAND2]; in __mt76_set_tx_blocked()
833 if (phy) { in __mt76_set_tx_blocked()
834 q = phy->q_tx[0]; in __mt76_set_tx_blocked()
835 q->blocked = blocked; in __mt76_set_tx_blocked()
839 mt76_worker_schedule(&dev->tx_worker); in __mt76_set_tx_blocked()
847 spin_lock_bh(&dev->token_lock); in mt76_token_consume()
849 token = idr_alloc(&dev->token, *ptxwi, 0, dev->token_size, GFP_ATOMIC); in mt76_token_consume()
851 dev->token_count++; in mt76_token_consume()
854 if (mtk_wed_device_active(&dev->mmio.wed) && in mt76_token_consume()
855 token >= dev->mmio.wed.wlan.token_start) in mt76_token_consume()
856 dev->wed_token_count++; in mt76_token_consume()
859 if (dev->token_count >= dev->token_size - MT76_TOKEN_FREE_THR) in mt76_token_consume()
862 spin_unlock_bh(&dev->token_lock); in mt76_token_consume()
869 struct mt76_txwi_cache *t, dma_addr_t phys) in mt76_rx_token_consume() argument
873 spin_lock_bh(&dev->rx_token_lock); in mt76_rx_token_consume()
874 token = idr_alloc(&dev->rx_token, t, 0, dev->rx_token_size, in mt76_rx_token_consume()
877 t->ptr = ptr; in mt76_rx_token_consume()
878 t->dma_addr = phys; in mt76_rx_token_consume()
880 spin_unlock_bh(&dev->rx_token_lock); in mt76_rx_token_consume()
891 spin_lock_bh(&dev->token_lock); in mt76_token_release()
893 txwi = idr_remove(&dev->token, token); in mt76_token_release()
895 dev->token_count--; in mt76_token_release()
898 if (mtk_wed_device_active(&dev->mmio.wed) && in mt76_token_release()
899 token >= dev->mmio.wed.wlan.token_start && in mt76_token_release()
900 --dev->wed_token_count == 0) in mt76_token_release()
901 wake_up(&dev->tx_wait); in mt76_token_release()
905 if (dev->token_count < dev->token_size - MT76_TOKEN_FREE_THR && in mt76_token_release()
906 dev->phy.q_tx[0]->blocked) in mt76_token_release()
909 spin_unlock_bh(&dev->token_lock); in mt76_token_release()
918 struct mt76_txwi_cache *t; in mt76_rx_token_release() local
920 spin_lock_bh(&dev->rx_token_lock); in mt76_rx_token_release()
921 t = idr_remove(&dev->rx_token, token); in mt76_rx_token_release()
922 spin_unlock_bh(&dev->rx_token_lock); in mt76_rx_token_release()
924 return t; in mt76_rx_token_release()