From patchwork Tue May 28 21:52:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu X-Patchwork-Id: 10965853 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17071933 for ; Tue, 28 May 2019 21:53:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 08D6928893 for ; Tue, 28 May 2019 21:53:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F14EF28897; Tue, 28 May 2019 21:53:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AA79528894 for ; Tue, 28 May 2019 21:53:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=ua6UoU8MRDA4InTTmdOwrqkvNB3mBr8X2c/Ahlb9BXU=; b=CDRSRrqf3XcF+80PgvwHneW59B EjYinbjP4VK/B5bGWB53PeBCwgTmNpxIZ83uc81kB4eyP5Xh944HM5G2QBkBjMybqF+0Jb5uex81s 2Gh9F/NH1Yfkx/3PWSo3dU5FMnnyz7dwVHuLbjXYRkWsVerOwLY08z7cUpNkFnW7r9T8vkbCZIWKv dQINGKCtBmD0bPPMcjxA64qplsUYz0TLlgHfu8dbPEOFAH+pmjkoxbjWXhMMqx5MU/Z/eTe51BLxn FN0vK7ccAmNp6Fy1Ynk12V/RbOxVaJzlhk2Ba6IC3Z9EpwgG+p0/BJiMc45oM4qLTTRZqxybJSJNh bgEcOq3Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVk1r-0003y8-Nt; Tue, 28 May 2019 21:53:07 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVk1o-0003vj-Tw for ath11k@lists.infradead.org; Tue, 28 May 2019 21:53:06 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 1179C60A63; Tue, 28 May 2019 21:53:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559080383; bh=2LFPksrtfXZJ9bZeb5Yg1VOlPOzcr/+MiMR1vNe/RCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FfhE6RYLfDeqDs2NTgSHp4VWH0JBeoXka8CtOe61ODwegQ20ZJQopDVegP6HcxZxO isx8eKJ8FQUGVhkKt9CpB6TT3r3A8+A2D3GkyR0FEHnmZy3QMTdexeSI/boGcT2flK xE1shkOpSd2I29V1CtrAycsFC1rL9KJWgqtShGOQ= Received: from pradeepc2-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pradeepc@codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 845B660734; Tue, 28 May 2019 21:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559080382; bh=2LFPksrtfXZJ9bZeb5Yg1VOlPOzcr/+MiMR1vNe/RCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SFsE0/FntQxhv44Vh6oHpxZqHn2w/61DL09sj8MLaPGkp+9BjRRdxUgbz1wRNZ51c tBftLjpsK+rS/kG4shatTQz8qA9AHBvSdXE/PWmquEa9bnPXu1lLSU4LQjSNXXDjl+ 2p6mhaA/3bXOWjxxpS3LLwExnXFgQMmN9iBhN/fE= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 845B660734 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=pradeepc@codeaurora.org From: Pradeep Kumar Chitrapu To: ath11k@lists.infradead.org Subject: [PATCH 2/4] ath11k: pad mic len for protected action frames Date: Tue, 28 May 2019 14:52:54 -0700 Message-Id: <1559080376-26817-3-git-send-email-pradeepc@codeaurora.org> X-Mailer: git-send-email 2.1.2 In-Reply-To: <1559080376-26817-1-git-send-email-pradeepc@codeaurora.org> References: <1559080376-26817-1-git-send-email-pradeepc@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190528_145304_979715_6BA18C2B X-CRM114-Status: UNSURE ( 8.95 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Pradeep Kumar Chitrapu MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/wireless/ath/ath11k/mac.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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");