From patchwork Fri Jan 16 11:20:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5647421 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B4E08C058D for ; Fri, 16 Jan 2015 11:21:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E606C201ED for ; Fri, 16 Jan 2015 11:21:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7183201C0 for ; Fri, 16 Jan 2015 11:21:35 +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 1YC4y1-0006ES-8B; Fri, 16 Jan 2015 11:21:29 +0000 Received: from mail-wg0-x22d.google.com ([2a00:1450:400c:c00::22d]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YC4xz-00065h-1x for ath10k@lists.infradead.org; Fri, 16 Jan 2015 11:21:27 +0000 Received: by mail-wg0-f45.google.com with SMTP id y19so20002493wgg.4 for ; Fri, 16 Jan 2015 03:21:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9GrC7EpTGvdN3QIurSDrMzAfuMLdzIKPK3ferg7fqFc=; b=NC7NhXW5eo953o9Elk2deMLYDWVlsTSIhi0pz1PzbEf+yk2L8VYnTbYDsGq7LhShNT FTXIj3w0iH6hYcoMkuHPpYUZpYrURY9Ea0qH0GKg43rV2BkMuP5yIQrd7IAZdcVhC9kg Hbifp91nDJu3/fXVurstdgZ6Z5ZP05goP/gb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9GrC7EpTGvdN3QIurSDrMzAfuMLdzIKPK3ferg7fqFc=; b=mrDqL4FxSJ5AZqPYQkfML7pdeyvRnqfx+M8QZvbEBkaA3yRel4nyHeUMv79qRpF4gl 0ijUA6ZlDlZSopmqxDNeIJ8r7J3eIc4y1DiqP9VbiAWsa9Wv0/zHNoukP6BtbdjOgWXK BWnfG56Snv1wtwl06LI9pn3wsunlll750TWX6sDj6UmyQw9oZDpS6QClVOmZvHshyL4j bOVsRbSclG/gFwYv5HLb0/uhGANtUHKgVvOy8HmZ7x/stacMbQn6+UiEdzz0gc3iKked 3Igki+cbbpvUv9eJXarDz++OJSbQ5uSMlF1Cadb3kcriUavxbYMTqLDZNfkRAUxTeLG3 YPeg== X-Gm-Message-State: ALoCoQl+K7s9c/aABj9FFJ1dbZmzRu+f+i049DjmSBgqORCmlqFAMCS9yxeGsr2a9hVtn0/ZnOjvKeESOV9KjqOTk9reyD0VxvzrrGKV60UweBww7j6r3u1s2DSZehVbG0EywTKzoXhATM/P/HZVZF8NUME1MXN8AvgIvS6+RvMCpZSV0Pq84kw= X-Received: by 10.194.109.9 with SMTP id ho9mr28084613wjb.29.1421407264800; Fri, 16 Jan 2015 03:21:04 -0800 (PST) Received: from bob.homerouter.cpe (apn-46-76-65-212.dynamic.gprs.plus.pl. [46.76.65.212]) by mx.google.com with ESMTPSA id i3sm5669843wjw.2.2015.01.16.03.21.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Jan 2015 03:21:04 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 2/3] ath10k: add support for qca6174 Rx descriptors Date: Fri, 16 Jan 2015 12:20:36 +0100 Message-Id: <1421407237-24159-2-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1421407237-24159-1-git-send-email-michal.kazior@tieto.com> References: <1421407237-24159-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150116_032127_239228_FEC2EE09 X-CRM114-Status: GOOD ( 10.72 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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 The QCA6174 chip has an extra 4 bytes in rx_ppdu_end structure which is used in htt_rx_desc and HTT Rx ring offset setup. This is necessary for correct Rx for QCA6174 (otherwise Rx descriptors are overwritten and corrupted). This means QCA988X will have an extra 4 byte padding in Rx descriptor layout which is harmless. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +- drivers/net/wireless/ath/ath10k/rx_desc.h | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index baa1c44..143728f 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -696,7 +696,7 @@ static void ath10k_htt_rx_h_mactime(struct ath10k *ar, * * FIXME: Can we get/compute 64bit TSF? */ - status->mactime = __le32_to_cpu(rxd->ppdu_end.tsf_timestamp); + status->mactime = __le32_to_cpu(rxd->ppdu_end.common.tsf_timestamp); status->flag |= RX_FLAG_MACTIME_END; } diff --git a/drivers/net/wireless/ath/ath10k/rx_desc.h b/drivers/net/wireless/ath/ath10k/rx_desc.h index e1ffdd5..e9cc778 100644 --- a/drivers/net/wireless/ath/ath10k/rx_desc.h +++ b/drivers/net/wireless/ath/ath10k/rx_desc.h @@ -850,7 +850,7 @@ struct rx_ppdu_start { #define RX_PPDU_END_INFO1_PPDU_DONE (1 << 15) -struct rx_ppdu_end { +struct rx_ppdu_end_common { __le32 evm_p0; __le32 evm_p1; __le32 evm_p2; @@ -873,10 +873,33 @@ struct rx_ppdu_end { u8 phy_err_code; __le16 flags; /* %RX_PPDU_END_FLAGS_ */ __le32 info0; /* %RX_PPDU_END_INFO0_ */ +} __packed; + +struct rx_ppdu_end_qca988x { __le16 bb_length; __le16 info1; /* %RX_PPDU_END_INFO1_ */ } __packed; +#define RX_PPDU_END_RTT_CORRELATION_VALUE_MASK 0x00ffffff +#define RX_PPDU_END_RTT_CORRELATION_VALUE_LSB 0 +#define RX_PPDU_END_RTT_UNUSED_MASK 0x7f000000 +#define RX_PPDU_END_RTT_UNUSED_LSB 24 +#define RX_PPDU_END_RTT_NORMAL_MODE BIT(31) + +struct rx_ppdu_end_qca6174 { + __le32 rtt; /* %RX_PPDU_END_RTT_ */ + __le16 bb_length; + __le16 info1; /* %RX_PPDU_END_INFO1_ */ +} __packed; + +struct rx_ppdu_end { + struct rx_ppdu_end_common common; + union { + struct rx_ppdu_end_qca988x qca988x; + struct rx_ppdu_end_qca6174 qca6174; + } __packed; +} __packed; + /* * evm_p0 * EVM for pilot 0. Contain EVM for streams: 0, 1, 2 and 3.