From patchwork Sun Dec 31 17:29:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10138285 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 6EDFB60362 for ; Sun, 31 Dec 2017 17:33:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 567BB2886B for ; Sun, 31 Dec 2017 17:33:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B89E2887A; Sun, 31 Dec 2017 17:33:07 +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 D11752886B for ; Sun, 31 Dec 2017 17:33:06 +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=wlpeUjHzrtfDTNfZjNc4nsrysHnSVQ+HmIa0LG1AIE8=; b=YAa6yaGNMC+46o2vx9NVH+kHc5 R9mgOaA9co7rj2eWlVrP/sUa7ukX/vc9a88iPTWm/xttLt/YLEEWPCPAWQ94qbyhuuIqXVBvMxhuS kLqxcX5qX4SzXTcLaK4te5x+xhX+djrs8lvjyWcORmTmQOjJxGse7cdlb1Wm1USuLn3Km1yOXAWZJ S2bm9Im3ndcIjMdSZUAgdMcH+CCT8H4R4TokUTC7dCHRGeQSS4ZHB69+8YVkzfYlcAWcVwkxYl2ET 7g/vfLEVSpaNHkm1UIMQuO67rL14bnfwgPm0jC4nK1rGI70UmXr1AjaMKr99/KZW8gAhlTbFR8xeh nwnMUQWw==; 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 1eVhTm-0006mn-FH; Sun, 31 Dec 2017 17:32:58 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eVhSe-0005yw-Ds for ath10k@lists.infradead.org; Sun, 31 Dec 2017 17:31:55 +0000 Received: by mail-lf0-x242.google.com with SMTP id c19so32383624lfg.3 for ; Sun, 31 Dec 2017 09:31:39 -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=RYonkB7g02wHLDkCFaIqZg6yvPJnokIm6Nnmp5gJ1+s=; b=i0JH8ozy+e8nOIWGYbtF/o/oin6vxnEfPo67+B4ltCzevWfc8xCZUqn+pD3XM+3Jzq MDq/ulqme+Ap1nI5uloF6qCv5fl90P8noDWlUhE6q/LbAMBjkl0b4CQFvqbmqdjE4CY/ msagvHJFOWaEkYW7A2IO30oPFE07pTT0saIHooItgKeCyZ8nm3i1pYPceXCuDgd6JkrZ LbNKfIsLHFpmTGnGxJOhpO/0bgxsYUKZBoQcUsyqqvG7daXtDKGGwv1q0D3Xq6bfbyiu PrWwqmARJSMTPYEETRVtEg1xGcE4t/6ujdjmhbnkDMnmuNSsb/YW+4d2yzRdkdWrNnMS 5WRg== 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=RYonkB7g02wHLDkCFaIqZg6yvPJnokIm6Nnmp5gJ1+s=; b=lHVXPbEV5JiAsbsGw3Q9cCznfCkTLBT2DMM3EtIlbZD6fGto14S9NzcySLfixtDavv Qke4psfIDUnklVBT59LsKbYfxSVOUaIY/QTuy0q30AzNsScjpRSW1Wdni4LHzypdXF7h INCq9LI3qa/9nTnMIkPOROprLZzJESWFfgBorxLktJaemWOfEa99uCm5vC4fRsQeuGJQ J6kopAxhh7n4ZRGN1dZu2RO3983e6uIULyzzXRLe+ntKwAc1LkbdCNzxuzeaTs7nVcUh PVxaEKtTz+nK7uOGl3UwrCxuCyy/AxNHEAa4SmaKJyY+2CkjHoHa8Un2K7NGoKRE6PpN RilA== X-Gm-Message-State: AKGB3mJODfHAa9TfNz9ZNI777Qsw9PB/nA3Qi5df3bTO91dHP7vo/f72 a0CyCv1USyIs4vwjZUTMSaEAMA== X-Google-Smtp-Source: ACJfBotFoNqqdAU9DgG3PNJT0zTEWaahUNBm/9Fcv6Y1SUD8LIlSaZAewvVoaUftEcK1Iuywn5NrIg== X-Received: by 10.25.78.139 with SMTP id u11mr18745848lfk.74.1514741498273; Sun, 31 Dec 2017 09:31:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Dec 2017 09:31:37 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 05/18] ath10k: add bus type check in ath10k_init_hw_params Date: Sun, 31 Dec 2017 18:29:12 +0100 Message-Id: <20171231172925.24014-6-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_093148_599711_23424158 X-CRM114-Status: GOOD ( 12.13 ) 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 bus type is used together with the other hw parameters to find a matching entry in ath10k_hw_params_list for the device. This is necessary since HL devices can have the same dev_id and target_version as a corresponding LL device (same chipset) and yet use a totally different configuration. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/core.c | 16 +++++++++++++++- drivers/net/wireless/ath/ath10k/core.h | 8 -------- drivers/net/wireless/ath/ath10k/hw.h | 9 +++++++++ 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 09b6ad481414..41e6b5a08885 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -64,6 +64,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA988X_HW_2_0_VERSION, .dev_id = QCA988X_2_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca988x hw2.0", .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, @@ -93,6 +94,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA9887_HW_1_0_VERSION, .dev_id = QCA9887_1_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9887 hw1.0", .patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, @@ -122,6 +124,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA6174_HW_2_1_VERSION, .dev_id = QCA6164_2_1_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca6164 hw2.1", .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, .uart_pin = 6, @@ -150,6 +153,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA6174_HW_2_1_VERSION, .dev_id = QCA6174_2_1_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca6174 hw2.1", .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR, .uart_pin = 6, @@ -178,6 +182,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA6174_HW_3_0_VERSION, .dev_id = QCA6174_2_1_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca6174 hw3.0", .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, .uart_pin = 6, @@ -206,6 +211,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA6174_HW_3_2_VERSION, .dev_id = QCA6174_2_1_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca6174 hw3.2", .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR, .uart_pin = 6, @@ -237,6 +243,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA99X0_HW_2_0_DEV_VERSION, .dev_id = QCA99X0_2_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca99x0 hw2.0", .patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, @@ -271,6 +278,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA9984_HW_1_0_DEV_VERSION, .dev_id = QCA9984_1_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9984/qca9994 hw1.0", .patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, @@ -310,6 +318,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA9888_HW_2_0_DEV_VERSION, .dev_id = QCA9888_2_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9888 hw2.0", .patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR, .uart_pin = 7, @@ -348,6 +357,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA9377_HW_1_0_DEV_VERSION, .dev_id = QCA9377_1_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9377 hw1.0", .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 6, @@ -376,6 +386,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA9377_HW_1_1_DEV_VERSION, .dev_id = QCA9377_1_0_DEVICE_ID, + .bus = ATH10K_BUS_PCI, .name = "qca9377 hw1.1", .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 6, @@ -406,6 +417,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = QCA4019_HW_1_0_DEV_VERSION, .dev_id = 0, + .bus = ATH10K_BUS_AHB, .name = "qca4019 hw1.0", .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR, .uart_pin = 7, @@ -441,6 +453,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = { { .id = WCN3990_HW_1_0_DEV_VERSION, .dev_id = 0, + .bus = ATH10K_BUS_PCI, .name = "wcn3990 hw1.0", .continuous_frag_desc = true, .tx_chain_mask = 0x7, @@ -1790,7 +1803,8 @@ static int ath10k_init_hw_params(struct ath10k *ar) for (i = 0; i < ARRAY_SIZE(ath10k_hw_params_list); i++) { hw_params = &ath10k_hw_params_list[i]; - if (hw_params->id == ar->target_version && + if (hw_params->bus == ar->hif.bus && + hw_params->id == ar->target_version && hw_params->dev_id == ar->dev_id) break; } diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 17827ce3752d..32cfa14d3053 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -87,14 +87,6 @@ struct ath10k; -enum ath10k_bus { - ATH10K_BUS_PCI, - ATH10K_BUS_AHB, - ATH10K_BUS_SDIO, - ATH10K_BUS_USB, - ATH10K_BUS_SNOC, -}; - static inline const char *ath10k_bus_str(enum ath10k_bus bus) { switch (bus) { diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 6203bc65799b..3043fd17942e 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -20,6 +20,14 @@ #include "targaddrs.h" +enum ath10k_bus { + ATH10K_BUS_PCI, + ATH10K_BUS_AHB, + ATH10K_BUS_SDIO, + ATH10K_BUS_USB, + ATH10K_BUS_SNOC, +}; + #define ATH10K_FW_DIR "ath10k" #define QCA988X_2_0_DEVICE_ID (0x003c) @@ -491,6 +499,7 @@ struct ath10k_hw_clk_params { struct ath10k_hw_params { u32 id; u16 dev_id; + enum ath10k_bus bus; const char *name; u32 patch_load_addr; int uart_pin;