From patchwork Thu Oct 13 16:39:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9375447 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 991E460487 for ; Thu, 13 Oct 2016 16:42:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A9E62A16B for ; Thu, 13 Oct 2016 16:42:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F7352A16E; Thu, 13 Oct 2016 16:42: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=-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 1CC412A16B for ; Thu, 13 Oct 2016 16:42:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933206AbcJMQmC (ORCPT ); Thu, 13 Oct 2016 12:42:02 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:36033 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933190AbcJMQlu (ORCPT ); Thu, 13 Oct 2016 12:41:50 -0400 Received: by mail-lf0-f67.google.com with SMTP id b75so13383957lfg.3 for ; Thu, 13 Oct 2016 09:41:22 -0700 (PDT) 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=E0cl60guHgJ9Gko7UjeyQ7DZJR6JOuvcHayhuNLttZ4=; b=qunKKhyTsG9KPbpUStBBNivj6FkEYTycpdS8IfLx0Fjx29zV2Fav9C4FOC04JScbFo 3RP4A+yyf4eSMRSeYXLpvQFxR/WAqmCmOpdmyruLaI9kjcZyZNNwqieK4jbB69VjnpcK w4nfd0XN2axNWBPx8F+qDV5usyb5+Qs+TnnblpCyshvp0i+pzqylnMAPJud5gaX3eeAP luy+MCUjJxRoAvMvcaUZBWk1ZYV8QVp7uPYintncDtIox0eAYZcsyFFEzBXjSVHYpGMI 16OAMc+q/yET3yVlIpvySnFtN3q55CbEDOZOXFny+GzUZYPkJ0C0S+huHfggi75TGwiY k3Tg== 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=E0cl60guHgJ9Gko7UjeyQ7DZJR6JOuvcHayhuNLttZ4=; b=LdoEGjgPaopdy3r+zo1Xt7bFgjW1uP6r2+WeKCZwG1LG1Y+RBM7spycvspDgTxRG/i eaOJ+ynuXJ55JOER4oxxvUM1zFV/Gt3AiH3ntZFQVNlramyUp7VFXRM3+uvOB7ZF4NSH qnEsZUEwqBYo5Vzu88MYJybKguIHLSbL2QJIaDaftF1tnIQ26JuCyLO7/a2l7jyK5qM3 g+pXgKfdDhx7ZDbjCl+X4qzCHYw7toZyaruP4PJTjbYk9+dcQP99oF1ma3P7JyygAizu WzhAH4zzpc+taKNQPops3NWFinbJ+Q3zM2TenPOgr5aB4A5oQX3sn0w64M7FsqZVXHVb xz1A== X-Gm-Message-State: AA6/9Rk0it9qvRFYzq1toECNuBG8kCvdxsoTwDJbCVbzLN2o3wh3XelcgLqnv09BEtHAbQ== X-Received: by 10.25.32.69 with SMTP id g66mr11253632lfg.15.1476376881596; Thu, 13 Oct 2016 09:41:21 -0700 (PDT) Received: from erik-desktop.lan (81-233-218-8-no25.tbcn.telia.com. [81.233.218.8]) by smtp.gmail.com with ESMTPSA id j124sm3986330lfe.3.2016.10.13.09.41.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 09:41:20 -0700 (PDT) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org Cc: Erik Stromdahl Subject: [RFC 4/5] ath6kl: Updated credit setup Date: Thu, 13 Oct 2016 18:39:28 +0200 Message-Id: <1476376769-4708-5-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1476376769-4708-1-git-send-email-erik.stromdahl@gmail.com> References: <1476376769-4708-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 This patch simplifies the credit setup and removes a dependency from htc_mbox.c. The service priority (the order in which the endpoint credits are added in target->cred_dist_list) is now determined by the sequence in which the host connects to services. The HTC control endpoint will have highest prio (just as before) since it is the first endpoint that is connected (done in htc_wait_target). The remaining service prio's will be prioritized in the order in which they are connected. The rationale behind this patch is to remove the service dependecies (the prio list in ath6kl_htc_mbox_credit_setup) from htc_mbox.c. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath6kl/htc_mbox.c | 50 ++++++------------------------ 1 file changed, 9 insertions(+), 41 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/htc_mbox.c b/drivers/net/wireless/ath/ath6kl/htc_mbox.c index 2c4477d..eed3939 100644 --- a/drivers/net/wireless/ath/ath6kl/htc_mbox.c +++ b/drivers/net/wireless/ath/ath6kl/htc_mbox.c @@ -29,9 +29,6 @@ static void ath6kl_htc_mbox_cleanup(struct htc_target *target); static void ath6kl_htc_mbox_stop(struct htc_target *target); static int ath6kl_htc_mbox_add_rxbuf_multiple(struct htc_target *target, struct list_head *pkt_queue); -static void ath6kl_htc_set_credit_dist(struct htc_target *target, - struct ath6kl_htc_credit_info *cred_info, - u16 svc_pri_order[], int len); /* threshold to re-enable Tx bundling for an AC*/ #define TX_RESUME_BUNDLE_THRESHOLD 1500 @@ -146,18 +143,9 @@ static void ath6kl_credit_init(struct ath6kl_htc_credit_info *cred_info, static int ath6kl_htc_mbox_credit_setup(struct htc_target *htc_target, struct ath6kl_htc_credit_info *cred_info) { - u16 servicepriority[5]; - memset(cred_info, 0, sizeof(struct ath6kl_htc_credit_info)); - servicepriority[0] = WMI_CONTROL_SVC; /* highest */ - servicepriority[1] = WMI_DATA_VO_SVC; - servicepriority[2] = WMI_DATA_VI_SVC; - servicepriority[3] = WMI_DATA_BE_SVC; - servicepriority[4] = WMI_DATA_BK_SVC; /* lowest */ - - /* set priority list */ - ath6kl_htc_set_credit_dist(htc_target, cred_info, servicepriority, 5); + htc_target->credit_info = cred_info; return 0; } @@ -1094,34 +1082,6 @@ static int htc_setup_tx_complete(struct htc_target *target) return status; } -static void ath6kl_htc_set_credit_dist(struct htc_target *target, - struct ath6kl_htc_credit_info *credit_info, - u16 srvc_pri_order[], int list_len) -{ - struct htc_endpoint *endpoint; - int i, ep; - - target->credit_info = credit_info; - - list_add_tail(&target->endpoint[ENDPOINT_0].cred_dist.list, - &target->cred_dist_list); - - for (i = 0; i < list_len; i++) { - for (ep = ENDPOINT_1; ep < ENDPOINT_MAX; ep++) { - endpoint = &target->endpoint[ep]; - if (endpoint->svc_id == srvc_pri_order[i]) { - list_add_tail(&endpoint->cred_dist.list, - &target->cred_dist_list); - break; - } - } - if (ep >= ENDPOINT_MAX) { - WARN_ON(1); - return; - } - } -} - static int ath6kl_htc_mbox_tx(struct htc_target *target, struct htc_packet *packet) { @@ -2575,6 +2535,14 @@ static int ath6kl_htc_mbox_conn_service(struct htc_target *target, endpoint->svc_id, assigned_ep); } + /* Add the credit distribution list of the current endpoint + * to target->cred_dist_list. + * The order in which this function is called will determine + * the priority of the services. + */ + list_add_tail(&endpoint->cred_dist.list, + &target->cred_dist_list); + fail_tx: if (tx_pkt) htc_reclaim_txctrl_buf(target, tx_pkt);