From patchwork Mon Jun 12 15:03:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9781343 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.web.codeaurora.org (Postfix) with ESMTP id 5986D60212 for ; Mon, 12 Jun 2017 15:04:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44E0026E51 for ; Mon, 12 Jun 2017 15:04:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3976B28633; Mon, 12 Jun 2017 15:04:16 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 34EAE26E51 for ; Mon, 12 Jun 2017 15:04:15 +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=YwfYnlYMJFxyhRK2irX67dmF+3EWRtJGKc1Zacz6w/0=; b=Tv327DfwKs8o2TJwKqWDjf7QeK UYprrIAoL4r/E5DPwC85WXlyb3+c//Weav4/xnjvyTR7RgnLdyNGGWvp3YsTNQTJoEJCJLuF64XFU E8XY6fSYwDQVF2UDa4SoZCca5oTzh+8DAC1uL5gmfs+V7TGEnx6BPplrnhSSBG+VVPCd2rVWCndYA p0y5zXn5XdYIEgV3HyOW1TxYZ26kk9KhOjf3qv+bSKyaOfI4uoQyI0M6yaKkv4EHmrx+I9IbGMit6 E0k6mytlRqprF63SnDrWVOUGUto+6NiNTNDSQJEsCifrDNuvDq+J4yp8fWyOgO0JaegOr3nhgFwMX ARqTjrKw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dKQt0-0007x8-A5; Mon, 12 Jun 2017 15:04:10 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKQsY-0007G3-Df for ath10k@lists.infradead.org; Mon, 12 Jun 2017 15:03:49 +0000 Received: by mail-lf0-x243.google.com with SMTP id o28so9678907lfk.1 for ; Mon, 12 Jun 2017 08:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LpwlayNlKTeFiaI5u+i9mVtSJ34n11L06Z75LV63PLw=; b=Bf5/kpVQp/hZDySJCYnDGXprX9xYUIsmrUydIb0sbv5zpaRP8CepMpjeGVMOQadIaq cD/FTM8DqkVxAA4CYOxpuzqQa+uYvc/SWERAjsWzI2kU9qgNhsCorUZw2j0Z6xoApBpN 5atglgUYIKYgzpGpB0vWk7cPiPdOpcrcLDumPBnMZ47khkWdrgzZahx6GBu1HvlIpoL/ vDpLIgOs0U0atVORjKiSxGnEXMbtJ9UaLLt7J+3p3Ti6kjQ9IBj0UZFLgBFZ0HIVEjGa 4RJp84ij8zMm2AF0iMnfpnMZA3eBlazZTR4XjzZ/ej2a8qpOlZS+/ORK2ji4h4OttKUr LoeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LpwlayNlKTeFiaI5u+i9mVtSJ34n11L06Z75LV63PLw=; b=nQTbaOLUy0cJeRXiJwtlzSZR9B0VwSKh4BzeDeEUYicTs+4O+V8Qhb2ucy06VazPa+ gOjYHkEz0II1JlBSprn6jqWMH49WrpGi9lzjyA58TFJM6aPKXByCmrA5VrUhNxhd3S4c bwu1e8ME5sNZiAuHW5WT0anreRzGOQ4a3XkOuEJ6Q8+9l+fsC4OvUU9sgFbNhHMruJzO K2SeqOEMJXLXT5Ou/dij6SKluGayS1ivywJG0uMJmwXcjWOrqhCcmjkW61+L0jfuT6ht m1myqzuOyqu4mM2qnf7g+4cTa4KmMk527Nuz9S9Qy/X+sFbWodQQ3NofLUsTMIP2fgvi 0Z4A== X-Gm-Message-State: AODbwcAj2PUdVVV6p/lk1kRaY6pY0iXgrWPLDaQoXevxLzS4GoiT0q4k GSC/iUnZirFMSndB X-Received: by 10.25.215.74 with SMTP id o71mr17922049lfg.67.1497279800215; Mon, 12 Jun 2017 08:03:20 -0700 (PDT) Received: from erik-mate-1604.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id n71sm2709253lje.14.2017.06.12.08.03.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 08:03:19 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v2 01/10] ath10k: high_latency detection Date: Mon, 12 Jun 2017 17:03:02 +0200 Message-Id: <1497279791-9598-2-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497279791-9598-1-git-send-email-erik.stromdahl@gmail.com> References: <1497279791-9598-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170612_080342_641577_E7F3642F X-CRM114-Status: UNSURE ( 9.06 ) 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: Erik Stromdahl 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 setup of high latency chips (USB and SDIO) is sometimes different than for chips using low latency interfaces. The bus type is used to determine if the interface is a high latency interface. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/core.c | 1 + drivers/net/wireless/ath/ath10k/core.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 3fb1429..d3bf5c4 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2455,6 +2455,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->hw_rev = hw_rev; ar->hif.ops = hif_ops; ar->hif.bus = bus; + ar->is_high_latency = ath10k_is_high_latency(bus); switch (hw_rev) { case ATH10K_HW_QCA988X: diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 1efe0a1..90069b8 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -789,6 +789,8 @@ struct ath10k { bool p2p; + bool is_high_latency; + struct { enum ath10k_bus bus; const struct ath10k_hif_ops *ops; @@ -1008,6 +1010,11 @@ static inline bool ath10k_peer_stats_enabled(struct ath10k *ar) return false; } +static inline bool ath10k_is_high_latency(enum ath10k_bus bus) +{ + return ((bus == ATH10K_BUS_SDIO) || (bus == ATH10K_BUS_USB)); +} + struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, enum ath10k_bus bus, enum ath10k_hw_rev hw_rev,