From patchwork Thu Apr 13 08:29:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 9678967 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 7AA3E601C3 for ; Thu, 13 Apr 2017 08:30:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 69B9B28637 for ; Thu, 13 Apr 2017 08:30:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C63A28649; Thu, 13 Apr 2017 08:30: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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID 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 CB2F028637 for ; Thu, 13 Apr 2017 08:30:02 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:To:From:Subject:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zIGKmPdysnurP4/wFZEVtdsUlQT3Zbu2Ule8KkSTZDY=; b=YmnTqIRB/YIqv6 2pDwp+/2AzGFNhYhTakEdO9wbxz1bkcuIpGgeXp5d/K5hHkgjF9zYV58F3IH900k1a0pQPSfPrDyJ MCe5nsNtue3FGKhl49tOiWoAOPbfvyR4qLqLOSlrT+H+f1KzL/VCqLmgmSNjC1BfqYWzATShEOzrv Vb2V49CS+6obk37VXR2wM2k5a5YYKmPlJtvPYVUqgfKd/F+WSV92Qeqx2mhRrbYvoZLz+o8U2UgM+ A83KDNo2VEkFazpG4ceFsSbCzsDSn2z/thimFuOaJsmu8n35gLeCK1QmmJcqCR61fk4wGm2hL1vvR y0ZOCGXD1H74DpdHbdwA==; 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 1cya8b-0007bp-R1; Thu, 13 Apr 2017 08:29:57 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cya8Y-0007Vm-Gu for ath10k@lists.infradead.org; Thu, 13 Apr 2017 08:29:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1492072194; x=1523608194; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+bB/uSECVXRqXQ0L05c7QaPHFn1qJDc7BVVb77HxBbQ=; b=io7a4gmL6PIswUi1Wl+tuADUoWWxReJAlnv+BBgIur4rj2Pefa6L01to GtOrvEciUtcR5ALg+AmQM0+rgg2QnyjdWs8PpU5k7BeiJLBU67m9cbmSM cYpHBD5j0TvmPZ6Z8dW9TYqQMzSBDjmDy9KXwgWVcFAUvNUJXNDuMa/yr M=; X-IronPort-AV: E=Sophos;i="5.37,194,1488873600"; d="scan'208";a="278400579" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine01.qualcomm.com with ESMTP; 13 Apr 2017 01:29:33 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8496"; a="904844483" X-MGA-submission: =?us-ascii?q?MDElBz0Pyo5uv2aFSYf3z8forVtc865rQfN19v?= =?us-ascii?q?7yMcZPN1yJeXEUGv6lqBDCIum7gK0gzh02U7VWk1RyX2PEMxyt7uLKXX?= =?us-ascii?q?pcKb548dDilGNqoUCIaW+3nvUEALlRfXTM/WTjgiNMlYy5/vkOuI3E6e?= =?us-ascii?q?Qi?= Received: from nasanexm01f.na.qualcomm.com ([10.85.0.32]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 13 Apr 2017 01:29:33 -0700 Received: from euamsexm01a.eu.qualcomm.com (10.251.127.40) by NASANEXM01F.na.qualcomm.com (10.85.0.32) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Thu, 13 Apr 2017 01:29:32 -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; Thu, 13 Apr 2017 10:29:28 +0200 Subject: [PATCH v7 03/10] ath10k: htc: move htc ctrl ep connect to htc_init From: Kalle Valo To: Date: Thu, 13 Apr 2017 11:29:24 +0300 Message-ID: <149207216424.4590.8349330640077644797.stgit@potku.adurom.net> In-Reply-To: <149207201649.4590.5821794186383265138.stgit@potku.adurom.net> References: <149207201649.4590.5821794186383265138.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: NASANEXM01B.na.qualcomm.com (10.85.0.82) To euamsexm01a.eu.qualcomm.com (10.251.127.40) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170413_012954_682123_F8C6002E X-CRM114-Status: GOOD ( 11.60 ) 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: linux-wireless@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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 0a06562c0d32..04e355207a2d 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -590,8 +590,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; @@ -654,22 +652,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; } @@ -879,8 +861,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); @@ -888,10 +872,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);