diff mbox series

[2/4] ath11k: pad mic len for protected action frames

Message ID 1559080376-26817-3-git-send-email-pradeepc@codeaurora.org (mailing list archive)
State Accepted
Commit 291848e1edc18dd1f04c88e70d948079842445b8
Delegated to: Kalle Valo
Headers show
Series ath11k: enable 11s secured mesh support | expand

Commit Message

Pradeep Kumar Chitrapu May 28, 2019, 9:52 p.m. UTC
padding mic space is necessary for firmware to generate mic len
correctly and to not run into any memory issues.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index cb0de8e2aa60..c78c1481fe7f 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -3179,6 +3179,7 @@  static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
 				  struct sk_buff *skb)
 {
 	struct ath11k_base *ab = ar->ab;
+	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
 	dma_addr_t paddr;
 	int buf_id;
 	int ret;
@@ -3190,6 +3191,13 @@  static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
 	if (buf_id < 0)
 		return -ENOSPC;
 
+	if ((ieee80211_is_action(hdr->frame_control) ||
+	     ieee80211_is_deauth(hdr->frame_control) ||
+	     ieee80211_is_disassoc(hdr->frame_control)) &&
+	     ieee80211_has_protected(hdr->frame_control)) {
+		skb_put(skb, IEEE80211_CCMP_MIC_LEN);
+	}
+
 	paddr = dma_map_single(ab->dev, skb->data, skb->len, DMA_TO_DEVICE);
 	if (dma_mapping_error(ab->dev, paddr)) {
 		ath11k_warn(ab, "failed to DMA map mgmt Tx buffer\n");