ath10k: fix tx header parsing

Frames are not guaranteed to be 802.11 frames in
ath10k_htt_tx() and the tx completion handler.
In some cases, like TDLS, they can be Ethernet.
Hence checking, e.g. frame_control could yield
bogus results and behavior.

Fortunately this wasn't a real problem so far
because there's no FW/HW combination to encounter
this problem.

However it is good to fix this in advance.

Fixes: 75d85fd999 ("ath10k: introduce basic tdls functionality")
Fixes: eebc67fef3 ("ath10k: fix pmf for wmi-tlv on qca6174")
Fixes: 7b7da0a021 ("ath10k: drop probe responses when too many are queued")
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
This commit is contained in:
Michal Kazior 2015-11-18 06:59:21 +01:00 committed by Kalle Valo
parent 66b8a0108d
commit d668dbaebe
3 changed files with 6 additions and 6 deletions

View File

@ -85,6 +85,7 @@ enum ath10k_skb_flags {
ATH10K_SKB_F_NO_HWCRYPT = BIT(0), ATH10K_SKB_F_NO_HWCRYPT = BIT(0),
ATH10K_SKB_F_DTIM_ZERO = BIT(1), ATH10K_SKB_F_DTIM_ZERO = BIT(1),
ATH10K_SKB_F_DELIVER_CAB = BIT(2), ATH10K_SKB_F_DELIVER_CAB = BIT(2),
ATH10K_SKB_F_MGMT = BIT(3),
}; };
struct ath10k_skb_cb { struct ath10k_skb_cb {

View File

@ -3689,6 +3689,9 @@ static void ath10k_tx(struct ieee80211_hw *hw,
if (!ath10k_tx_h_use_hwcrypto(vif, skb)) if (!ath10k_tx_h_use_hwcrypto(vif, skb))
skb_cb->flags |= ATH10K_SKB_F_NO_HWCRYPT; skb_cb->flags |= ATH10K_SKB_F_NO_HWCRYPT;
if (ieee80211_is_mgmt(hdr->frame_control))
skb_cb->flags |= ATH10K_SKB_F_MGMT;
skb_cb->htt.tid = ath10k_tx_h_get_tid(hdr); skb_cb->htt.tid = ath10k_tx_h_get_tid(hdr);
skb_cb->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif); skb_cb->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif);

View File

@ -57,8 +57,6 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
struct ieee80211_tx_info *info; struct ieee80211_tx_info *info;
struct ath10k_skb_cb *skb_cb; struct ath10k_skb_cb *skb_cb;
struct sk_buff *msdu; struct sk_buff *msdu;
struct ieee80211_hdr *hdr;
__le16 fc;
bool limit_mgmt_desc = false; bool limit_mgmt_desc = false;
ath10k_dbg(ar, ATH10K_DBG_HTT, ath10k_dbg(ar, ATH10K_DBG_HTT,
@ -81,10 +79,9 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
return; return;
} }
hdr = (struct ieee80211_hdr *)msdu->data; skb_cb = ATH10K_SKB_CB(msdu);
fc = hdr->frame_control;
if (unlikely(ieee80211_is_mgmt(fc)) && if (unlikely(skb_cb->flags & ATH10K_SKB_F_MGMT) &&
ar->hw_params.max_probe_resp_desc_thres) ar->hw_params.max_probe_resp_desc_thres)
limit_mgmt_desc = true; limit_mgmt_desc = true;
@ -94,7 +91,6 @@ void ath10k_txrx_tx_unref(struct ath10k_htt *htt,
wake_up(&htt->empty_tx_wq); wake_up(&htt->empty_tx_wq);
spin_unlock_bh(&htt->tx_lock); spin_unlock_bh(&htt->tx_lock);
skb_cb = ATH10K_SKB_CB(msdu);
dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE); dma_unmap_single(dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
ath10k_report_offchan_tx(htt->ar, msdu); ath10k_report_offchan_tx(htt->ar, msdu);