From patchwork Tue Feb 21 16:15:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9585047 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 C4B166042F for ; Tue, 21 Feb 2017 16:17:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29BA200F5 for ; Tue, 21 Feb 2017 16:17:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A791127BFF; Tue, 21 Feb 2017 16:17:06 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM 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 2BCDB200F5 for ; Tue, 21 Feb 2017 16:17:06 +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=gvnh4UX60VXbPV8QKexPXDe3qDkPJffRNvCkgeD3tQw=; b=CCbd+53xKW54ktiCpu1ohR7HeL 77E1nC4BF6srvmczbWxj/Uz4J/hvfaZ7ghe4r8HEBbFhXkyNJqg4P85sSSWXNBL3vOdqkC5cjgGiR tXG5ZgXDt4f/EQZEpCS3q6AvIyd0uTv6DZQLsA7Jr/kIP1LN9d9WfS3F6A8BuoLHbJf1x0Z3TMTWz CIyjLRsDOzfXPkNywJlfT4U65l3C9rOqYtRVNsr60DIu5YBUfSVp85xv/9mVbtXzYQSxKx6xAsssM 4fQO1MeQvru9kD0wswPOCfhrR88DQ1WIdRpcvEBwXoYgrj+tw+BAfw6I/t7XLPjY6mnOZ1IzOjust nkOghe0Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cgD7c-00077f-GV; Tue, 21 Feb 2017 16:17:00 +0000 Received: from mail-lf0-x243.google.com ([2a00:1450:4010:c07::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgD7E-0006ci-AK for ath10k@lists.infradead.org; Tue, 21 Feb 2017 16:16:41 +0000 Received: by mail-lf0-x243.google.com with SMTP id 86so5299967lfv.0 for ; Tue, 21 Feb 2017 08:16:16 -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=H8gETyq0m8z4pZbtDvrdiSoha0jcan78tklSGeKv8JMmA1qcjJ2VqfJn6mGhsjpmXp 5A1L5Ey5nNgx/NlY2ETed3O9hOGPVDQRvY94bSsi+fU1IFJrPM9OcquI1D1hxaypJGit bnYE/xFWiAqbtJSDN3EGe/8KiOTvRGu61XL8h8TKP8Q2g1Z6omkcdjBgkDfnzunQSXKP pFDMtVCxHQnbmZlIuLpL7yVAl3R9CYf4MOwn8gAHKVyPfZEBxMxoqSQslhggR99ZG2vc zSO1Xz/emIRSij7oOYBJ7iwo4Pzv4sTs7CUTwgEtFDgB9OpFf6rbKWKQ677I1s5/WjzI cI/w== 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=eac6K7ogNbQ3wY4Ank82l+Lz3USpim6G7p8LGEm3HwCVqbQTg7jpEJf7UalO8/MkZv g3rerfrJo4VT+zXUBh1LXaWYxby5GUiEOzap7pgBeqiu2bDfirMoaytU7gkJ5NQYTFrb SkPCpPfA5VnYPtX/B0c4zojDgi0py1F61wriF/lG2KBYqtdslUsrK32+KK4zCQ7CwyLg WsWcfFqESC4owBnuuTwbo+cpQvPnN536LSncFszNT2cYYl+2oGJtIilyxFvmUhXyJIeO NHHX8ZY364qDCraZ0GLjNNWGd9gM4Ucel/XLuT5PAYHc2ejbWA0jC3Qw8bwWceTgoiNs vW6g== X-Gm-Message-State: AMke39n7jokO4Q35m4Y1DIAxKMLu5sVLRUmbxeFnrGNpQua4ewJa6Hm+JwbE7RR9qoW8aQ== X-Received: by 10.46.9.216 with SMTP id 207mr7197364ljj.4.1487693775198; Tue, 21 Feb 2017 08:16:15 -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 t29sm6336069ljd.39.2017.02.21.08.16.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 21 Feb 2017 08:16:14 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v4 03/21] ath10k: htc: move htc ctrl ep connect to htc_init Date: Tue, 21 Feb 2017 17:15:23 +0100 Message-Id: <1487693741-10042-4-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> References: <1487693741-10042-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170221_081636_639839_6111A45F X-CRM114-Status: GOOD ( 13.61 ) 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: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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);