On Tue, 12 Mar 2024 at 02:53, Konrad Dybcio <konrad.dybcio@xxxxxxxxxx> wrote: > > > > On 3/11/24 16:34, Dmitry Baryshkov wrote: > > Add qmi_del_server(), a pair to qmi_add_server(), a way to remove > > running server from the QMI socket. This is e.g. necessary for > > pd-mapper, which needs to readd a server each time the DSP is started or > > stopped. > > > > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx> > > --- > > drivers/soc/qcom/qmi_interface.c | 67 ++++++++++++++++++++++++++++++++++++++++ > > include/linux/soc/qcom/qmi.h | 2 ++ > > 2 files changed, 69 insertions(+) > > > > diff --git a/drivers/soc/qcom/qmi_interface.c b/drivers/soc/qcom/qmi_interface.c > > index bb98b06e87f8..18ff2015c682 100644 > > --- a/drivers/soc/qcom/qmi_interface.c > > +++ b/drivers/soc/qcom/qmi_interface.c > > @@ -289,6 +289,73 @@ int qmi_add_server(struct qmi_handle *qmi, unsigned int service, > > } > > EXPORT_SYMBOL_GPL(qmi_add_server); > > > > +static void qmi_send_del_server(struct qmi_handle *qmi, struct qmi_service *svc) > > +{ > > + struct qrtr_ctrl_pkt pkt; > > + struct sockaddr_qrtr sq; > > + struct msghdr msg = { }; > > + struct kvec iv = { &pkt, sizeof(pkt) }; > > + int ret; > > + > > + memset(&pkt, 0, sizeof(pkt)); > > 0-init instead? > > > + pkt.cmd = cpu_to_le32(QRTR_TYPE_DEL_SERVER); > > + pkt.server.service = cpu_to_le32(svc->service); > > + pkt.server.instance = cpu_to_le32(svc->version | svc->instance << 8); > > + pkt.server.node = cpu_to_le32(qmi->sq.sq_node); > > + pkt.server.port = cpu_to_le32(qmi->sq.sq_port); > > Or perhaps C99-init? This follows 1:1 qcom_send_add_server(). I don't think we should use new style just for this function. > > Konrad -- With best wishes Dmitry