From patchwork Sat Dec 10 12:58:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9469279 X-Patchwork-Delegate: kvalo@adurom.com 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 169E760231 for ; Sat, 10 Dec 2016 13:00:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0817F284D1 for ; Sat, 10 Dec 2016 13:00:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F143428509; Sat, 10 Dec 2016 13:00:00 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 959A8284D1 for ; Sat, 10 Dec 2016 13:00:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753239AbcLJM76 (ORCPT ); Sat, 10 Dec 2016 07:59:58 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:33009 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753129AbcLJM75 (ORCPT ); Sat, 10 Dec 2016 07:59:57 -0500 Received: by mail-lf0-f67.google.com with SMTP id y21so2226492lfa.0 for ; Sat, 10 Dec 2016 04:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=aBBWn9v8GWn6F2H52WY5FNNsNrMex7TA1vUgPQznYB4=; b=OKzYuyOpdmDaV5tkxYoJaSB75IPr8iXjrv7CnCfTA6Sr2lrdaLuWQysmnXmeN/hr9Y EBAN6i6s77sJMt+J/HFm8co9QgwDlUngbi1bCXnNHGdd+Jm489MobIc1XMOPTAefIcAb n6gePdGJMuVwiiuvNMoti6Qu+oGzDuPDdMpgCiLC1TBxZNEg8T3gs2ZS9o3QcYyZoIh8 fk64OYKOIEeBENIngcP1eKBhHAe80R4Pol/yxybEX675Ke/1ZKyK9lQ43G12a+zUeqlz r4q0KMHrnQ2Eb0ys7sWCXaG8bQVmRvPgUXarftJkytzbFihAIF4yjpFsRJAEaVTWp6N3 3kIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aBBWn9v8GWn6F2H52WY5FNNsNrMex7TA1vUgPQznYB4=; b=IhtpW+dyqfWTDBy2mUHgaJH+gRywAy4NlY2E5MyfAVGCWZZMsNrgAOviby8kIKU4F6 0uktsoif7Pt7x2A0WHY5KQbUDkgcHnPsit7NsRlO8rOYOT0c9n0zPp+J5YN2a5vj5FSt M1Bs521gwHzLmBLX5acaoYYc90BZZXVXjbmDb/ngvaOp5YFnYIfDv3aejqTt93xPv3js HjVi+OABpQPIRq/0MdLF/5KojFgUnImd3SevnvIO20NXhEZiZT5RtdfuE3APjWitMxTA Hwpofjg7FMDccJg4N/hVX/2nPCYtT5Mh5N1dhgL4MhyZgV68aN85u2qudVRrudCZnVHW Jh8Q== X-Gm-Message-State: AKaTC02Q2pCyMWVRP08lrPewTMa3HZIHFoQBDCx7i6fkHQf3EY3SOclGaBEug0CveLLrNQ== X-Received: by 10.46.13.9 with SMTP id 9mr18693001ljn.37.1481374795431; Sat, 10 Dec 2016 04:59:55 -0800 (PST) Received: from localhost.localdomain (81-233-218-8-no25.tbcn.telia.com. [81.233.218.8]) by smtp.gmail.com with ESMTPSA id c66sm7248541ljd.44.2016.12.10.04.59.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 10 Dec 2016 04:59:54 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Erik Stromdahl Subject: [PATCH 2/2] ath10k: htc: Simplified credit distribution. Date: Sat, 10 Dec 2016 13:58:41 +0100 Message-Id: <1481374721-16354-2-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481374721-16354-1-git-send-email-erik.stromdahl@gmail.com> References: <1481374721-16354-1-git-send-email-erik.stromdahl@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Simplified transmit credit distribution code somewhat. Since the WMI control service will get assigned all credits there is no need for having a credit_allocation array in struct ath10k_htc. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htc.c | 29 +++++------------------------ drivers/net/wireless/ath/ath10k/htc.h | 1 - 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index f2e0659..9f6a915 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -474,33 +474,16 @@ static void ath10k_htc_reset_endpoint_states(struct ath10k_htc *htc) } } -static void ath10k_htc_setup_target_buffer_assignments(struct ath10k_htc *htc) -{ - struct ath10k_htc_svc_tx_credits *entry; - - entry = &htc->service_tx_alloc[0]; - - /* - * for PCIE allocate all credists/HTC buffers to WMI. - * no buffers are used/required for data. data always - * remains on host. - */ - entry++; - entry->service_id = ATH10K_HTC_SVC_ID_WMI_CONTROL; - entry->credit_allocation = htc->total_transmit_credits; -} - static u8 ath10k_htc_get_credit_allocation(struct ath10k_htc *htc, u16 service_id) { u8 allocation = 0; - int i; - for (i = 0; i < ATH10K_HTC_EP_COUNT; i++) { - if (htc->service_tx_alloc[i].service_id == service_id) - allocation = - htc->service_tx_alloc[i].credit_allocation; - } + /* The WMI control service is the only service with flow control. + * Let it have all transmit credits. + */ + if (service_id == ATH10K_HTC_SVC_ID_WMI_CONTROL) + allocation = htc->total_transmit_credits; return allocation; } @@ -574,8 +557,6 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) return -ECOMM; } - ath10k_htc_setup_target_buffer_assignments(htc); - /* setup our pseudo HTC control endpoint connection */ memset(&conn_req, 0, sizeof(conn_req)); memset(&conn_resp, 0, sizeof(conn_resp)); diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h index ca150c9..6ababa3 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h @@ -337,7 +337,6 @@ struct ath10k_htc { struct completion ctl_resp; int total_transmit_credits; - struct ath10k_htc_svc_tx_credits service_tx_alloc[ATH10K_HTC_EP_COUNT]; int target_credit_size; };