From patchwork Fri Jan 13 21:26:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9516459 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 5C15460761 for ; Fri, 13 Jan 2017 21:27:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D30928780 for ; Fri, 13 Jan 2017 21:27:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4219E28787; Fri, 13 Jan 2017 21:27:17 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 D73E328780 for ; Fri, 13 Jan 2017 21:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbdAMV1P (ORCPT ); Fri, 13 Jan 2017 16:27:15 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:32956 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751311AbdAMV0s (ORCPT ); Fri, 13 Jan 2017 16:26:48 -0500 Received: by mail-lf0-f65.google.com with SMTP id x1so1709504lff.0 for ; Fri, 13 Jan 2017 13:26:47 -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=YKCj3KWQf0qmOkgvUWvXQNQ4kol9PfZa3uIzwSOh7/c=; b=PAKj1vs71jkCImPPIujUq1IwIeZ/NpyAuz3yacWuadIVRsPc2A48qWCapd/QxXmK+s lRAiODBUnXJztRCJJuDh3RxYjaAfbREe4PheH47JaMVAS/9Hw5N+VfEztT+mL65VoroF 5pLW2r3WLqyNXe829Zq8RAMs7VabaDlKT5pRzyQE2c/FhznMU1lVEWnRdnRorjkTG2tJ lf81Q6zrEeb7T175hMuChsd2LpbHSIao1LcESszZJc060mYZdvWmfORTtX0TMq/BeW3j g3bWue4MavX+2Kppb6S2aC3KXAxl3MPi06t3GejdislyyEL9Hl9lwaPQW0lHeYIIw6K5 P4sg== 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=YKCj3KWQf0qmOkgvUWvXQNQ4kol9PfZa3uIzwSOh7/c=; b=SDS9/5mynh2taQX0s2N5D1uOTfySaxEU+x9mT5VfzsWossHnIwsKcre1+2ilGpnkP1 TMhfDbPZTcTOlxl1BMYR0sQQlbwZRLEZ/JcDDnvOfrzJ4vwdJjwGKWXaBUZCnHQMt4H0 k8NTfHZ5Q827/DeqrcEx154ySITR5LMHANFGIhIpm5XcvpiwFsLvvpUK3xxrJ7J2qOUY 0UKHiwgLFEmxlwpIMyOHhwx71+bcyLYVgDBmrLIS+bqGJ2XkpTrG2gTM0X+HrAOZEXKr hQmfwpmANtboj95XUUPy427/igAVB4vio1PdcveNDWc3O0PHx3GURLascP+dRr3MdOjM YbtQ== X-Gm-Message-State: AIkVDXLpk5st42i9ann8kTSGxEX98HwpE30+PyeEfoDylOwAlazGR1RPtEFOCi/7P7J87w== X-Received: by 10.46.77.197 with SMTP id c66mr8719962ljd.25.1484342806263; Fri, 13 Jan 2017 13:26:46 -0800 (PST) Received: from erik-mate-1604.lan (90-227-62-61-no75.tbcn.telia.com. [90.227.62.61]) by smtp.gmail.com with ESMTPSA id r127sm4458010lfr.3.2017.01.13.13.26.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Jan 2017 13:26:45 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Cc: Erik Stromdahl Subject: [RFC v3 3/8] ath10k: htc: move htc ctrl ep connect to htc_init Date: Fri, 13 Jan 2017 22:26:06 +0100 Message-Id: <1484342771-6160-4-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1484342771-6160-1-git-send-email-erik.stromdahl@gmail.com> References: <1484342771-6160-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 moves the HTC ctrl service connect from htc_wait_target to htc_init. This is done in order to make sure the htc ctrl service is setup properly before hif_start is called. The reason for this is that we want the HTC ctrl service callback to be initialized before the target sends the HTC ready message. The ready message will always be transmitted on endpoint 0 (which is always assigned to the HTC control service) so it makes more sense if HTC control has been connected before the ready message is received. Since the service to pipe mapping is done as a part of the service connect, the get_default_pipe call is redundant and was removed. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htc.c | 39 +++++++++++++++-------------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index e72f385..f39eef6 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -584,8 +584,6 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) struct ath10k *ar = htc->ar; int i, status = 0; unsigned long time_left; - struct ath10k_htc_svc_conn_req conn_req; - struct ath10k_htc_svc_conn_resp conn_resp; struct ath10k_htc_msg *msg; u16 message_id; u16 credit_count; @@ -648,22 +646,6 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) return -ECOMM; } - /* setup our pseudo HTC control endpoint connection */ - memset(&conn_req, 0, sizeof(conn_req)); - memset(&conn_resp, 0, sizeof(conn_resp)); - conn_req.ep_ops.ep_tx_complete = ath10k_htc_control_tx_complete; - conn_req.ep_ops.ep_rx_complete = ath10k_htc_control_rx_complete; - conn_req.max_send_queue_depth = ATH10K_NUM_CONTROL_TX_BUFFERS; - conn_req.service_id = ATH10K_HTC_SVC_ID_RSVD_CTRL; - - /* connect fake service */ - status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); - if (status) { - ath10k_err(ar, "could not connect to htc service (%d)\n", - status); - return status; - } - return 0; } @@ -873,8 +855,10 @@ int ath10k_htc_start(struct ath10k_htc *htc) /* registered target arrival callback from the HIF layer */ int ath10k_htc_init(struct ath10k *ar) { - struct ath10k_htc_ep *ep = NULL; + int status; struct ath10k_htc *htc = &ar->htc; + struct ath10k_htc_svc_conn_req conn_req; + struct ath10k_htc_svc_conn_resp conn_resp; spin_lock_init(&htc->tx_lock); @@ -882,10 +866,21 @@ int ath10k_htc_init(struct ath10k *ar) htc->ar = ar; - /* Get HIF default pipe for HTC message exchange */ - ep = &htc->endpoint[ATH10K_HTC_EP_0]; + /* setup our pseudo HTC control endpoint connection */ + memset(&conn_req, 0, sizeof(conn_req)); + memset(&conn_resp, 0, sizeof(conn_resp)); + conn_req.ep_ops.ep_tx_complete = ath10k_htc_control_tx_complete; + conn_req.ep_ops.ep_rx_complete = ath10k_htc_control_rx_complete; + conn_req.max_send_queue_depth = ATH10K_NUM_CONTROL_TX_BUFFERS; + conn_req.service_id = ATH10K_HTC_SVC_ID_RSVD_CTRL; - ath10k_hif_get_default_pipe(ar, &ep->ul_pipe_id, &ep->dl_pipe_id); + /* connect fake service */ + status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); + if (status) { + ath10k_err(ar, "could not connect to htc service (%d)\n", + status); + return status; + } init_completion(&htc->ctl_resp);