ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mihai Moldovan <ionic@ionic.de>
To: ath11k@lists.infradead.org
Subject: [RFC] [PATCH 12/13] wifi: ath12k: implement QRTR endpoint ID fetching for PCI
Date: Sun, 17 Nov 2024 17:06:11 +0100	[thread overview]
Message-ID: <f3156ea7c4205101ec08ca66307a4f7ac06aee70.1731858975.git.ionic@ionic.de> (raw)
In-Reply-To: <cover.1731858971.git.ionic@ionic.de>

QRTR endpoint ID fetching for PCIe devices will use MHI.

Signed-off-by: Mihai Moldovan <ionic@ionic.de>
---
 drivers/net/wireless/ath/ath12k/mhi.c | 19 +++++++++++++++++++
 drivers/net/wireless/ath/ath12k/mhi.h |  2 ++
 drivers/net/wireless/ath/ath12k/pci.c |  1 +
 3 files changed, 22 insertions(+)

diff --git a/drivers/net/wireless/ath/ath12k/mhi.c b/drivers/net/wireless/ath/ath12k/mhi.c
index 2f6d14382ed7..e92ef20826bc 100644
--- a/drivers/net/wireless/ath/ath12k/mhi.c
+++ b/drivers/net/wireless/ath/ath12k/mhi.c
@@ -8,6 +8,8 @@
 #include <linux/pci.h>
 #include <linux/firmware.h>
 
+#include <net/qrtr.h>
+
 #include "core.h"
 #include "debug.h"
 #include "mhi.h"
@@ -654,3 +656,20 @@ void ath12k_mhi_coredump(struct mhi_controller *mhi_ctrl, bool in_panic)
 {
 	mhi_download_rddm_image(mhi_ctrl, in_panic);
 }
+
+int ath12k_mhi_set_qrtr_endpoint_id(struct ath12k_base *ab)
+{
+	struct ath12k_pci *ab_pci = ath12k_pci_priv(ab);
+	struct ath12k_qmi *qmi = &ab->qmi;
+	int ret;
+
+	/* Pass endpoint ID up for QMI usage. */
+	ret = qrtr_endpoint_id_get_or_assign(ab_pci->mhi_ctrl, &qmi->handle.endpoint_id);
+	ath12k_dbg(ab, ATH12K_DBG_PCI, "queried mhi_ctrl QRTR endpoint ID: %u\n", qmi->handle.endpoint_id);
+	if (ret) {
+		ath12k_warn(ab, "failed to query QRTR endpoint ID: %d\n", ret);
+		return ret;
+	}
+
+	return 0;
+}
diff --git a/drivers/net/wireless/ath/ath12k/mhi.h b/drivers/net/wireless/ath/ath12k/mhi.h
index 7358b8477536..c4e00c1747c8 100644
--- a/drivers/net/wireless/ath/ath12k/mhi.h
+++ b/drivers/net/wireless/ath/ath12k/mhi.h
@@ -44,4 +44,6 @@ void ath12k_mhi_clear_vector(struct ath12k_base *ab);
 void ath12k_mhi_suspend(struct ath12k_pci *ar_pci);
 void ath12k_mhi_resume(struct ath12k_pci *ar_pci);
 void ath12k_mhi_coredump(struct mhi_controller *mhi_ctrl, bool in_panic);
+
+int ath12k_mhi_set_qrtr_endpoint_id(struct ath12k_base *ab);
 #endif
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index cf907550e6a4..3d65c64d1b31 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -1514,6 +1514,7 @@ static const struct ath12k_hif_ops ath12k_pci_hif_ops = {
 #ifdef CONFIG_ATH12K_COREDUMP
 	.coredump_download = ath12k_pci_coredump_download,
 #endif
+	.set_qrtr_endpoint_id = ath12k_mhi_set_qrtr_endpoint_id,
 };
 
 static
-- 
2.45.2



  parent reply	other threads:[~2024-11-17 16:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-17 16:05 [RFC] [PATCH 00/13] ath1{1,2}k: support multiple PCI devices in one system Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 01/13] net: qrtr: support registering endpoint-specific data Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 02/13] net: qrtr: mhi: register mhi_controller as " Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 03/13] net: qrtr: smd: register rpmsg_device " Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 04/13] net: qrtr: tun: register inode " Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 05/13] soc: qcom: qmi_helpers: add QRTR endpoint ID to qmi_handle Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 06/13] soc: qcom: qmi_helpers: optionally bind to QRTR endpoint ID in qmi_sock_create Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 07/13] wifi: ath11k: add QRTR endpoint ID hif feature Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 08/13] wifi: ath11k: stub QRTR endpoint ID fetching for AHB Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 09/13] wifi: ath11k: implement QRTR endpoint ID fetching for PCI Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 10/13] wifi: ath11k: bind to QRTR endpoint ID in ath11k_qmi_init_service Mihai Moldovan
2024-11-17 16:06 ` [RFC] [PATCH 11/13] wifi: ath12k: add QRTR endpoint ID hif feature Mihai Moldovan
2024-11-17 16:06 ` Mihai Moldovan [this message]
2024-11-17 16:06 ` [RFC] [PATCH 13/13] wifi: ath12k: bind to QRTR endpoint ID in ath12k_qmi_init_service Mihai Moldovan
2024-11-17 16:59 ` [RFC] [PATCH 00/13] ath1{1,2}k: support multiple PCI devices in one system Mihai Moldovan
2024-11-18 15:52   ` Jeff Johnson
2024-11-22 16:40     ` Jeff Johnson
2024-11-22 20:05       ` Mihai Moldovan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f3156ea7c4205101ec08ca66307a4f7ac06aee70.1731858975.git.ionic@ionic.de \
    --to=ionic@ionic.de \
    --cc=ath11k@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox