From patchwork Wed Mar 15 15:45:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 9625977 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 D0273604A9 for ; Wed, 15 Mar 2017 15:45:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C3F5B28677 for ; Wed, 15 Mar 2017 15:45:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B7FDE2867B; Wed, 15 Mar 2017 15:45:36 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 4DD5228678 for ; Wed, 15 Mar 2017 15:45:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754133AbdCOPpf (ORCPT ); Wed, 15 Mar 2017 11:45:35 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:12256 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753859AbdCOPpd (ORCPT ); Wed, 15 Mar 2017 11:45:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1489592733; x=1521128733; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=IAfPfjShWRVhRIR3Vlir75GsNOEjENmoYkAnTYY9bsI=; b=A0Wk/XalKrO6TzTvuZD4+Tx1oiCWPDtiXoXbotYN6S3l4UiywJKylC47 E+RWhmd6Nx5nMhBXE+IBnCTM69KqElbtat2cZiU9cnvi7sORpprZCC/B6 rqycOT7sDGvwSd75BqcUU6/cXtK2RIPmrLuJ91Lb276gQtWsLOrwtacsk A=; X-IronPort-AV: E=Sophos;i="5.36,169,1486454400"; d="scan'208";a="270785784" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine01.qualcomm.com with ESMTP; 15 Mar 2017 08:45:32 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8467"; a="885560936" X-MGA-submission: =?us-ascii?q?MDEqmtOUK2W2xRfG21WLWJuMkZKVjvYG7lNE6s?= =?us-ascii?q?754AnOmpNsCbkjZsUfBYKzGOkul0TNydeEnmBUiXbwIQaPl5WzNtTlJh?= =?us-ascii?q?BuOFt0whDib/UQxkmdXLFRuYUpqXkLW5QpPW1TeIpEpZdXwm4y/GSGML?= =?us-ascii?q?pE?= Received: from nasanexm02h.na.qualcomm.com ([10.85.0.89]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 15 Mar 2017 08:45:32 -0700 Received: from euamsexm01a.eu.qualcomm.com (10.251.127.40) by nasanexm02h.na.qualcomm.com (10.85.0.89) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 15 Mar 2017 08:45:31 -0700 Received: from potku.adurom.net (10.80.80.8) by euamsexm01a.eu.qualcomm.com (10.251.127.40) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Wed, 15 Mar 2017 16:45:26 +0100 Subject: [PATCH v6 03/10] ath10k: htc: move htc ctrl ep connect to htc_init From: Kalle Valo To: CC: Date: Wed, 15 Mar 2017 17:45:21 +0200 Message-ID: <148959272140.31432.695287262065906036.stgit@potku.adurom.net> In-Reply-To: <148959263520.31432.8488419244476213373.stgit@potku.adurom.net> References: <148959263520.31432.8488419244476213373.stgit@potku.adurom.net> User-Agent: StGit/0.17.1-17-ge4e0 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To euamsexm01a.eu.qualcomm.com (10.251.127.40) 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 From: Erik Stromdahl 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 Signed-off-by: Kalle Valo --- 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 fd5be4484984..92d5ac45327a 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -586,8 +586,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; @@ -650,22 +648,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; } @@ -875,8 +857,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); @@ -884,10 +868,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);