From patchwork Fri Feb 15 15:19:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Surabhi Vishnoi X-Patchwork-Id: 10815101 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 24A8B17E9 for ; Fri, 15 Feb 2019 15:19:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1082D2F7FE for ; Fri, 15 Feb 2019 15:19:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 046C12F80B; Fri, 15 Feb 2019 15:19:53 +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 A54AB2F7FE for ; Fri, 15 Feb 2019 15:19:52 +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: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:In-Reply-To: References:List-Owner; bh=l440kJynZdGnVahAo+HtNM6owEqRAcghju3rGbqjvH4=; b=dAz hFuzMaqJ27hEXvwq9WmzR97VcciiZ8sd5hgrcB2ehFSLMWWanHc70XHqBgM7qlQlYD32+IfUKjq9o GVDl3n4k1MqectnmcDlzO78sgvJ430KPgDZID1C2GbJXL3dLxHZl2ED+UA02QeNaRDysHiVoAYA8T 3r8c0ECqRfSntR977QlsnbXu/8yXBBC8z8r5mBIe8ATHhMqZqJKFNZu74C2PzgIviGIOjTI79cM9W 0V8KGtuYlj/5/ZMjLm+mPK0rlc4X1k1C1HJXU2IZgEDfygqYmhr0f35KccxEJZ841CQNG9cNCScbq ra2v9YiqpxMG5hwJTTufnEbpcpqpayQ==; 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 1gufHK-0004s6-Uj; Fri, 15 Feb 2019 15:19:50 +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 1gufHH-0004rD-Vm for ath10k@lists.infradead.org; Fri, 15 Feb 2019 15:19:49 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8F62E607DF; Fri, 15 Feb 2019 15:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550243985; bh=dPpPGaFTanmxmOmTqCS5Oypq/njPkfmPx8rhRaKDsSg=; h=From:To:Cc:Subject:Date:From; b=E6I5qAbzOJPXwMMsjLxUh8ZVYUz4Ew4FYDvD84BAWeUhK+yzurAQEdW5+/WTeTS+S zFMfJ8IkRpmE1Yqe6yDRwoE2tYTFBvrfEyqRorX9fcMpAZs2MD6z4FuSqVUi9y01GJ 91kBy1UMWLVjsOkEU05D/8/YG+TGGhHFAXPo3+bo= Received: from svishnoi-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: svishnoi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6E2B76020A; Fri, 15 Feb 2019 15:19:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1550243984; bh=dPpPGaFTanmxmOmTqCS5Oypq/njPkfmPx8rhRaKDsSg=; h=From:To:Cc:Subject:Date:From; b=lEjmHl/wCBa9NpuerGnQx9wXwAeKRC9Sxl+CDQjhh7Y7c1sxhlvlkxNFvs+CKNQYR rVq5fwMEVq5eOs4woP8Mu2Rtq7HwNyJ6pP0a4+S/YBcP6vWe9x7sYp3Y3pK4+lSZN4 YzilESNETwz2Gd4klydjst+ExWFmV88xH3+nDKhs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6E2B76020A 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=svishnoi@codeaurora.org From: Surabhi Vishnoi To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: Fix length of wmi tlv command for protected mgmt frames Date: Fri, 15 Feb 2019 20:49:37 +0530 Message-Id: <1550243977-8612-1-git-send-email-svishnoi@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190215_071948_046804_4A35AA51 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, Surabhi Vishnoi MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The length of wmi tlv command for management tx send is calculated incorrectly in case of protected management frames as there is addition of IEEE80211_CCMP_MIC_LEN twice. This leads to improper behaviour of firmware as the wmi tlv mgmt tx send command for protected mgmt frames is formed wrongly. Fix the length calculation of wmi tlv command for mgmt tx send in case of protected management frames by adding the IEEE80211_CCMP_MIC_LEN only once. Tested HW: WCN3990 Tested FW: WLAN.HL.3.1-00784-QCAHLSWMTPLZ-1 Fixes: 1807da49733e "ath10k: wmi: add management tx by reference support over wmi" Signed-off-by: Surabhi Vishnoi --- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 5d05bff..a1c28c1 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -2764,10 +2764,8 @@ static void *ath10k_wmi_tlv_put_wmm(void *ptr, 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)) { - len += IEEE80211_CCMP_MIC_LEN; + ieee80211_has_protected(hdr->frame_control)) buf_len += IEEE80211_CCMP_MIC_LEN; - } buf_len = min_t(u32, buf_len, WMI_TLV_MGMT_TX_FRAME_MAX_LEN); buf_len = round_up(buf_len, 4);