From patchwork Mon Nov 2 08:33:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 7534351 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC1219F327 for ; Mon, 2 Nov 2015 08:34:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E148F2055A for ; Mon, 2 Nov 2015 08:34:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F0A0A20557 for ; Mon, 2 Nov 2015 08:34:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtAZj-0006lY-C4; Mon, 02 Nov 2015 08:34:47 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZtAZh-0006it-2F for ath10k@lists.infradead.org; Mon, 02 Nov 2015 08:34:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1446453285; x=1477989285; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=sTJ5XNrsJi1xAbJziXjUeqS81tK1dAEXiLV7uzBFeIc=; b=ngXJtK9h7BYuMder4Kk7VgDHYSM1QpCA2T8fyl6OcBvq1iATzT2fo5GX ij6TjgOo9S3ChJTDAvdMW6olmQKRSiNfL9qmDMh7z2B2ai/1LE55rkE6e IEhMc59thZM1ulPme//HQPOTHlOCQeFaq38kCK3FPKA4DljrPKsE2P4iX o=; X-IronPort-AV: E=McAfee;i="5700,7163,7972"; a="240439939" Received: from ironmsg02-l-new.qualcomm.com (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 02 Nov 2015 00:34:24 -0800 X-IronPort-AV: E=Sophos;i="5.20,233,1444719600"; d="scan'208";a="576667411" Received: from nasanexm01e.na.qualcomm.com ([10.85.0.31]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 02 Nov 2015 00:34:23 -0800 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01E.na.qualcomm.com (10.85.0.31) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Mon, 2 Nov 2015 00:34:08 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1076.9; Mon, 2 Nov 2015 14:04:14 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Mon, 02 Nov 2015 14:04:05 +0530 From: Vasanthakumar Thiagarajan To: Subject: [PATCH 2/2] ath10k: Fix peerid configuration in htt tx desc for htt version < 3.4 Date: Mon, 2 Nov 2015 14:03:49 +0530 Message-ID: <1446453229-22982-2-git-send-email-vthiagar@qti.qualcomm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1446453229-22982-1-git-send-email-vthiagar@qti.qualcomm.com> References: <1446453229-22982-1-git-send-email-vthiagar@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151102_003445_162039_2CE65E61 X-CRM114-Status: GOOD ( 11.32 ) X-Spam-Score: -7.0 (-------) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasanthakumar Thiagarajan , linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Of a word in struct htt_data_tx_desc htt version >= 3.4 firmware uses LSB 16-bit for frequency configuration which is used for offchannel tx and MSB 16-bit is for peerid. But other firmwares using version 2.X (10.1, 10.2.2, 10.2.4 and 10.4) are using 32-bit for peerid in htt tx desc. So far no issue is found with the existing code setting peerid and freq for HTT version 2.X, this could be mainly because of 0 as frequecy (home channel) is being always passed with those firmwares. There may be issues when non-zero freq is passed with firmware using < 3.4 htt version. To be safe use target_version_major and target_version_minor along with htt-op-version before configuring peer id and freq in htt tx desc. Fixes: 8d6d36243610 ("ath10k: fix offchan reliability") Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath10k/htt.h | 9 +++++++-- drivers/net/wireless/ath/ath10k/htt_tx.c | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt.h b/drivers/net/wireless/ath/ath10k/htt.h index 2bad50e..44fb4f2 100644 --- a/drivers/net/wireless/ath/ath10k/htt.h +++ b/drivers/net/wireless/ath/ath10k/htt.h @@ -166,8 +166,13 @@ struct htt_data_tx_desc { __le16 len; __le16 id; __le32 frags_paddr; - __le16 peerid; - __le16 freq; + union { + __le32 peerid; + struct { + __le16 peerid; + __le16 freq; + } __packed offchan_tx; + } __packed; u8 prefetch[0]; /* start of frame, for FW classification engine */ } __packed; diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index 1682397..bf19247 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -681,8 +681,17 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) skb_cb->htt.txbuf->cmd_tx.len = __cpu_to_le16(msdu->len); skb_cb->htt.txbuf->cmd_tx.id = __cpu_to_le16(msdu_id); skb_cb->htt.txbuf->cmd_tx.frags_paddr = __cpu_to_le32(frags_paddr); - skb_cb->htt.txbuf->cmd_tx.peerid = __cpu_to_le16(HTT_INVALID_PEERID); - skb_cb->htt.txbuf->cmd_tx.freq = __cpu_to_le16(skb_cb->htt.freq); + if (ar->htt.target_version_major >= 3 && + ar->htt.target_version_minor >= 4 && + ar->htt.op_version == ATH10K_FW_HTT_OP_VERSION_TLV) { + skb_cb->htt.txbuf->cmd_tx.offchan_tx.peerid = + __cpu_to_le16(HTT_INVALID_PEERID); + skb_cb->htt.txbuf->cmd_tx.offchan_tx.freq = + __cpu_to_le16(skb_cb->htt.freq); + } else { + skb_cb->htt.txbuf->cmd_tx.peerid = + __cpu_to_le32(HTT_INVALID_PEERID); + } trace_ath10k_htt_tx(ar, msdu_id, msdu->len, vdev_id, tid); ath10k_dbg(ar, ATH10K_DBG_HTT,