From patchwork Fri Apr 12 13:28:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 10898303 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 34E631669 for ; Fri, 12 Apr 2019 13:29:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C833286B4 for ; Fri, 12 Apr 2019 13:29:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1E8E2890F; Fri, 12 Apr 2019 13:29: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 95F01286B4 for ; Fri, 12 Apr 2019 13:29:07 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:To:From:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CgfWMVot4AYV+SPIMPOs1spJDcHdyaU+k91kwuZ/ldE=; b=WXZgLT8oci6dNX F0jWKynOkGPPPQ18sp2nkKcJsriB7zjtFtnuPYAb7Dt17ZPa/XGkxJz3XZbrbGoZ6aksArICF4LOy /g5u/z5uWH8OWzp1YBlas4kod2ZLfAOGoraERBPilQ/AhmqMu6YU+yxCroaREA4ZGu9cPonK2bU7q EAbouNF2oOq09OnuV6nqW1ImORmS5ixcVitRzqI7+4pvDTwMF0Zzg5xylRJlGsLgPouQOx4es9ZS6 q6ZnmzVWED3Fa8vUYWeNBAIgln3oi/RN+sV3X5il3jYytYlZ6QcpBNs4yNaXKPXQ/8ckQOphJEbyK lsnY5gPdmDvU/wdXQ/jA==; 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 1hEwEl-0002vv-VN; Fri, 12 Apr 2019 13:28:59 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEwEj-0002vD-31 for ath10k@lists.infradead.org; Fri, 12 Apr 2019 13:28:58 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EE2EB615BE; Fri, 12 Apr 2019 13:28:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1555075736; bh=FlyOxdMOUqS2MSAO8lUpqTf8ORaBoXHirFVY+/CUD2c=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=V4zfmxEmtMU6mJEwHzfYL5Bk1QudIDWvgpo53bSfu9Lg+cZ7Rhy41JFhHP7g96nKg x/9V6HZ9u1Fh+B6ENXaPikOYEjlIWTUc6nAjNTym/xUwH+EQ3cwmPdnTMCKGYu5Z7L 2XXR34K1D9nK9K0IjEpWQWvpTE2b/5O6jWmk7Mu0= Received: from potku.adurom.net (88-114-240-156.elisa-laajakaista.fi [88.114.240.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: kvalo@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 448F16177C; Fri, 12 Apr 2019 13:28:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1555075735; bh=FlyOxdMOUqS2MSAO8lUpqTf8ORaBoXHirFVY+/CUD2c=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=EUqaYnFao1HHjtLSVs+Lq/UmV5JFehDwchDrLCgzQkh2xoD6m27Y61OPHFspEugz6 873u5AC3ug83UU87D4e2ADfQXDFl63/lsU52+8wKg3Hdi2OFlhSPBg8hADO5f2/4dI WF0XY9RFMkw+MemerJv7kXEgTawMBsGwx4UvEXhg= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 448F16177C Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=kvalo@codeaurora.org Subject: [PATCH 5/6] ath10k: htt: support MSDU ids with SDIO From: Kalle Valo To: ath10k@lists.infradead.org Date: Fri, 12 Apr 2019 16:28:52 +0300 Message-ID: <155507573152.32018.18267130026274436463.stgit@potku.adurom.net> In-Reply-To: <155507569645.32018.15231567732563770250.stgit@potku.adurom.net> References: <155507569645.32018.15231567732563770250.stgit@potku.adurom.net> User-Agent: StGit/0.17.1-17-ge4e0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190412_062857_161603_B9D87D7F X-CRM114-Status: GOOD ( 15.40 ) 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: linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Alagu Sankar Transmit completion for SDIO is similar to PCIe, modify the high latency path to allow SDIO modules to use the msdu id. kvalo: the original patch from Alagu enabled this only for SDIO but I'm not sure should we also enable this with USB. I'll use bus params to enable this for so that it's easy to enable also for USB later. Tested with QCA6174 SDIO with firmware WLAN.RMH.4.4.1-00007-QCARMSWP-1. Co-developed-by: Wen Gong Signed-off-by: Alagu Sankar Signed-off-by: Wen Gong . Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.h | 1 + drivers/net/wireless/ath/ath10k/htt_tx.c | 13 ++++++++++++- drivers/net/wireless/ath/ath10k/sdio.c | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index e08a17b01e03..f22cb3f49034 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -919,6 +919,7 @@ struct ath10k_bus_params { u32 chip_id; enum ath10k_dev_type dev_type; bool link_can_suspend; + bool hl_msdu_ids; }; struct ath10k { diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index d8e9cc0bb772..88f880b601d8 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -1244,6 +1244,7 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm u8 tid = ath10k_htt_tx_get_tid(msdu, is_eth); u8 flags0 = 0; u16 flags1 = 0; + u16 msdu_id = 0; data_len = msdu->len; @@ -1291,6 +1292,16 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm } } + if (ar->bus_param.hl_msdu_ids) { + flags1 |= HTT_DATA_TX_DESC_FLAGS1_POSTPONED; + res = ath10k_htt_tx_alloc_msdu_id(htt, msdu); + if (res < 0) { + ath10k_err(ar, "msdu_id allocation failed %d\n", res); + goto out; + } + msdu_id = res; + } + skb_push(msdu, sizeof(*cmd_hdr)); skb_push(msdu, sizeof(*tx_desc)); cmd_hdr = (struct htt_cmd_hdr *)msdu->data; @@ -1300,7 +1311,7 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm tx_desc->flags0 = flags0; tx_desc->flags1 = __cpu_to_le16(flags1); tx_desc->len = __cpu_to_le16(data_len); - tx_desc->id = 0; + tx_desc->id = __cpu_to_le16(msdu_id); tx_desc->frags_paddr = 0; /* always zero */ /* Initialize peer_id to INVALID_PEER because this is NOT * Reinjection path diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index bbfdc4d7cf5f..d5073fac9509 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -2045,6 +2045,8 @@ static int ath10k_sdio_probe(struct sdio_func *func, 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; + bus_params.hl_msdu_ids = true; + ret = ath10k_core_register(ar, &bus_params); if (ret) { ath10k_err(ar, "failed to register driver core: %d\n", ret);