.. | .. |
---|
| 1 | +// SPDX-License-Identifier: ISC |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2005-2011 Atheros Communications Inc. |
---|
3 | 4 | * Copyright (c) 2011-2016 Qualcomm Atheros, Inc. |
---|
4 | 5 | * Copyright (c) 2018, The Linux Foundation. All rights reserved. |
---|
5 | | - * |
---|
6 | | - * Permission to use, copy, modify, and/or distribute this software for any |
---|
7 | | - * purpose with or without fee is hereby granted, provided that the above |
---|
8 | | - * copyright notice and this permission notice appear in all copies. |
---|
9 | | - * |
---|
10 | | - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
---|
11 | | - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
---|
12 | | - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
---|
13 | | - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
---|
14 | | - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
---|
15 | | - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
---|
16 | | - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
---|
17 | 6 | */ |
---|
18 | 7 | |
---|
19 | 8 | #include "core.h" |
---|
.. | .. |
---|
61 | 50 | struct ath10k_skb_cb *skb_cb; |
---|
62 | 51 | struct ath10k_txq *artxq; |
---|
63 | 52 | struct sk_buff *msdu; |
---|
| 53 | + u8 flags; |
---|
64 | 54 | |
---|
65 | 55 | ath10k_dbg(ar, ATH10K_DBG_HTT, |
---|
66 | 56 | "htt tx completion msdu_id %u status %d\n", |
---|
.. | .. |
---|
89 | 79 | artxq->num_fw_queued--; |
---|
90 | 80 | } |
---|
91 | 81 | |
---|
| 82 | + flags = skb_cb->flags; |
---|
92 | 83 | ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); |
---|
93 | 84 | ath10k_htt_tx_dec_pending(htt); |
---|
94 | 85 | spin_unlock_bh(&htt->tx_lock); |
---|
95 | 86 | |
---|
96 | | - dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); |
---|
| 87 | + rcu_read_lock(); |
---|
| 88 | + if (txq && txq->sta && skb_cb->airtime_est) |
---|
| 89 | + ieee80211_sta_register_airtime(txq->sta, txq->tid, |
---|
| 90 | + skb_cb->airtime_est, 0); |
---|
| 91 | + rcu_read_unlock(); |
---|
| 92 | + |
---|
| 93 | + if (ar->bus_param.dev_type != ATH10K_DEV_TYPE_HL) |
---|
| 94 | + dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); |
---|
97 | 95 | |
---|
98 | 96 | ath10k_report_offchan_tx(htt->ar, msdu); |
---|
99 | 97 | |
---|
.. | .. |
---|
103 | 101 | |
---|
104 | 102 | trace_ath10k_txrx_tx_unref(ar, tx_done->msdu_id); |
---|
105 | 103 | |
---|
106 | | - if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) |
---|
| 104 | + if (!(info->flags & IEEE80211_TX_CTL_NO_ACK) && |
---|
| 105 | + !(flags & ATH10K_SKB_F_NOACK_TID)) |
---|
107 | 106 | info->flags |= IEEE80211_TX_STAT_ACK; |
---|
108 | 107 | |
---|
109 | 108 | if (tx_done->status == HTT_TX_COMPL_STATE_NOACK) |
---|
110 | 109 | info->flags &= ~IEEE80211_TX_STAT_ACK; |
---|
111 | 110 | |
---|
112 | 111 | if ((tx_done->status == HTT_TX_COMPL_STATE_ACK) && |
---|
113 | | - (info->flags & IEEE80211_TX_CTL_NO_ACK)) |
---|
| 112 | + ((info->flags & IEEE80211_TX_CTL_NO_ACK) || |
---|
| 113 | + (flags & ATH10K_SKB_F_NOACK_TID))) |
---|
114 | 114 | info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; |
---|
115 | 115 | |
---|
116 | 116 | if (tx_done->status == HTT_TX_COMPL_STATE_DISCARD) { |
---|
117 | | - if (info->flags & IEEE80211_TX_CTL_NO_ACK) |
---|
| 117 | + if ((info->flags & IEEE80211_TX_CTL_NO_ACK) || |
---|
| 118 | + (flags & ATH10K_SKB_F_NOACK_TID)) |
---|
118 | 119 | info->flags &= ~IEEE80211_TX_STAT_NOACK_TRANSMITTED; |
---|
119 | 120 | else |
---|
120 | 121 | info->flags &= ~IEEE80211_TX_STAT_ACK; |
---|