[PATCH v3 2/4] net: qrtr: Assign unique node id for MHI endpoints
Manivannan Sadhasivam
mani at kernel.org
Tue Sep 29 12:28:11 PDT 2026
On Tue, Sep 29, 2026 at 10:15:52PM +0530, Deepak Kumar Singh wrote:
>
> On 9/22/2026 7:11 PM, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam at oss.qualcomm.com>
> >
> > Now that the QRTR driver allows using the unique node id for each device,
> > which is different from the node id received from the remote node, compute
> > a unique node id using a new API, qrtr_host_node_id().
> >
> > This API takes the 'index' parameter and adds it to QRTR_NODE_HOST_BASE,
> > whose value is outside of the node id range used by the remote nodes (0 to
> > 0xffff).
> >
> > Finally, call the new API from MHI endpoint driver by passing the MHI
> > controller index as the parameter. The MHI controller index is unique for
> > each controller, thereby for each MHI endpoint device.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam at oss.qualcomm.com>
> > ---
> > MAINTAINERS | 1 +
> > include/net/qrtr.h | 21 +++++++++++++++++++++
> > net/qrtr/mhi.c | 4 +++-
> > 3 files changed, 25 insertions(+), 1 deletion(-)
> >
> > diff --git a/MAINTAINERS b/MAINTAINERS
> > index df8ab9b82402..9c8bb086be28 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -22511,6 +22511,7 @@ QUALCOMM IPC ROUTER (QRTR) DRIVER
> > M: Manivannan Sadhasivam <mani at kernel.org>
> > L: linux-arm-msm at vger.kernel.org
> > S: Maintained
> > +F: include/net/qrtr.h
> > F: include/trace/events/qrtr.h
> > F: include/uapi/linux/qrtr.h
> > F: net/qrtr/
> > diff --git a/include/net/qrtr.h b/include/net/qrtr.h
> > new file mode 100644
> > index 000000000000..745d51b4a6ba
> > --- /dev/null
> > +++ b/include/net/qrtr.h
> > @@ -0,0 +1,21 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +
> > +#ifndef _NET_QRTR_H
> > +#define _NET_QRTR_H
> > +
> > +#include <linux/types.h>
> > +
> > +/* The offset is chosen carefully to not collide with the node ids allocated by
> > + * the remote nodes. All the remote nodes use node ids in range 0 to 0xffff.
> > + */
> > +#define QRTR_NODE_HOST_BASE 0x10000u
>
> Can it be exposed with include/uapi/linux/qrtr.h also. There are user space clients like modem manager
> which need to calculate modified node id to distinguish same service from multi modem over mhi.
> This is same as wlan use case.
>
I'm OK with exposing the final nid to the userspace, but not just the offset and
asking client to calculate the nid on its own.
Will implement this final nid ABI in next version.
- Mani
--
மணிவண்ணன் சதாசிவம்
More information about the ath12k
mailing list