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: 5647401 Return-Path: X-Original-To: patchwork-linux-wireless@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 22C18C058D for ; Fri, 16 Jan 2015 11:21:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 47109201C0 for ; Fri, 16 Jan 2015 11:21:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 62C8B201ED for ; Fri, 16 Jan 2015 11:21:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754422AbbAPLVI (ORCPT ); Fri, 16 Jan 2015 06:21:08 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:46240 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754156AbbAPLVG (ORCPT ); Fri, 16 Jan 2015 06:21:06 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so19984828wgh.1 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=a5mQ8gkZXWDeKT0B3hPeeqXHu+azPPdr7YVO6sSBKpTp3WrwZKi4UuekTfII6JjDGk YWycRnMhPgINrsd6jtoR+h0WXZZMJpiCMIACJINFvUUBqshfUXZ5QuAITu+Yf6Txf/1T TYnzDbpMe/8J5O4+qhzOtPjvjIQhmbGdiJiq10bxnZCfV1eWpVJCsnPVLRUEgaabtL7s hIrDL3ZyW1BwRc23eztciTPfJsdLE1vYfYLtQ6E1Ep0I1HXy9Ik/P8STGz2YwaSBowTJ i4S1Ot3hpj2wdrCiWAAjhj+3YNhUxw0XQgKxCJuja9cid4WuQhI4+gyHu+l6ZVwCFWXY RfgA== X-Gm-Message-State: ALoCoQlSPh+txX7irp+2UxF+D+UGMiBqRR2LnzOZWAP5slhvsRx1aPw8Y6vjXlYEMoDVTUFB9Cj7h3H38zpB541hHoGmlY8ywPgaMbPxH8I1D2I8KdMhO7hVtEHZIWHRFzLoaf9gQXcq 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 Cc: linux-wireless@vger.kernel.org, Michal Kazior 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham 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.