Commit d67d0a02 authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo

ath10k: don't drop corrupted mgmt frames

Some firmware revisions don't seem to deilver
management frames with FCS error via WMI so narrow
down the HTT rule to not drop corrupted management
frames.

This basically increases number of frames ath10k
reports while sniffing.
Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 7305d3e0
...@@ -1381,6 +1381,8 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar, ...@@ -1381,6 +1381,8 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar,
{ {
struct sk_buff *msdu; struct sk_buff *msdu;
struct htt_rx_desc *rxd; struct htt_rx_desc *rxd;
bool is_mgmt;
bool has_fcs_err;
msdu = skb_peek(amsdu); msdu = skb_peek(amsdu);
rxd = (void *)msdu->data - sizeof(*rxd); rxd = (void *)msdu->data - sizeof(*rxd);
...@@ -1394,12 +1396,19 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar, ...@@ -1394,12 +1396,19 @@ static bool ath10k_htt_rx_amsdu_allowed(struct ath10k *ar,
return false; return false;
} }
is_mgmt = !!(rxd->attention.flags &
__cpu_to_le32(RX_ATTENTION_FLAGS_MGMT_TYPE));
has_fcs_err = !!(rxd->attention.flags &
__cpu_to_le32(RX_ATTENTION_FLAGS_FCS_ERR));
/* Management frames are handled via WMI events. The pros of such /* Management frames are handled via WMI events. The pros of such
* approach is that channel is explicitly provided in WMI events * approach is that channel is explicitly provided in WMI events
* whereas HTT doesn't provide channel information for Rxed frames. * whereas HTT doesn't provide channel information for Rxed frames.
*
* However some firmware revisions don't report corrupted frames via
* WMI so don't drop them.
*/ */
if (rxd->attention.flags & if (is_mgmt && !has_fcs_err) {
__cpu_to_le32(RX_ATTENTION_FLAGS_MGMT_TYPE)) {
ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx mgmt ctrl\n"); ath10k_dbg(ar, ATH10K_DBG_HTT, "htt rx mgmt ctrl\n");
return false; return false;
} }
......
...@@ -1166,8 +1166,11 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) ...@@ -1166,8 +1166,11 @@ static int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
return 0; return 0;
} }
if (rx_status & WMI_RX_STATUS_ERR_CRC) if (rx_status & WMI_RX_STATUS_ERR_CRC) {
status->flag |= RX_FLAG_FAILED_FCS_CRC; dev_kfree_skb(skb);
return 0;
}
if (rx_status & WMI_RX_STATUS_ERR_MIC) if (rx_status & WMI_RX_STATUS_ERR_MIC)
status->flag |= RX_FLAG_MMIC_ERROR; status->flag |= RX_FLAG_MMIC_ERROR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment