From patchwork Thu Jan 25 11:13:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Schramm X-Patchwork-Id: 10183921 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 E54F0601D5 for ; Thu, 25 Jan 2018 11:15:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5EC3289F5 for ; Thu, 25 Jan 2018 11:15:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C91E028A0A; Thu, 25 Jan 2018 11:15:03 +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 CE3EF289F5 for ; Thu, 25 Jan 2018 11:15:02 +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=ESj1176A7nnC/+MvOrW5XeYA+e5b6ErgXlVJmy+lCZA=; b=Ggz7vu0/BfUdAX2xjC5hrSpI5T At6QhXnNKWWmk5nJuRN+9DJmSzUo3F/xoxMOx912g3IZajawr5hvtB5pr9kBOoZYTUtQyVgin4tIi AGFQUYOcz8McKzQiuJoLN4t+qcycL+S7rGFxwpe23xJAYjLBrtJVzLx9ZwEB4Q07gYbuv8JdzfTtY sK8DJQDx28Gbb1sT9l/VwMfqDKZj8HurZvha2VnRigZlJjTKMnVQmj5WsBpMBO3fhJs7ToGao7FSP zpqOEbTHdUmz5z2xe716BG+4loQBq0sA4NHpL+P41bPN5EYbqkL2IYKBmw337Kt0AdMGAs7kTYmUs REh03BMw==; 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 1eefUe-0004yV-Q1; Thu, 25 Jan 2018 11:14:56 +0000 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eefUK-0004S1-4e for ath10k@lists.infradead.org; Thu, 25 Jan 2018 11:14:37 +0000 Received: by mail-wr0-x242.google.com with SMTP id s5so5914652wra.0 for ; Thu, 25 Jan 2018 03:14:25 -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=SXO3PgkdrxDVWhrxcOfIJmEqt65bT/gKQzh9BBXSP6c=; b=nIrX/RAd6qCJ4uv02cFngr1tI07j7s5BKiejgWXOmo00AiHumJuzcTm2OLvXNk553B LB+lqqUDWb/ky7dcfUx8ve5ectuAd6+og0q9/KNpPD7jLTYoo90l8dT4U4QAtJ7/ZLEc JMP1h0lbNJybgYUV5E3DWs3pk1ZAiR1Iia8ufodw4OElHo74m2hFAfyLeGYKntsAsjiA nf47B9tHVo8IqqjbA1jHrBUs69IfeqETVVjsRB1HVW+mA83V/Kz74giIQ9WqK8T03ALO 1H7VbsMNTLsVmYLnCe7PyP0jwTeu5afStIWF5hz1CPAFexqrJfwYi9mc9fUv1Kq/ADQ7 3ECg== 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=SXO3PgkdrxDVWhrxcOfIJmEqt65bT/gKQzh9BBXSP6c=; b=QeTcaqJl4Q3poXv+qbdcJs8WKsNmh1iJiTfCdq40TUXXMjvRLcTVchkjHq99q54Wag G9kWGOP3zG9ceQB6lXR0fsJF4JdUvcA/CdqBFVYfgsZxjG28aIoTLMXFzA9oGBaC/13T 5tPhhMbtV6nB/8tgekVT1/p8BOMl6YmNszCYfi6T0a3femIpdsiuBBLbfBvACpf+82UE tiAk8e3z9cAiPj69Kg5F32OPZEu5D8EzOesyPU+8hVqNocVGQT9dFQ8Su9xEAvRRg2zv rChbEXivmCGbfCDnVZCITFpAHtxfRyxjeNwynyV+pqAzYfBF9pk0zHy6KRNVlSxlWKjA q0Kw== X-Gm-Message-State: AKwxytcUzvPpMSSeZj1sDkQzkykms4Vhv+sddMWgxU3OchHFxGgvExfx GNFz2KPOClmXoC1RTm1nTq0= X-Google-Smtp-Source: AH8x226dMyKnY6T/1ypcAxslV5eQ0JCj5pT6JjvQVcnznW3A61wvw7t4hZJISvujH4/Z1wkDDSyUCQ== X-Received: by 10.223.129.227 with SMTP id 90mr8402651wra.148.1516878864493; Thu, 25 Jan 2018 03:14:24 -0800 (PST) Received: from sunsetshimmer.lan ([2a02:8108:17c0:1500:f666:aee7:edff:2dfc]) by smtp.gmail.com with ESMTPSA id x127sm1030318wmb.36.2018.01.25.03.14.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Jan 2018 03:14:23 -0800 (PST) From: Tobias Schramm To: kvalo@qca.qualcomm.com, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, bhelgaas@google.com, linux-pci@vger.kernel.org Subject: [PATCH v3 2/2] ath10k: Add support for Ubiquiti rebranded QCA988X v2 Date: Thu, 25 Jan 2018 12:13:40 +0100 Message-Id: <20180125111340.17553-3-tobleminer@gmail.com> X-Mailer: git-send-email 2.16.0 In-Reply-To: <20180125111340.17553-1-tobleminer@gmail.com> References: <20180125111340.17553-1-tobleminer@gmail.com> 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: Tobias Schramm MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Some modern Ubiquiti devices contain a rebranded QCA988X rev2 with a custom Ubiquiti vendor and device id. This patch adds support for those devices, treating them as a QCA988X v2. Signed-off-by: Tobias Schramm --- drivers/net/wireless/ath/ath10k/core.c | 24 ++++++++++++++++++++++++ drivers/net/wireless/ath/ath10k/hw.h | 1 + drivers/net/wireless/ath/ath10k/pci.c | 4 ++++ 3 files changed, 29 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index b29fdbd21ead..9fb38f2c1d6e 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -52,6 +52,30 @@ MODULE_PARM_DESC(cryptmode, "Crypto mode: 0-hardware, 1-software"); MODULE_PARM_DESC(rawmode, "Use raw 802.11 frame datapath"); static const struct ath10k_hw_params ath10k_hw_params_list[] = { + { + .id = QCA988X_HW_2_0_VERSION, + .dev_id = QCA988X_2_0_DEVICE_ID_UBNT, + .name = "qca988x hw2.0", + .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR, + .uart_pin = 7, + .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL, + .otp_exe_param = 0, + .channel_counters_freq_hz = 88000, + .max_probe_resp_desc_thres = 0, + .cal_data_len = 2116, + .fw = { + .dir = QCA988X_HW_2_0_FW_DIR, + .board = QCA988X_HW_2_0_BOARD_DATA_FILE, + .board_size = QCA988X_BOARD_DATA_SZ, + .board_ext_size = QCA988X_BOARD_EXT_DATA_SZ, + }, + .hw_ops = &qca988x_ops, + .decap_align_bytes = 4, + .spectral_bin_discard = 0, + .vht160_mcs_rx_highest = 0, + .vht160_mcs_tx_highest = 0, + .n_cipher_suites = 8, + }, { .id = QCA988X_HW_2_0_VERSION, .dev_id = QCA988X_2_0_DEVICE_ID, diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 05f26e5858ad..5ae3b56acc19 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -22,6 +22,7 @@ #define ATH10K_FW_DIR "ath10k" +#define QCA988X_2_0_DEVICE_ID_UBNT (0x11ac) #define QCA988X_2_0_DEVICE_ID (0x003c) #define QCA6164_2_1_DEVICE_ID (0x0041) #define QCA6174_2_1_DEVICE_ID (0x003e) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index ffea348b2190..e28e2f5f09c5 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -52,6 +52,7 @@ MODULE_PARM_DESC(reset_mode, "0: auto, 1: warm only (default: 0)"); #define ATH10K_PCI_NUM_WARM_RESET_ATTEMPTS 3 static const struct pci_device_id ath10k_pci_id_table[] = { + { PCI_VDEVICE(UBIQUITI, QCA988X_2_0_DEVICE_ID_UBNT) }, /* PCI-E QCA988X V2 (Ubiquiti branded) */ { PCI_VDEVICE(ATHEROS, QCA988X_2_0_DEVICE_ID) }, /* PCI-E QCA988X V2 */ { PCI_VDEVICE(ATHEROS, QCA6164_2_1_DEVICE_ID) }, /* PCI-E QCA6164 V2.1 */ { PCI_VDEVICE(ATHEROS, QCA6174_2_1_DEVICE_ID) }, /* PCI-E QCA6174 V2.1 */ @@ -68,6 +69,7 @@ static const struct ath10k_pci_supp_chip ath10k_pci_supp_chips[] = { * hacks. ath10k doesn't have them and these devices crash horribly * because of that. */ + { QCA988X_2_0_DEVICE_ID_UBNT, QCA988X_HW_2_0_CHIP_ID_REV }, { QCA988X_2_0_DEVICE_ID, QCA988X_HW_2_0_CHIP_ID_REV }, { QCA6164_2_1_DEVICE_ID, QCA6174_HW_2_1_CHIP_ID_REV }, @@ -1977,6 +1979,7 @@ static int ath10k_pci_get_num_banks(struct ath10k *ar) struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); switch (ar_pci->pdev->device) { + case QCA988X_2_0_DEVICE_ID_UBNT: case QCA988X_2_0_DEVICE_ID: case QCA99X0_2_0_DEVICE_ID: case QCA9888_2_0_DEVICE_ID: @@ -3208,6 +3211,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev, u32 (*targ_cpu_to_ce_addr)(struct ath10k *ar, u32 addr); switch (pci_dev->device) { + case QCA988X_2_0_DEVICE_ID_UBNT: case QCA988X_2_0_DEVICE_ID: hw_rev = ATH10K_HW_QCA988X; pci_ps = false;