From patchwork Sun Jun 3 18:20:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 10445543 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 7409F601BC for ; Sun, 3 Jun 2018 18:23:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FE3D286B3 for ; Sun, 3 Jun 2018 18:23:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 33D632886D; Sun, 3 Jun 2018 18:23:47 +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=-2.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 CB6A5286B3 for ; Sun, 3 Jun 2018 18:23:46 +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=OWkWApHnch1n7Gef+8IP5SLtIIbixN9KWmQb7XqEHKk=; b=TNLJ8/eRjYnNpzNycq5Igu/+eA ezgrndvFH7zI1QSvC0WMUJ5R+XreGxEZue1EO5DUmxr+rDilIMo0uvrWH6V9mGLW9+tfJ+n1meAvd SlGJhQEPePwni+KgVEsJ4IcQyEY12vbcva9jBMyPS3ObFVRU8XJ+6FfTJZxqeqgzRMZSMqC13guHd njnW8WIOGggkKXTL5OoBg5++ordscRRXrjjldkR/693uqM4v2PxZwSvQxlntLjhUnE0xUq+YQGUNU z8K4YENJVSJoJGA35oje5ry6/ez8ysROq28SmvteEhmG3OhfAin3mChj/uJ4vcQcONrEHJpkIiDvv 4+u1+HVw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPXfF-0007EA-EM; Sun, 03 Jun 2018 18:23:37 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fPXe2-0006VG-9c for ath10k@lists.infradead.org; Sun, 03 Jun 2018 18:22:32 +0000 Received: by mail-lf0-x243.google.com with SMTP id i83-v6so9617431lfh.5 for ; Sun, 03 Jun 2018 11:22:11 -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=R+zo3ILy+a0q/qNvozFCVphvJXrWE19ClIZeXX4pTwU=; b=oZzyljCldZh8LN+QqZclXcBmiOiFGRW9XCTGynp9ayTG/fJp3zDS+KU2rBsR032IxS bVsVOBk6dchnHXuI/BT8D9jkSl3NkoYyfRwpSn+5U1pcPrdGNgw2QX6k/KAZUZ3yiKtD NXbN180BCYoz0uDPPXsBkj/3ZFaaPM/Nqq6kG/eKopKzV1IB2CH7kjH8uu+S3FkbTzeJ swsHRUM/cy38RK38bFXO1cqAq39qKGPbQfe/D5z9nm5D2btiYDtAlKX2b7Pq2xENvnZQ 2MJ9z5BslSC8tLbRGTf0eXKyqaQ36DJGgplS1ro9d5IuCJ/CNFUEhc8rGV4qMyPAFvPy 9FHA== 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=R+zo3ILy+a0q/qNvozFCVphvJXrWE19ClIZeXX4pTwU=; b=R4oOOPBC83vBF/0gGiKye9kbmFHckvuxBlXTFZx0TFILb/wwMY0OSRML13S24XMjXC E1qfVPA1Vrg7Qlg1SGI33Jw1CurJAEyRUbVDgYZ1BqxMiLSCwVN6UwZiNr6PnvHzSnqZ kdfa3CtxTenpXNlB7nWA7fnbV9Ud+bF4fPGXzKFKPpYDHT6ohXHVXWSkZ9g9Xp8UoZC7 EI2QyMHMOnLfzo6OV7mZIrdyN6h8kTjwTJ1eeGrUUF02Z8b+4nWMWc2NIM1SoRH6EsyC ZiUhfS1Pn6jX7a4z8ZxHb5qWe8SgtWrRjMl16OfkdUXI0jub1z5oeJQtn1PHUSJKLx6T EAHw== X-Gm-Message-State: ALKqPwcr5U4kQYrJ4kTZLQlrVF64wmtTBcqkJgwZaw+feKtpES7V7iSE xo2Pue8VOqrkTBNUYx+kC8bmJw== X-Google-Smtp-Source: ADUXVKIJltCXnSwsiOOwaSiW/tYuq0xCDnqC2FspINdlfsUG85Ib84q/9rC9ZA/Hp9ke9MLxj426pQ== X-Received: by 2002:a19:11e7:: with SMTP id 100-v6mr11619199lfr.111.1528050130312; Sun, 03 Jun 2018 11:22:10 -0700 (PDT) Received: from localhost.localdomain (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id l200-v6sm4980562lfe.77.2018.06.03.11.22.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 03 Jun 2018 11:22:09 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v5 02/12] ath10k: add device type enum to ath10k_bus_params Date: Sun, 3 Jun 2018 20:20:19 +0200 Message-Id: <20180603182029.8914-3-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180603182029.8914-1-erik.stromdahl@gmail.com> References: <20180603182029.8914-1-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180603_112222_366075_A8B83093 X-CRM114-Status: GOOD ( 13.60 ) 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 dev_type parameter to struct ath10k_bus_params. The dev type specifies if the device is a high latency device (usb and sdio) or low latency device (pci, ahb and snoc) 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 | 7 +++++++ drivers/net/wireless/ath/ath10k/pci.c | 1 + drivers/net/wireless/ath/ath10k/sdio.c | 1 + drivers/net/wireless/ath/ath10k/snoc.c | 1 + drivers/net/wireless/ath/ath10k/usb.c | 1 + 7 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/ahb.c b/drivers/net/wireless/ath/ath10k/ahb.c index 5e272e940efd..bb3928003b72 100644 --- a/drivers/net/wireless/ath/ath10k/ahb.c +++ b/drivers/net/wireless/ath/ath10k/ahb.c @@ -811,6 +811,7 @@ static int ath10k_ahb_probe(struct platform_device *pdev) ath10k_pci_ce_deinit(ar); + bus_params.dev_type = ATH10K_DEV_TYPE_LL; 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 eee6e39e4e99..ebc8ea7cfd40 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2706,6 +2706,7 @@ int ath10k_core_register(struct ath10k *ar, const struct ath10k_bus_params *bus_params) { ar->chip_id = bus_params->chip_id; + ar->dev_type = bus_params->dev_type; 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 6dd68df104e4..f3e94531bbee 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -874,8 +874,14 @@ struct ath10k_per_peer_tx_stats { u32 reserved2; }; +enum ath10k_dev_type { + ATH10K_DEV_TYPE_LL, + ATH10K_DEV_TYPE_HL, +}; + struct ath10k_bus_params { u32 chip_id; + enum ath10k_dev_type dev_type; }; struct ath10k { @@ -888,6 +894,7 @@ struct ath10k { enum ath10k_hw_rev hw_rev; u16 dev_id; u32 chip_id; + enum ath10k_dev_type dev_type; 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 7b5b93f48ba2..05674e6d439a 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3618,6 +3618,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, goto err_free_irq; } + bus_params.dev_type = ATH10K_DEV_TYPE_LL; 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 be61d868edcf..4b4fd0e3b009 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.dev_type = ATH10K_DEV_TYPE_HL; /* 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/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 46d2a7a21efb..01a5f075f349 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1341,6 +1341,7 @@ static int ath10k_snoc_probe(struct platform_device *pdev) goto err_free_irq; } + bus_params.dev_type = ATH10K_DEV_TYPE_LL; bus_params.chip_id = drv_data->hw_rev; ret = ath10k_core_register(ar, &bus_params); if (ret) { diff --git a/drivers/net/wireless/ath/ath10k/usb.c b/drivers/net/wireless/ath/ath10k/usb.c index 275e00bafcb1..f731d35ee76d 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.dev_type = ATH10K_DEV_TYPE_HL; /* TODO: don't know yet how to get chip_id with USB */ bus_params.chip_id = 0; ret = ath10k_core_register(ar, &bus_params);