From patchwork Sun Dec 31 17:29:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10138293 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 4D6DF60362 for ; Sun, 31 Dec 2017 17:33:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3545B28875 for ; Sun, 31 Dec 2017 17:33:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A13C2887A; Sun, 31 Dec 2017 17:33:36 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=unavailable 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 CC0BA2886B for ; Sun, 31 Dec 2017 17:33:35 +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=9S70NfO3WdkXCWwZ+Zxx5bBZl6vm4/dBEVtlvibEP5Y=; b=h2xYQnOfBJ3vd7DLz2lA+WmZnV jqY+6AzhyQiKOZllzGHxGtVJN0tqlUCtyFjo1ndNJRQsNb/Po8JEHxIAB+/MTpYhrIk1UbkBxd2mU M06BUkQs9pm2g40bckCEtsGaK0iXfHHL9CHji7RV6sN410zE6jUVDEf8vrAlQ5XCPpPURxhl1grIc 2fKZt8n/YTNjNCEWfd24ogEkLXMiU16HYa2kzheebGWWyDN/no8jo7FMrbobKiwclK80wddCtr37/ /aBWVpxwNgRFAilzwCuLlYF4Ny/fV4sfsu9Qh0x3tPMdcPtGfMISH5j+fdkkFdRiDIv/zUx4r+syg 0qKAnBeQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eVhUG-00079u-1W; Sun, 31 Dec 2017 17:33:28 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eVhSf-0005yt-A5 for ath10k@lists.infradead.org; Sun, 31 Dec 2017 17:32:04 +0000 Received: by mail-lf0-x243.google.com with SMTP id m20so39145292lfi.6 for ; Sun, 31 Dec 2017 09:31:38 -0800 (PST) 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=KyY9OlAb/FJ4ZIEnvXJb3ZbhM+696Nfe2BDjR+rYnck=; b=We5AUH3MLInsHa7X5ASu6+AxrMUONyUzNpSmva5XkafeX74lTNNF3QnxscqfE9yoMt 8hpgufqMPWJmRFB8RP0H7XJywi/ah3Clhj7eUJOyEVoFt9mxsdAK1odDaF2LFceJ1QGv SJGBB/5WRmSFqrcLBH+xvRZGRUC2xwkS1Z19ICHy6BL5+P6/T56ugtc47ByOXu6/pmk7 yO0LmvBWLQt66lhctUO8XYCxZ/f+XV/sYaCpcWUZsqerKm2wlTqzRwfgwJ1AEWT3lN0/ BV1dT/xvgp4yDEzsTG58rCpqedKc0bCgWhjAEsgwN6G7T4eZdLVloIcNgNsR+2A6AQUn xC5w== 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=KyY9OlAb/FJ4ZIEnvXJb3ZbhM+696Nfe2BDjR+rYnck=; b=aCt1gvlNnfpERNleGLen+yKHxsP+8VnWVrjciZHC895jscUFhUWX7LvikGVYLsApx5 hVQSg6P21NEYqDc8VZsMzX7Zjd8mvMtD65Wu7XS5hRsnvg2gxlNXBQwyvcrE74E8ezaO etJWVmYOJIXU4/3+ySm6UOFzkQ8CDuMnOW5l8sAlItubJTpZvOnbr3KvV0gQCGQUBuTj jdy2x0RMtkQqn0iEiD2U4oGYyZbBe48U6rxB3mDEV50IunOKYN81u+GZcIooIf7uwAQm 2oNDiAEdezkaclP4pEs9XxTRLsaANUOivzwoQLslXQEVW3TEoQWSxSE68nRAasIBReSn UEeA== X-Gm-Message-State: AKGB3mISkRRV62d2+zT6ucFFxP6vKw+ehTAEof6yeSn/wSML4jJXGHn5 KEGmzyWXf54Qyjsx9kV6Aaxrsw== X-Google-Smtp-Source: ACJfBoukqAzEbgLvCgboZTvmqUw+22lHlPR5hjIQdKSYmspYLxO7UWlTw8rfglv9lytbCI++cfbatA== X-Received: by 10.25.206.83 with SMTP id e80mr11273029lfg.9.1514741497361; Sun, 31 Dec 2017 09:31:37 -0800 (PST) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id o64sm5048449lfo.53.2017.12.31.09.31.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Dec 2017 09:31:36 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 04/18] ath10k: high_latency detection Date: Sun, 31 Dec 2017 18:29:11 +0100 Message-Id: <20171231172925.24014-5-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20171231172925.24014-1-erik.stromdahl@gmail.com> References: <20171231172925.24014-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171231_093149_544151_29AC2D30 X-CRM114-Status: UNSURE ( 9.99 ) 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 Add is_high_latency parameter to struct ath10k_bus_params. The setup of high latency chips is sometimes different than for chips using low latency interfaces. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/ahb.c | 1 + drivers/net/wireless/ath/ath10k/core.c | 1 + drivers/net/wireless/ath/ath10k/core.h | 2 ++ drivers/net/wireless/ath/ath10k/pci.c | 1 + drivers/net/wireless/ath/ath10k/sdio.c | 1 + drivers/net/wireless/ath/ath10k/usb.c | 1 + 6 files changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c index 6f902f355fca..b342f3393e2c 100644 --- a/drivers/net/wireless/ath/ath10k/ahb.c +++ b/drivers/net/wireless/ath/ath10k/ahb.c @@ -814,6 +814,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev) ath10k_pci_ce_deinit(ar); + bus_params.is_high_latency = false; bus_params.chip_id = ath10k_ahb_soc_read32(ar, SOC_CHIP_ID_ADDRESS); if (bus_params.chip_id == 0xffffffff) { ath10k_err(ar, "failed to get chip id\n"); diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 3440ccc45d60..09b6ad481414 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2613,6 +2613,7 @@ int ath10k_core_register(struct ath10k *ar, const struct ath10k_bus_params *bus_params) { ar->chip_id = bus_params->chip_id; + ar->is_high_latency = bus_params->is_high_latency; queue_work(ar->workqueue, &ar->register_work); return 0; diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index f2e851d91170..17827ce3752d 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -771,6 +771,7 @@ struct ath10k_per_peer_tx_stats { struct ath10k_bus_params { u32 chip_id; + bool is_high_latency; }; struct ath10k { @@ -783,6 +784,7 @@ struct ath10k { enum ath10k_hw_rev hw_rev; u16 dev_id; u32 chip_id; + bool is_high_latency; u32 target_version; u8 fw_version_major; u32 fw_version_minor; diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 124443d45873..9fd8f1576f0c 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3555,6 +3555,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_free_irq; } + bus_params.is_high_latency = false; bus_params.chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); if (bus_params.chip_id == 0xffffffff) { ath10k_err(ar, "failed to get chip id\n"); diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index 03dc748317f8..f0f1b2b8c7a7 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -2026,6 +2026,7 @@ static int ath10k_sdio_probe(struct sdio_func *func, goto err_free_wq; } + bus_params.is_high_latency = true; /* TODO: don't know yet how to get chip_id with SDIO */ bus_params.chip_id = 0; ret = ath10k_core_register(ar, &bus_params); diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c index 275e00bafcb1..3b330e9607aa 100644 --- a/drivers/net/wireless/ath/ath10k/usb.c +++ b/drivers/net/wireless/ath/ath10k/usb.c @@ -1016,6 +1016,7 @@ static int ath10k_usb_probe(struct usb_interface *interface, ar->id.vendor = vendor_id; ar->id.device = product_id; + bus_params.is_high_latency = true; /* TODO: don't know yet how to get chip_id with USB */ bus_params.chip_id = 0; ret = ath10k_core_register(ar, &bus_params);