Re: [PATCH 0/6] In-kernel QMI handling

From: Dan Williams
Date: Fri Aug 04 2017 - 11:37:32 EST


On Fri, 2017-08-04 at 07:59 -0700, Bjorn Andersson wrote:
> This series starts by moving the common definitions of the QMUX
> protocol to the
> uapi header, as they are shared with clients - both in kernel and
> userspace.
>
> This series then introduces in-kernel helper functions for aiding the
> handling
> of QMI encoded messages in the kernel. QMI encoding is a wire-format
> used in
> exchanging messages between the majority of QRTR clients and
> services.

This raises a few red-flags for me. So far, we've kept almost
everything QMI related in userspace and handled all QMI control-channel
messages from libraries like libqmi or uqmi via the cdc-wdm driver and
the "rmnet" interface via the qmi_wwan driver. The kernel drivers just
serve as the transport.

Can you describe what kinds of in-kernel drivers need to actually parse
QMI messages as part of their operation?

Dan

> It then adds an abstractions to reduce the duplication of common code
> in
> drivers that needs to query the name server and send and receive
> encoded
> messages to a remote service.
>
> Finally it introduces a sample implementation for showing QRTR and
> the QMI
> helpers in action. The sample device instantiates in response to
> finding the
> "test service" and implements the "test protocol".
>
> Bjorn Andersson (6):
> Â net: qrtr: Invoke sk_error_report() after setting sk_err
> Â net: qrtr: Move constants to header file
> Â net: qrtr: Add control packet definition to uapi
> Â soc: qcom: Introduce QMI encoder/decoder
> Â soc: qcom: Introduce QMI helpers
> Â samples: Introduce Qualcomm QRTR sample client
>
> Âdrivers/soc/qcom/KconfigÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ8 +
> Âdrivers/soc/qcom/MakefileÂÂÂÂÂÂÂÂÂ|ÂÂÂ3 +
> Âdrivers/soc/qcom/qmi_encdec.cÂÂÂÂÂ| 812
> ++++++++++++++++++++++++++++++++++++++
> Âdrivers/soc/qcom/qmi_interface.cÂÂ| 540 +++++++++++++++++++++++++
> Âinclude/linux/soc/qcom/qmi.hÂÂÂÂÂÂ| 249 ++++++++++++
> Âinclude/uapi/linux/qrtr.hÂÂÂÂÂÂÂÂÂ|ÂÂ35 ++
> Ânet/qrtr/qrtr.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ16 +-
> Âsamples/KconfigÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ8 +
> Âsamples/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ2 +-
> Âsamples/qrtr/MakefileÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂÂ1 +
> Âsamples/qrtr/qrtr_sample_client.c | 603 ++++++++++++++++++++++++++++
> Â11 files changed, 2261 insertions(+), 16 deletions(-)
> Âcreate mode 100644 drivers/soc/qcom/qmi_encdec.c
> Âcreate mode 100644 drivers/soc/qcom/qmi_interface.c
> Âcreate mode 100644 include/linux/soc/qcom/qmi.h
> Âcreate mode 100644 samples/qrtr/Makefile
> Âcreate mode 100644 samples/qrtr/qrtr_sample_client.c
>