From patchwork Mon Mar 26 05:40:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govind Singh X-Patchwork-Id: 10307179 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 DC5AB600F6 for ; Mon, 26 Mar 2018 05:40:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDC622946C for ; Mon, 26 Mar 2018 05:40:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D27D72946F; Mon, 26 Mar 2018 05:40:24 +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 [198.137.202.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 7EC8D2946C for ; Mon, 26 Mar 2018 05:40:24 +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: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:In-Reply-To: References:List-Owner; bh=rYazkEPEWh3EQ6DXpiVK40FMfiLYjvWYxvNDH4LC5Bs=; b=KJF aHU8GOqv/AHtNZ5dC4M8oFeOWeeLPeml497Rki7SYJCAS8keNdpnFps7fBFJ6wJ1cjM/KHflM3CDe q6GZqSUPDkUQKpnSENlp6DuPAzYMnuEEAmcrjwFe1cbQSlKWQ+1OZPPaVx/gwIzacuiqlW9T7xVF8 wXPzmsEeUDSFSBRwkoyx2RSBLfiD9UtqQrFlIv53Z/nZjvqli2QthSPj6XuoYHBlWn7JVH5ynZ7nB WiftqnHpFRBeNKfiqbKd93/TxoyblahaX2Qv2boQpWfRJk8vNE+a8LJBtQIwcIdyoCNQXj4SvZKgr 9msDiFrB/Jppi9j9zumTL3o2WtRZfVg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0Krk-0005Az-Ax; Mon, 26 Mar 2018 05:40:20 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f0Krg-0004j4-Mn for ath10k@lists.infradead.org; Mon, 26 Mar 2018 05:40:18 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6903260710; Mon, 26 Mar 2018 05:40:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522042806; bh=v1N0xCxYWDEJHYviU/O0XUcdFOm6esMaUAoDt8Ici0Q=; h=From:To:Cc:Subject:Date:From; b=hmTOFw0idZQA8R9zDFFJE0/VzdEcmY0m4Pb8p/5/MdWaEqbZ9oNLmGGR6Ig2RsEIG k/jwXosnUWjPymog4DRPjk+sBzNfKNmDw7HEa4jL1ypDyMMZ8DIt+nSh/0rLQPwqNT hkTa+oAlr5h01igS3gUz5pZJkl5Kk+7OVkvWTREE= Received: from govinds-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: govinds@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 49659602BA; Mon, 26 Mar 2018 05:40:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1522042805; bh=v1N0xCxYWDEJHYviU/O0XUcdFOm6esMaUAoDt8Ici0Q=; h=From:To:Cc:Subject:Date:From; b=V/ewRask2HT449h9c0vAoaY4WZRtrw2KBL4+vAQWHYlqkYjHTZYf6TXfNul5F7UQd oOB6kO8bindx8SVg9S1fXh79gGgtfuG//WPIDuYeoe9f4X18b/4SDPNUmt45VrRL7N sx87LPmTlRQEHzhpvUzWGVCSnWm3cl3EB54pLBaM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 49659602BA Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=govinds@codeaurora.org From: Govind Singh To: ath10k@lists.infradead.org, bjorn.andersson@linaro.org Subject: [PATCH 05/12] ath10k: Add support of QMI indication message Date: Mon, 26 Mar 2018 11:10:00 +0530 Message-Id: <1522042800-25877-1-git-send-email-govinds@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180325_224016_778126_C2CAD5BA X-CRM114-Status: GOOD ( 12.17 ) 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: Govind Singh , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add support of indication qmi message to communicate with wlan qmi server. Indication message request describes client capability and in response client gets the state of wlan qmi service. Signed-off-by: Govind Singh --- drivers/net/wireless/ath/ath10k/qmi.c | 71 ++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c index 3a7fcc6..bc80b8f 100644 --- a/drivers/net/wireless/ath/ath10k/qmi.c +++ b/drivers/net/wireless/ath/ath10k/qmi.c @@ -29,8 +29,76 @@ #include "qmi.h" #include "qmi_svc_v01.h" +#define WLFW_CLIENT_ID 0x4b4e454c +#define WLFW_TIMEOUT 500 + static struct ath10k_qmi *qmi; +static int +ath10k_qmi_ind_register_send_sync_msg(struct ath10k_qmi *qmi) +{ + struct wlfw_ind_register_resp_msg_v01 *resp; + struct wlfw_ind_register_req_msg_v01 *req; + struct qmi_txn txn; + int ret; + + req = kzalloc(sizeof(*req), GFP_KERNEL); + if (!req) + return -ENOMEM; + + resp = kzalloc(sizeof(*resp), GFP_KERNEL); + if (!resp) { + kfree(req); + return -ENOMEM; + } + + req->client_id_valid = 1; + req->client_id = WLFW_CLIENT_ID; + req->fw_ready_enable_valid = 1; + req->fw_ready_enable = 1; + req->msa_ready_enable_valid = 1; + req->msa_ready_enable = 1; + + ret = qmi_txn_init(&qmi->qmi_hdl, &txn, + wlfw_ind_register_resp_msg_v01_ei, resp); + if (ret < 0) { + pr_err("fail to init txn for ind register resp %d\n", + ret); + goto out; + } + + ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn, + QMI_WLFW_IND_REGISTER_REQ_V01, + WLFW_IND_REGISTER_REQ_MSG_V01_MAX_MSG_LEN, + wlfw_ind_register_req_msg_v01_ei, req); + if (ret < 0) { + qmi_txn_cancel(&txn); + pr_err("fail to send ind register req %d\n", ret); + goto out; + } + + ret = qmi_txn_wait(&txn, WLFW_TIMEOUT * HZ); + if (ret < 0) + goto out; + + if (resp->resp.result != QMI_RESULT_SUCCESS_V01) { + pr_err("qmi indication register request rejected:"); + pr_err("resut:%d error:%d\n", + resp->resp.result, resp->resp.error); + ret = resp->resp.result; + } + + pr_debug("indication register request completed\n"); + kfree(resp); + kfree(req); + return 0; + +out: + kfree(resp); + kfree(req); + return ret; +} + static int ath10k_qmi_event_fw_ready_ind(struct ath10k_qmi *qmi) { pr_debug("fw ready event received\n"); @@ -100,11 +168,12 @@ static void ath10k_qmi_event_server_arrive(struct work_struct *work) work_svc_arrive); int ret; + pr_debug("wlan qmi server arrive\n"); ret = ath10k_qmi_connect_to_fw_server(qmi); if (ret) return; - pr_debug("qmi server arrive\n"); + ath10k_qmi_ind_register_send_sync_msg(qmi); } static void ath10k_qmi_event_server_exit(struct work_struct *work)