From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Andy Gross <andy.gross@linaro.org>,
Ohad Ben-Cohen <ohad@wizery.com>,
Arun Kumar Neelakantam <aneela@codeaurora.org>,
Chris Lew <clew@codeaurora.org>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-soc@vger.kernel.org, linux-remoteproc@vger.kernel.org
Subject: Re: [PATCH v2 5/5] samples: Introduce Qualcomm QMI sample client
Date: Tue, 7 Nov 2017 19:40:10 +0100 [thread overview]
Message-ID: <20171107184010.3ne5zi6gku7b4fif@latitude> (raw)
In-Reply-To: <20171107052042.22569-6-bjorn.andersson@linaro.org>
[-- Attachment #1: Type: text/plain, Size: 2718 bytes --]
Hi, some small comments below.
On Mon, Nov 06, 2017 at 09:20:42PM -0800, Bjorn Andersson wrote:
> Introduce a sample driver that register for server notifications and
> spawn clients for each available test service (service 15). The spawned
> clients implements the interface for encoding "ping" and "data" requests
> and decode the responses from the remote.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
[...]
> +/*
> + * ping_pong_store() - ping_pong debugfs file write handler
The function name is ping_write now.
> + * @file: debugfs file context
> + * @user_buf: reference to the user data
> + * @count: number of bytes in @user_buf
> + * @ppos: offset in @file to write
> + *
> + * Returns @count, or negative errno on failure.
> + *
> + * This function allows user space to send out a ping_pong QMI encoded message
> + * to the associated remote test service and will return with the result of the
> + * transaction. It serves as an example of how to provide a custom response
> + * handler.
> + */
> +static ssize_t ping_write(struct file *file, const char __user *user_buf,
> + size_t count, loff_t *ppos)
The data in user_buf is completely ignored, right? Perhaps that's worth
mentioning in the doc comment.
> +{
> + struct qmi_handle *qmi = file->private_data;
> + struct test_ping_req_msg_v01 req = {0};
> + struct qmi_txn txn;
> + int ret;
> +
> + memcpy(req.ping, "ping", sizeof(req.ping));
> +
> + ret = qmi_txn_init(qmi, &txn, NULL, NULL);
> + if (ret < 0)
> + return ret;
> +
> + ret = qmi_send_request(qmi, NULL, &txn,
> + TEST_PING_REQ_MSG_ID_V01,
> + TEST_PING_REQ_MAX_MSG_LEN_V01,
> + test_ping_req_msg_v01_ei, &req);
> + if (ret < 0) {
> + qmi_txn_cancel(&txn);
> + return ret;
> + }
> +
> + ret = qmi_txn_wait(&txn, 5 * HZ);
> + if (ret < 0)
> + count = ret;
> +
> + return count;
> +}
[...]
> +
> +/*
> + * data_store() - data debugfs file write handler
data_write
> + * @file: debugfs file context
> + * @user_buf: reference to the user data
> + * @count: number of bytes in @user_buf
> + * @ppos: offset in @file to write
> + *
> + * Returns @count, or negative errno on failure.
> + *
> + * This function allows user space to send out a data QMI encoded message to
> + * the associated remote test service and will return with the result of the
> + * transaction. It serves as an example of how to have the QMI helpers decode a
> + * transaction response into a provided object automatically.
> + */
> +static ssize_t data_write(struct file *file, const char __user *user_buf,
> + size_t count, loff_t *ppos)
Jonathan Neuschäfer
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2017-11-07 18:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-07 5:20 [PATCH v2 0/5] In-kernel QMI helpers and sysmon Bjorn Andersson
2017-11-07 5:20 ` [PATCH v2 1/5] soc: qcom: Introduce QMI encoder/decoder Bjorn Andersson
2017-11-07 5:20 ` [PATCH v2 2/5] soc: qcom: Introduce QMI helpers Bjorn Andersson
2017-11-07 16:27 ` Arun Kumar Neelakantam
2017-11-07 19:18 ` Bjorn Andersson
2017-11-08 21:40 ` Chris Lew
2017-11-07 5:20 ` [PATCH v2 3/5] remoteproc: Pass type of shutdown to subdev remove Bjorn Andersson
2017-11-07 5:20 ` [PATCH v2 4/5] remoteproc: qcom: Introduce sysmon Bjorn Andersson
2017-11-07 5:20 ` [PATCH v2 5/5] samples: Introduce Qualcomm QMI sample client Bjorn Andersson
2017-11-07 18:40 ` Jonathan Neuschäfer [this message]
2017-11-07 19:06 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171107184010.3ne5zi6gku7b4fif@latitude \
--to=j.neuschaefer@gmx.net \
--cc=andy.gross@linaro.org \
--cc=aneela@codeaurora.org \
--cc=bjorn.andersson@linaro.org \
--cc=clew@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=ohad@wizery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®