@@ -11,6 +11,8 @@
#include <linux/of_address.h>
#include <linux/ioport.h>
+#include <net/qrtr.h>
+
#include "core.h"
#include "debug.h"
#include "mhi.h"
@@ -491,3 +493,23 @@ int ath11k_mhi_resume(struct ath11k_pci *ab_pci)
return 0;
}
+
+int ath11k_mhi_set_qrtr_endpoint_id(struct ath11k_base *ab)
+{
+ struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);
+ struct ath11k_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);
+ ath11k_dbg(ab, ATH11K_DBG_PCI,
+ "queried mhi_ctrl QRTR endpoint ID: %u\n",
+ qmi->handle.endpoint_id);
+ if (ret) {
+ ath11k_warn(ab, "failed to query QRTR endpoint ID: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
@@ -27,4 +27,5 @@ void ath11k_mhi_clear_vector(struct ath11k_base *ab);
int ath11k_mhi_suspend(struct ath11k_pci *ar_pci);
int ath11k_mhi_resume(struct ath11k_pci *ar_pci);
+int ath11k_mhi_set_qrtr_endpoint_id(struct ath11k_base *ab);
#endif
@@ -744,6 +744,7 @@ static const struct ath11k_hif_ops ath11k_pci_hif_ops = {
.ce_irq_enable = ath11k_pci_hif_ce_irq_enable,
.ce_irq_disable = ath11k_pci_hif_ce_irq_disable,
.get_ce_msi_idx = ath11k_pcic_get_ce_msi_idx,
+ .set_qrtr_endpoint_id = ath11k_mhi_set_qrtr_endpoint_id,
};
static void ath11k_pci_read_hw_version(struct ath11k_base *ab, u32 *major, u32 *minor)
QRTR endpoint ID fetching for PCIe devices will use MHI. Signed-off-by: Mihai Moldovan <ionic@ionic.de> --- drivers/net/wireless/ath/ath11k/mhi.c | 22 ++++++++++++++++++++++ drivers/net/wireless/ath/ath11k/mhi.h | 1 + drivers/net/wireless/ath/ath11k/pci.c | 1 + 3 files changed, 24 insertions(+)