From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 38CAD489882; Mon, 21 Sep 2026 11:23:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789989813; cv=none; b=qSDqzdPI/uiXHtjtX8pASjg8HgnyRIuD2EwTM8IpCj955Wm5rxhNwG1zqSMzbbyakdJdW34dtk+899xEzfPX/ECh3Cz5j6Wjr8vvPzSHE81NYlTbuupxadhcscWwdvOGMn/u0U7R4YPN+A5S0RIEE7khBxKVI5RyRw48DNNksX0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789989813; c=relaxed/simple; bh=vyCcA7tnPPht7PT85axNJlbH910qapPAZZT/pgWHgoY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HHZtbvE7jsrAhKoa/TlXX3vCMw7B3yUWxlrf4aw+Obr1sRLm+YEGBk+E7DbbYhQI8ayQOo1jmnZf/X+23mb8bFVeDv5PQT6jXV+W9dTgVdpxcM9WlKYRxNbGaPSlrTXyBTXRIh+khudeIqFzgcNrr0qDJz1b/UXPAEulFNy5dk8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lxUMBD5G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lxUMBD5G" Received: by smtp.kernel.org (Postfix) with ESMTPS id E44D3C2BCFF; Mon, 21 Sep 2026 11:23:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1789989813; bh=vyCcA7tnPPht7PT85axNJlbH910qapPAZZT/pgWHgoY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lxUMBD5G54nJgHXI6SATEKvH+MU27PmJquDxCTRuAt2KHEsTl3dFWkAp4asflXij4 ZC6lxjFQoNsOAFSXA8G5Vnqtil3yGS83Uh4gZaAhKguvC6KuMwlUkPnj+Kvk26RsOz 6cLxkCpCYpY7xNFXNpnLpU5vzsIgla9cRTwYU2PxiPDXd7EWwqLFV3oJspeZrNQHO5 UDSdYJ4mdmpMZo7hnV/3cH7mhpYmKIAVnafCzlv3TIdeV6L2jNS62TW0IShD4tJshR /VQaVhUH3oiokuGJ1kKi6YAFL6uumPI351xv9a+6XT3Tpwa6dgkphQexnam+1kEHsh CkclvWQccpP5g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC475C982ED; Mon, 21 Sep 2026 11:23:32 +0000 (UTC) From: Manivannan Sadhasivam via B4 Relay Date: Mon, 21 Sep 2026 13:23:28 +0200 Subject: [PATCH v2 2/4] net: qrtr: Assign unique node id for MHI endpoints Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260921-qrtr-multi-ep-v2-2-27dd80d841a0@oss.qualcomm.com> References: <20260921-qrtr-multi-ep-v2-0-27dd80d841a0@oss.qualcomm.com> In-Reply-To: <20260921-qrtr-multi-ep-v2-0-27dd80d841a0@oss.qualcomm.com> To: Manivannan Sadhasivam , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Jeff Johnson Cc: linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org, Bjorn Andersson , Chris Lew , Deepak Kumar Singh , Raj Kumar Bhagat , Juha-Matti Tilli , Jeff Hugo , Manivannan Sadhasivam X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2620; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=KeQEnANlAXYlpqTacuONKxeWxAocy2Ur191CkncsK00=; b=owEBbQGS/pANAwAKAVWfEeb+kc71AcsmYgBqsROxhF+92CDxgS35185SmgsprWtjBnV+oBe9+ 3ZJfi9jfeGJATMEAAEKAB0WIQRnpUMqgUjL2KRYJ5dVnxHm/pHO9QUCarETsQAKCRBVnxHm/pHO 9bWtB/9lgpiwXH/3Z6Hr5+ZWeqKn/0lH6dSmm0rphk3SVc+Hhlf7vO8JtsKzrhlyR5mpZ1P1LeE dS/xq4GhKbLzLPKBKw1YAA0UqqVP4u/Vrs7zG1KAfLxNrffNp15doNYvMFxV+ni8xGCKxtLXps0 mfEgPOO/e/2Zm8ALCSnuOjftKWt+RxFdRfkfBJHVvCGXUZANRebV6+cYOKxBEWNuKgU4oLP74Ie o6RIpe7QGFlKsmHqPd91v/pL0IZGnuB5l8b+mcRGZbnHpi8EuhQYrif79Ct20IRcXWBPCUv9UK0 LR/92bLY8nWvHesLT/9ibgy6BPwa4LjxRwrOJ0tBsvANvIMk X-Developer-Key: i=manivannan.sadhasivam@oss.qualcomm.com; a=openpgp; fpr=C668AEC3C3188E4C611465E7488550E901166008 X-Endpoint-Received: by B4 Relay for manivannan.sadhasivam@oss.qualcomm.com/default with auth_id=461 X-Original-From: Manivannan Sadhasivam Reply-To: manivannan.sadhasivam@oss.qualcomm.com From: Manivannan Sadhasivam 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 --- 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 L: linux-arm-msm@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 + +/* 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 + +/* Compute host node id from a per-device index. The index must be unique + * among the host assigned endpoints and smaller than QRTR_NODE_HOST_BASE. + */ +static inline unsigned int qrtr_host_node_id(unsigned int index) +{ + return QRTR_NODE_HOST_BASE + index; +} + +#endif /* _NET_QRTR_H */ diff --git a/net/qrtr/mhi.c b/net/qrtr/mhi.c index 3990da1a65dc..c920ab61f848 100644 --- a/net/qrtr/mhi.c +++ b/net/qrtr/mhi.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include "qrtr.h" @@ -127,7 +128,8 @@ static int qcom_mhi_qrtr_probe(struct mhi_device *mhi_dev, if (rc) return rc; - rc = qrtr_endpoint_register(&qdev->ep, QRTR_EP_NID_AUTO); + rc = qrtr_endpoint_register(&qdev->ep, + qrtr_host_node_id(mhi_dev->mhi_cntrl->index)); if (rc) goto err_unprepare; -- 2.43.0