diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/txrx.c')
-rw-r--r-- | drivers/net/wireless/ath/ath10k/txrx.c | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 74f45fa6f428..0541dd939ce9 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c | |||
@@ -51,7 +51,8 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, | |||
51 | struct ieee80211_tx_info *info; | 51 | struct ieee80211_tx_info *info; |
52 | struct ath10k_skb_cb *skb_cb; | 52 | struct ath10k_skb_cb *skb_cb; |
53 | struct sk_buff *msdu; | 53 | struct sk_buff *msdu; |
54 | int ret; | 54 | |
55 | lockdep_assert_held(&htt->tx_lock); | ||
55 | 56 | ||
56 | ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n", | 57 | ath10k_dbg(ATH10K_DBG_HTT, "htt tx completion msdu_id %u discard %d no_ack %d\n", |
57 | tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack); | 58 | tx_done->msdu_id, !!tx_done->discard, !!tx_done->no_ack); |
@@ -65,12 +66,12 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, | |||
65 | msdu = htt->pending_tx[tx_done->msdu_id]; | 66 | msdu = htt->pending_tx[tx_done->msdu_id]; |
66 | skb_cb = ATH10K_SKB_CB(msdu); | 67 | skb_cb = ATH10K_SKB_CB(msdu); |
67 | 68 | ||
68 | ret = ath10k_skb_unmap(dev, msdu); | 69 | dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); |
69 | if (ret) | ||
70 | ath10k_warn("data skb unmap failed (%d)\n", ret); | ||
71 | 70 | ||
72 | if (skb_cb->htt.frag_len) | 71 | if (skb_cb->htt.txbuf) |
73 | skb_pull(msdu, skb_cb->htt.frag_len + skb_cb->htt.pad_len); | 72 | dma_pool_free(htt->tx_pool, |
73 | skb_cb->htt.txbuf, | ||
74 | skb_cb->htt.txbuf_paddr); | ||
74 | 75 | ||
75 | ath10k_report_offchan_tx(htt->ar, msdu); | 76 | ath10k_report_offchan_tx(htt->ar, msdu); |
76 | 77 | ||
@@ -92,13 +93,11 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt, | |||
92 | /* we do not own the msdu anymore */ | 93 | /* we do not own the msdu anymore */ |
93 | 94 | ||
94 | exit: | 95 | exit: |
95 | spin_lock_bh(&htt->tx_lock); | ||
96 | htt->pending_tx[tx_done->msdu_id] = NULL; | 96 | htt->pending_tx[tx_done->msdu_id] = NULL; |
97 | ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); | 97 | ath10k_htt_tx_free_msdu_id(htt, tx_done->msdu_id); |
98 | __ath10k_htt_tx_dec_pending(htt); | 98 | __ath10k_htt_tx_dec_pending(htt); |
99 | if (htt->num_pending_tx == 0) | 99 | if (htt->num_pending_tx == 0) |
100 | wake_up(&htt->empty_tx_wq); | 100 | wake_up(&htt->empty_tx_wq); |
101 | spin_unlock_bh(&htt->tx_lock); | ||
102 | } | 101 | } |
103 | 102 | ||
104 | static const u8 rx_legacy_rate_idx[] = { | 103 | static const u8 rx_legacy_rate_idx[] = { |
@@ -204,7 +203,7 @@ static void process_rx_rates(struct ath10k *ar, struct htt_rx_info *info, | |||
204 | break; | 203 | break; |
205 | /* 80MHZ */ | 204 | /* 80MHZ */ |
206 | case 2: | 205 | case 2: |
207 | status->flag |= RX_FLAG_80MHZ; | 206 | status->vht_flag |= RX_VHT_FLAG_80MHZ; |
208 | } | 207 | } |
209 | 208 | ||
210 | status->flag |= RX_FLAG_VHT; | 209 | status->flag |= RX_FLAG_VHT; |
@@ -258,20 +257,26 @@ void ath10k_process_rx(struct ath10k *ar, struct htt_rx_info *info) | |||
258 | status->band = ch->band; | 257 | status->band = ch->band; |
259 | status->freq = ch->center_freq; | 258 | status->freq = ch->center_freq; |
260 | 259 | ||
260 | if (info->rate.info0 & HTT_RX_INDICATION_INFO0_END_VALID) { | ||
261 | /* TSF available only in 32-bit */ | ||
262 | status->mactime = info->tsf & 0xffffffff; | ||
263 | status->flag |= RX_FLAG_MACTIME_END; | ||
264 | } | ||
265 | |||
261 | ath10k_dbg(ATH10K_DBG_DATA, | 266 | ath10k_dbg(ATH10K_DBG_DATA, |
262 | "rx skb %p len %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u\n", | 267 | "rx skb %p len %u %s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i\n", |
263 | info->skb, | 268 | info->skb, |
264 | info->skb->len, | 269 | info->skb->len, |
265 | status->flag == 0 ? "legacy" : "", | 270 | status->flag == 0 ? "legacy" : "", |
266 | status->flag & RX_FLAG_HT ? "ht" : "", | 271 | status->flag & RX_FLAG_HT ? "ht" : "", |
267 | status->flag & RX_FLAG_VHT ? "vht" : "", | 272 | status->flag & RX_FLAG_VHT ? "vht" : "", |
268 | status->flag & RX_FLAG_40MHZ ? "40" : "", | 273 | status->flag & RX_FLAG_40MHZ ? "40" : "", |
269 | status->flag & RX_FLAG_80MHZ ? "80" : "", | 274 | status->vht_flag & RX_VHT_FLAG_80MHZ ? "80" : "", |
270 | status->flag & RX_FLAG_SHORT_GI ? "sgi " : "", | 275 | status->flag & RX_FLAG_SHORT_GI ? "sgi " : "", |
271 | status->rate_idx, | 276 | status->rate_idx, |
272 | status->vht_nss, | 277 | status->vht_nss, |
273 | status->freq, | 278 | status->freq, |
274 | status->band); | 279 | status->band, status->flag, info->fcs_err); |
275 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "rx skb: ", | 280 | ath10k_dbg_dump(ATH10K_DBG_HTT_DUMP, NULL, "rx skb: ", |
276 | info->skb->data, info->skb->len); | 281 | info->skb->data, info->skb->len); |
277 | 282 | ||
@@ -378,7 +383,8 @@ void ath10k_peer_unmap_event(struct ath10k_htt *htt, | |||
378 | spin_lock_bh(&ar->data_lock); | 383 | spin_lock_bh(&ar->data_lock); |
379 | peer = ath10k_peer_find_by_id(ar, ev->peer_id); | 384 | peer = ath10k_peer_find_by_id(ar, ev->peer_id); |
380 | if (!peer) { | 385 | if (!peer) { |
381 | ath10k_warn("unknown peer id %d\n", ev->peer_id); | 386 | ath10k_warn("peer-unmap-event: unknown peer id %d\n", |
387 | ev->peer_id); | ||
382 | goto exit; | 388 | goto exit; |
383 | } | 389 | } |
384 | 390 | ||