linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 09/12] ath10k: Add QMI HOST CAP request support
@ 2018-03-26  5:41 Govind Singh
  2018-05-11 18:55 ` Bjorn Andersson
  0 siblings, 1 reply; 2+ messages in thread
From: Govind Singh @ 2018-03-26  5:41 UTC (permalink / raw)
  To: ath10k, bjorn.andersson; +Cc: linux-wireless, Govind Singh

Add support for host capablity request
qmi message for wcn3990 target.

Signed-off-by: Govind Singh <govinds@codeaurora.org>
---
 drivers/net/wireless/ath/ath10k/qmi.c | 65 +++++++++++++++++++++++++++++++++++
 1 file changed, 65 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c
index 65a43af..a33681d 100644
--- a/drivers/net/wireless/ath/ath10k/qmi.c
+++ b/drivers/net/wireless/ath/ath10k/qmi.c
@@ -357,6 +357,67 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi)
 	return ret;
 }
 
+static int ath10k_qmi_host_cap_send_sync(struct ath10k_qmi *qmi)
+{
+	struct wlfw_host_cap_resp_msg_v01 *resp;
+	struct wlfw_host_cap_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->daemon_support_valid = 1;
+	req->daemon_support = 0;
+
+	pr_debug("daemon_support is %d\n", req->daemon_support);
+
+	ret = qmi_txn_init(&qmi->qmi_hdl, &txn,
+			   wlfw_host_cap_resp_msg_v01_ei, resp);
+	if (ret < 0) {
+		pr_err("Fail to init txn for Capability resp %d\n", ret);
+		goto out;
+	}
+
+	ret = qmi_send_request(&qmi->qmi_hdl, NULL, &txn,
+			       QMI_WLFW_HOST_CAP_REQ_V01,
+			       WLFW_HOST_CAP_REQ_MSG_V01_MAX_MSG_LEN,
+			       wlfw_host_cap_req_msg_v01_ei, req);
+	if (ret < 0) {
+		qmi_txn_cancel(&txn);
+		pr_err("Fail to send Capability 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 host capability req rejected, result:%d error:%d\n",
+		       resp->resp.result, resp->resp.error);
+		ret = -resp->resp.result;
+		goto out;
+	}
+
+	pr_debug("host cap request completed\n");
+	kfree(resp);
+	kfree(req);
+	return 0;
+
+out:
+	kfree(resp);
+	kfree(req);
+	return ret;
+}
+
 static int
 ath10k_qmi_ind_register_send_sync_msg(struct ath10k_qmi *qmi)
 {
@@ -500,6 +561,10 @@ static void ath10k_qmi_event_server_arrive(struct work_struct *work)
 	if (ret)
 		return;
 
+	ret = ath10k_qmi_host_cap_send_sync(qmi);
+	if (ret)
+		return;
+
 	ret = ath10k_qmi_msa_mem_info_send_sync_msg(qmi);
 	if (ret)
 		return;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 09/12] ath10k: Add QMI HOST CAP request support
  2018-03-26  5:41 [PATCH 09/12] ath10k: Add QMI HOST CAP request support Govind Singh
@ 2018-05-11 18:55 ` Bjorn Andersson
  0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Andersson @ 2018-05-11 18:55 UTC (permalink / raw)
  To: Govind Singh; +Cc: ath10k, linux-wireless

On Sun 25 Mar 22:41 PDT 2018, Govind Singh wrote:

> Add support for host capablity request
> qmi message for wcn3990 target.
> 
> Signed-off-by: Govind Singh <govinds@codeaurora.org>
> ---
>  drivers/net/wireless/ath/ath10k/qmi.c | 65 +++++++++++++++++++++++++++++++++++
>  1 file changed, 65 insertions(+)
> 
> diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c
> index 65a43af..a33681d 100644
> --- a/drivers/net/wireless/ath/ath10k/qmi.c
> +++ b/drivers/net/wireless/ath/ath10k/qmi.c
> @@ -357,6 +357,67 @@ static int ath10k_qmi_cap_send_sync_msg(struct ath10k_qmi *qmi)
>  	return ret;
>  }
>  
> +static int ath10k_qmi_host_cap_send_sync(struct ath10k_qmi *qmi)
> +{
> +	struct wlfw_host_cap_resp_msg_v01 *resp;

This is 4 bytes,

> +	struct wlfw_host_cap_req_msg_v01 *req;

and this is 2 bytes, use the stack.

> +	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->daemon_support_valid = 1;
> +	req->daemon_support = 0;
> +
> +	pr_debug("daemon_support is %d\n", req->daemon_support);

This print seems unnecessary.

> +
> +	ret = qmi_txn_init(&qmi->qmi_hdl, &txn,
> +			   wlfw_host_cap_resp_msg_v01_ei, resp);
> +	if (ret < 0) {
> +		pr_err("Fail to init txn for Capability resp %d\n", ret);

Same comments the rest of the function as given on previous patches.

> +		goto out;
> +	}

Regards,
Bjorn

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-11 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-26  5:41 [PATCH 09/12] ath10k: Add QMI HOST CAP request support Govind Singh
2018-05-11 18:55 ` Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).