From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932818AbdKGSkS (ORCPT ); Tue, 7 Nov 2017 13:40:18 -0500 Received: from mout.gmx.net ([212.227.17.20]:60849 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932727AbdKGSkQ (ORCPT ); Tue, 7 Nov 2017 13:40:16 -0500 Date: Tue, 7 Nov 2017 19:40:10 +0100 From: Jonathan =?utf-8?Q?Neusch=C3=A4fer?= To: Bjorn Andersson Cc: Andy Gross , Ohad Ben-Cohen , Arun Kumar Neelakantam , Chris Lew , 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 Message-ID: <20171107184010.3ne5zi6gku7b4fif@latitude> References: <20171107052042.22569-1-bjorn.andersson@linaro.org> <20171107052042.22569-6-bjorn.andersson@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2miejx2o6pytgcrj" Content-Disposition: inline In-Reply-To: <20171107052042.22569-6-bjorn.andersson@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) X-Provags-ID: V03:K0:mcVYUtvHPoSLs7TH284qzh2Bf4oqlnhfQ8Yw+u3K3/8okq1TgMM GxUnaLZzrH5S5MqPAHdkLuAAiiOQhGCssWEzi1K5dgh+1WYB9as5A4Imy5xl207NUkV6Rku qKv6ARiMVuBHli4ksEvqEzo4QT7N2OBaYN0enwq6DkOPfLmS6GRYm2zxGWYEomAgEe3SEKP 4l33MP0/fwvd2Du5NAcLg== X-UI-Out-Filterresults: notjunk:1;V01:K0:66djEiQSiEQ=:0oGuVdhnN+oeGdOgIkBxCH ihcFTIQCQjSaSS+mRb5HqnuLXuBO447QciaBf+uJAlNaYabtKqt9wI7njCBF1nzGKKoXJ4rEW fxtv24lHwF1bSM7mPZfZZZcEMjOsjv340XuRpHHVsk/6xjD5aekcfcp7PuOF/uvZBPm1n90w8 qYJV/KJ16iGPG6WBUeTRPIyu0bS5Pwgvac+uNmIf97ezpgV4luNlvI2W5VdX1WwTaxQCcjRLc 3ShOklOuH0e0ifv9Uen0pgpIEu2y4pQumGmnfYUFVpVBPLEcI4NTKqKq964uj6027d++jc4ZC qX5MfWA20KrQhajYUDJpzhfsbL04TjPm+JYElY89GKjvbG0xJQZ3iA1hrbs1SNn7FH29DsB27 BbstynVTANi6AM5QPuyYT2vWeEJ9f+KydZ4jboi1Q0qJHTChDU3Cvg7YElQZQsDIn69TuOAGf 4Z+lUencAIsbfRDLNSB1vOU8FpCyREHhXfclQ58Y8GLVqB5Fn7Za5O0Xaa7J7v6mZ9u4f1OMW cRTZr9epEniO2AVm52gdBjU0tPeDBK7hY8Jtk91J2rZnmNu+zJC32GyPtZICXqWgY2mwUQQ4q xR0clrKRiWD5jB+mrjipWvzuaZsS6sojJnsLETdcJnKPH11RvmVDTm9A+bqhDja2fjivcOhoL 6ANIeLIbyLJ4xYT8R9GbZWdthwEQW9Q5CA2A6vNiFmi+boalUwPLw8+djFaJbnpIR4Rcq/gSr Tl2247aBTGb0rg/3zs61CpA10QjRoaiHOeBsiu7gzkiSz+bqtlvyRtt/FBSuPIsdPU9fLM11A rizqdFhWnHHM/OK0c1UlVr63G1Lrg== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2miejx2o6pytgcrj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Bjorn Andersson > --- [...] > +/* > + * 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 m= essage > + * 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 respo= nse > + * 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 =3D file->private_data; > + struct test_ping_req_msg_v01 req =3D {0}; > + struct qmi_txn txn; > + int ret; > + > + memcpy(req.ping, "ping", sizeof(req.ping)); > + > + ret =3D qmi_txn_init(qmi, &txn, NULL, NULL); > + if (ret < 0) > + return ret; > + > + ret =3D 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 =3D qmi_txn_wait(&txn, 5 * HZ); > + if (ret < 0) > + count =3D 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 messag= e 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 d= ecode 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=C3=A4fer --2miejx2o6pytgcrj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABAgAGBQJaAf4CAAoJEAgwRJqO81/baUQQAKNkWHLPR050/unA5Rogxj5f gRQS8cu0aDyQM7N7FB4jwdRbTo3TYTrNPGfmHXK14Srg99uKA5OTt/LiyPQnoeQ7 9jj+SfoJk+WssNAHKt8qa/JecAuW86xR/0Lvu0Kumf4mAbBPLXhjOgUeI+Wqq71x r8tzs3GvxZD+fu9NrXP+X0C6fjJCbbh7rvdRwjSWqGNgfRIBZRgguuaK0Ojivyhn FC3++pj3UqwC9rtX3qkOE7O/RCkhgMgZTr8grbK3MzOBMxaHV2I/Ep8J0Y6RWM/u s0tZ3QrSD99SaIAuIGHSfmXCiEfVD6m4rlMtNE8krxLDJjm+qXTt1tJcImAV+u4U EVjeM1HdE7LoB0NevLhJG+mLCEsSjZvv/oichrq9whe1QLdzyVsoqB5MJe1ssmtO brlhGaMq22viDRozOSqNSE6GlSP3B6IvjV8iVj10M4YJrzcDst92KjAheEzvmp5K QdvnvbQVbUkeCYDB0I+REqxex86g1hLFBf8yfMFr0k0yLdAxlvN2SkZUxKQtnVfX u05c5GqtLAr8GlqlWolx7VPHcIbzuH5PjgohemBFRtF0U4ct1H417c306kAtn+nG lSP38jwWH3AdwNx/I5nm+7eFuy8EbOX77vZRpOwVAA9BLs+skxasC5Zxi+Rl9u8v /S/gVOJCUyoxp3WT/kg7 =eFFK -----END PGP SIGNATURE----- --2miejx2o6pytgcrj--