Article View: linux.kernel.netdev
Article #6548[PATCH v4 3/4] wifi: ath11k: Connect to the QMI server belonging to the device owned by this driver
From: Manivannan Sadhasivam via B4 Rel...
Date: Thu, 22 Oct 2026 17:43
Date: Thu, 22 Oct 2026 17:43
108 lines
15391 bytes
15391 bytes
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
When two identical ath11k PCIe devices are connected to the same host, both
advertise the WLFW service with the same service and instance id. The QMI
lookup reports both servers to each device, so a device may connect to the
firmware running on the other device.
But now, QRTR provides each MHI endpoint a unique node id which is
different from the node id announced by the device. So use the same id to
pick the correct server. Add a get_qrtr_node_id() HIF callback that returns
the node id derived from the MHI controller index and zero for transports
that do not assign one. In the new_server callback, reject any service
whose node id does not match. A node id of zero disables the check, so
transports that do not assign one keep their current behavior.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
drivers/net/wireless/ath/ath11k/hif.h | 9 +++++++++
drivers/net/wireless/ath/ath11k/pci.c | 9 +++++++++
drivers/net/wireless/ath/ath11k/qmi.c | 10 ++++++++++
3 files changed, 28 insertions(+)
diff --git a/drivers/net/wireless/ath/ath11k/hif.h b/drivers/net/wireless/ath/ath11k/hif.h
index 017fed1b4bd1..f432fa4890be 100644
--- a/drivers/net/wireless/ath/ath11k/hif.h
+++ b/drivers/net/wireless/ath/ath11k/hif.h
@@ -32,6 +32,7 @@ struct ath11k_hif_ops {
void (*ce_irq_disable)(struct ath11k_base *ab);
void (*get_ce_msi_idx)(struct ath11k_base *ab, u32 ce_id, u32 *msi_idx);
void (*coredump_download)(struct ath11k_base *ab);
+ unsigned int (*get_qrtr_node_id)(struct ath11k_base *ab);
};
static inline void ath11k_hif_ce_irq_enable(struct ath11k_base *ab)
@@ -159,4 +160,12 @@ static inline void ath11k_hif_coredump_download(struct ath11k_base *ab)
ab->hif.ops->coredump_download(ab);
}
+static inline unsigned int ath11k_hif_get_qrtr_node_id(struct ath11k_base *ab)
+{
+ if (!ab->hif.ops->get_qrtr_node_id)
+ return 0;
+
+ return ab->hif.ops->get_qrtr_node_id(ab);
+}
+
#endif /* _HIF_H_ */
diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c
index a163168f3617..d40c057e130c 100644
--- a/drivers/net/wireless/ath/ath11k/pci.c
+++ b/drivers/net/wireless/ath/ath11k/pci.c
@@ -10,6 +10,7 @@
#include <linux/of.h>
#include <linux/time.h>
#include <linux/vmalloc.h>
+#include <net/qrtr.h>
#include "pci.h"
#include "core.h"
@@ -900,6 +901,13 @@ static int ath11k_pci_start(struct ath11k_base *ab)
return 0;
}
+static unsigned int ath11k_pci_get_qrtr_node_id(struct ath11k_base *ab)
+{
+ struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);
+
+ return qrtr_host_node_id(ab_pci->mhi_ctrl->index);
+}
+
static const struct ath11k_hif_ops ath11k_pci_hif_ops = {
.start = ath11k_pci_start,
.stop = ath11k_pcic_stop,
@@ -921,6 +929,7 @@ static const struct ath11k_hif_ops ath11k_pci_hif_ops = {
#ifdef CONFIG_DEV_COREDUMP
.coredump_download = ath11k_pci_coredump_download,
#endif
+ .get_qrtr_node_id = ath11k_pci_get_qrtr_node_id,
};
static void ath11k_pci_read_hw_version(struct ath11k_base *ab, u32 *major, u32 *minor)
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index 7dc07339b957..6d86e552038c 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -3170,8 +3170,18 @@ static int ath11k_qmi_ops_new_server(struct qmi_handle *qmi_hdl,
struct ath11k_qmi *qmi = container_of(qmi_hdl, struct ath11k_qmi, handle);
struct ath11k_base *ab = qmi->ab;
struct sockaddr_qrtr *sq = &qmi->sq;
+ unsigned int node_id;
int ret;
+ /* Identical devices advertise the same QMI services, so connect only to
+ * the QMI server on this device's node. A node id of 0 means the
+ * transport has not assigned a unique node id, so accept the server
+ * unfiltered.
+ */
+ node_id = ath11k_hif_get_qrtr_node_id(ab);
+ if (node_id && service->node != node_id)
+ return -EINVAL;
+
sq->sq_family = AF_QIPCRTR;
sq->sq_node = service->node;
sq->sq_port = service->port;
--
2.43.0
Technical Details
Message-ID:
<20261022-qrtr-multi-ep-v4-3-c6fdb75fcd3e@oss.qualcomm.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350728-linux-kernel-netdev=dewy.ruReferences:
<20261022-qrtr-multi-ep-v4-0-c6fdb75fcd3e@oss.qualcomm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350728-linux-kernel-netdev=dewy.ru From: devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org (Manivannan Sadhasivam via B4 Relay) Newsgroups: linux.kernel.netdev Subject: [PATCH v4 3/4] wifi: ath11k: Connect to the QMI server belonging to the device owned by this driver Date: Thu, 22 Oct 2026 19:43:09 +0200 Organization: Usenet Network Message-ID: <20261022-qrtr-multi-ep-v4-3-c6fdb75fcd3e@oss.qualcomm.com> References: <20261022-qrtr-multi-ep-v4-0-c6fdb75fcd3e@oss.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Injection-Info: usenet.network; logging-data="281036"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:zs7apHEWPVEe/czXQq+IV9x1IW4= sha256:2Gh9U1dAKZOTZP5Do7uWyLHLcUXrdwRQgKgD8xTyXYY= sha1:eMris2A6H7lDxF/qMpDgQGasyrg= sha256:vC4DvEnDaVUXmot05AJA71Wk3eUvNM9OKkc9bAWudiQ= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id CF5D2111318; Thu, 22 Oct 2026 20:44:11 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.739 X-Spam-Status: No, score=-3.739 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.339, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O9kKOAQ3W2jK; Thu, 22 Oct 2026 20:44:08 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-350728-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id 79D311112F7; Thu, 22 Oct 2026 20:44:00 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 40DAC2D492; Thu, 22 Oct 2026 17:43:29 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792691002; b=Ju8ICxgcLQkH5skcOqg12JS4evGzK8RTAdbFC+lD3QIDCzx1rk11RouctgcX813vd5YU 1HtQbvfLeaPOQq5326q4U8ia6y89gvVohocvCGVv9L3FCjOaN6a/u7DioBv2R+e8rQeuG 2XsOAcQmgFE07JV+uN5FBBN/Ro1E6tKG6EQmihHaJk5MO/C99DjGSYMRcrt9HJh+QOf1/ Xbb4mvBYWdd7L1i+JAIQgWXTaHVkElpDpm7B6WSx4GDEBo7jDCU2WkAT5DiwMW7PXZ1i+ rHc3+wLNh2Tj8/YXtd1pPAdUp3yHPRqdtGqFzcixpqidP0Jr3Ph0sW+Ova/2RAWkAcA== X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792691002; h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date: Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ADWdCCi+iizlsM98N39+pquefHMXXpgP0VwZ90V6c1E=; b=AJ3gbrav4wkKeCIDbcOdNgSx8Usn2vflWCvktgSyPBDERNZnMi8uVlY9L3MLbl++l0kS QfZLEcLtQLtjLCIuaPkRHgFqbSKII58QcDsBI5Ldxdowp2giNM9fq+9S6pheme2gR6bH5 IFloMGI8sfl8/MlnGJQcaqXW7IjGEHLJSc72jSgImcE+7argCy+SpOv1ATBF7mA+CcS1e X5RWFciFbMfMe5FFQPL3O8puCmWUvPpKjnqpUcEcKnrIyJgY7lNPGpxx4I5tFQfttb6zm L4cvqPQ+AJjvcUqanZGvOkPNG+HlE/eXfkV6qCBvYERalUDtV2mRoQri08Cb7peydAQ== X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T0VwSJYt; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 85284606F1D8; Thu, 22 Oct 2026 17:43:22 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T0VwSJYt X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1792691001; b=5E4KUtOIrRvj3eGNT1XPfYEA6eCNnAVtnLLsTrIVCdGB91fhF/34vUTS3LBKPhwfwfMp YJ1JDybPO3uNLqJiQ0087e10tGSxg4mDABycE4hY8J/cvzPcqxGfmxMKsjnpGxFbjgl7O ELwsW9hZ/oT3fy8z42VumvKQfkSyZzPgtFlfWu98zNQq086tkDnkNHllwsGEm8S4jF1r1 fXr86iIOm/iwvJEuNRheGE2AJKoGfHJlnqQTDJSHvf2RLId0Z5IRTnTazZzK3oJv9ZogT +gROaiVOBp2UQXIY1BjPV7l86O0bnoLTjl8Yy2WDn73XP+0PAS4vGWGAspjNDo4DDNQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792691001; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ADWdCCi+iizlsM98N39+pquefHMXXpgP0VwZ90V6c1E=; b=C8r/Xqn7QWh9wob4iaWFXfElOhanWCOhoEL94c1Qf7JNm+tkuF+FNdXT0Fw9YJETUy0E MAGgvT8YvGEXVshZDjOjHRuVSqeBmmBSyRDTtRbZZWDSMAYSraopnSKIzCcsnCjwezgoL VZGk5thM+weEl3fDthqSaRo+Adzu+hV/1dfyhHfwIBi+fVww2gvBep/2VeQgT6Blxoovu 9sDNFq4uNxXsMj43tCpxZaTXRxoGmDWlFlYNvhfg1qskzKmcIvvduvtrtvFWDjsVrvRwl g2qx2n4d1EY4f9l+QxOK7stuXW4KeWLuL1aZ0piqX74l6q5ZRiRBeEmnfbTciHA7Mbg== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=T0VwSJYt; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D65C606A332; Thu, 22 Oct 2026 17:43:21 +0000 (UTC) X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1792691001; b=jbKNmLGSmuDZ9Fm0+xLWa12m1vMaRXVrtXvUeSDj1UaLpGaDkvX8fqh7nt3iUzcqeNY9 uSkAErkL+g6ubKR6CuZoBWHdI/zVIOgXMUrbYP2jhj5OdmbdKyFWn7XV0moDEvynCHs6n hTD4V/+1OyUl5AV05cqSUgS8NIOSyGqowc/o+ZaDUrHw91N/yr1bS/Ov5ghZNh1xjKSHI 6lJ1fVT8+vHZ7ggYmPGTvj0+RSCxKTR4fQCi4O0ME2t1AH7ZNj5GKjPBOtIN3dQ7dnKU+ k5Kjas3qI6aw9wSSIDQ5wxxtKKRv2xtY/if7llgn89cZJ+POCpnr7WN+wvrJbhS+M+w== X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1792691001; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ADWdCCi+iizlsM98N39+pquefHMXXpgP0VwZ90V6c1E=; b=fORBzXxoQabBWSabQHsrPp98+dW6YuGSBqF50yHNftxF+K3AiRjCGmuQDwYN8f1BM/FN t91v9PDKH+60fUuWFW/I4bYbOjI59tJIWX8BBT5sz2/FduKwbJAULpNXow9U6/svmJSyQ a3UTDzGcKS4OG+P9ykR32YHaaMFHkcCtltFjncH53BvxrlYtW6pzX0hx4XfmNJ+/6jeLG Ff0yv6Mg86t1KBUXmTpxMotlr2LpGzSPhYgE8Er00097KVpVc2IH3u2s8J+AOIKK4mb6j cczVwEGOAa5FchYSmfXZWTRhenk6Z+1rHELVwcf9avn7+gd8cx4DvY2ie8bppW/5PuQ== X-ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 6831E1F031E0; Thu, 22 Oct 2026 17:43:19 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1792691001; bh=ADWdCCi+iizlsM98N39+pquefHMXXpgP0VwZ90V6c1E=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=T0VwSJYtLWy5OkIhzpsbbRvQUIUB81DkRzJPcICgziHUv8nwWqBws7xi+/xRJRfzH dnHwiL95TVC2z9dwNTHUE2c/dlTFHqk8Ke28X4aVXFrLHtv8AKrrixzbXKrjLksb0J g7IyYxh9g6n6nkt7wcNHzBdncWM/3tA6Z2DudZi9MbZ3uAX25fIIYfT5nqVzFy1lso OTpAvTfaltn43GdKTA8sRQYU/xHTh2AszbJJi5AmotqsQ/4wOZk8xgBc25xOhkHXRZ imYUllQBKRhzmmOC+SIhqR6s9uOG7MsFV4+ttO25eJoUFyuDP39bigdXd0SVzC9zFV bR2qPJUoa/lmw== X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id D670541E99; Thu, 22 Oct 2026 17:43:18 +0000 (UTC) X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261022-qrtr-multi-ep-v4-0-c6fdb75fcd3e@oss.qualcomm.com> X-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 <andersson@kernel.org>, Chris Lew <christopher.lew@oss.qualcomm.com>, Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>, Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com>, Juha-Matti Tilli <juha-matti.tilli@iki.fi>, Jeff Hugo <jeff.hugo@oss.qualcomm.com>, Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com> X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=4091; i=manivannan.sadhasivam@oss.qualcomm.com; h=from:subject:message-id; bh=5fbq8IwxgM8XJ6aODOGmdRnrrzV+MomZgCeu5eoQmhc=; b=owGbwMvMwMUYOl/w2b+J574ynlZLYsi65W2SvVmxnE/cf5vntrT6rW+c7n+oMLh3iNV1o53Gs +nWDSGenYzGLAyMXAyyYoos6UudtRo9Tt9YEqE+HWYQKxPIFAYuTgGYSOIq9v+ZiS0zIxv2mkd5 rw3vvck3P9T0eInqj32COwM9itraiyRM7prfdPaPD3YO4BZ9niK8tyRCzWvPr9dbfdbFRxVGP57 Bo1YmwBA8W6y/91gUL7PGPYtTV35P4n4neZ+Vz/J3sYd/RrH7Gtbwf/q3/JL/NKe/y1XbVV+wzJ T3ULXSjNR0zc1uZk0m7ceWf/VfX/b6RZXEVLU9OncfJBt3NRvr3uEuXPe8XZLfJYt1jTSD4Juap J8Tn0al/LTk7pdfksl5UEXp5DItDgPl7Tm55X7RE6cKBqZ+Ea6JP1TweZfpiweer5MNT9qtLT33 83GPFouAqQvbB6YqpxKvz77da8JOsWRMqb2UOCUz8TcA 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 <manivannan.sadhasivam@oss.qualcomm.com> X-Reply-To: manivannan.sadhasivam@oss.qualcomm.com