From patchwork Mon Nov 25 03:50:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihai Moldovan X-Patchwork-Id: 13884336 X-Patchwork-Delegate: kvalo@adurom.com Received: from mail.ionic.de (ionic.de [145.239.234.145]) (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 2F8EB1EB2F; Mon, 25 Nov 2024 03:51:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=145.239.234.145 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732506719; cv=none; b=Xs2iSRtoqs+aAr4ssVMWLGDDXF1AEmlrpHPA1ZwGi3nwLGcROUE23j1LEJAtUhQ70dq+yMnx0YMc1G21cArNHwNDJ/5oGq1lXqT5oaSJ7wRc7i8qhOtLK4BlsQCakSoa9zS8DTKW0OpzWumrhQuKlhhpBCcekTtuZ8rNmbxc4pk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732506719; c=relaxed/simple; bh=JHo5yCp8VACc+UBmU5nSM4syrbWRWoUtL5s/bOzLsRk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oeiCMK7SkbJ7ze1TSy+qL66tDt7xTH0KgTDePQYq3ZQW8fhLFiUVpWWh6aSGE2Zc9PlrERkRpQyokSd/PLxl5/jKSXTjfTsVmmCsa/fTaXxtL7JhqlRk3r6Yy1BU3e/Jvr0VgQe15Mp3EdrFg1JoGr8Rd39GW0xM/KjG5aPGPvY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ionic.de; spf=pass smtp.mailfrom=ionic.de; dkim=pass (1024-bit key) header.d=ionic.de header.i=@ionic.de header.b=oE3KuVgx; arc=none smtp.client-ip=145.239.234.145 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ionic.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionic.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ionic.de header.i=@ionic.de header.b="oE3KuVgx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ionic.de; s=default; t=1732506710; bh=JHo5yCp8VACc+UBmU5nSM4syrbWRWoUtL5s/bOzLsRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oE3KuVgx2WBFexO24XieyFZYZiWv/m2a6S0hf3cx0zh2q1v+/BbTwSASL6imFkU5l 7X7oxmHqFFsx+sko+OaiUPWZ6aO8zm5BvZRHSdpBuTM+UxiST1OuPtfr0y3aVMdpeP PRmHbz/a5yisZr2GjG/VnZFc+nA3dOcNJRVqmR6g= Received: from grml.local.home.ionic.de (unknown [IPv6:2a00:11:fb41:7a00:21b:21ff:fe5e:dddc]) by mail.ionic.de (Postfix) with ESMTPSA id 80CF81488DDB; Mon, 25 Nov 2024 04:51:50 +0100 (CET) From: Mihai Moldovan To: ath11k@lists.infradead.org, ath12k@lists.infradead.org, Kalle Valo , Jeff Johnson , Manivannan Sadhasivam Cc: Bjorn Andersson , Konrad Dybcio , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC] [PATCH v2 12/13] wifi: ath12k: implement QRTR endpoint ID fetching for PCI Date: Mon, 25 Nov 2024 04:50:27 +0100 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 QRTR endpoint ID fetching for PCIe devices will use MHI. Signed-off-by: Mihai Moldovan --- drivers/net/wireless/ath/ath12k/mhi.c | 22 ++++++++++++++++++++++ drivers/net/wireless/ath/ath12k/mhi.h | 2 ++ drivers/net/wireless/ath/ath12k/pci.c | 1 + 3 files changed, 25 insertions(+) diff --git a/drivers/net/wireless/ath/ath12k/mhi.c b/drivers/net/wireless/ath/ath12k/mhi.c index 2f6d14382ed7..a6067c236c0d 100644 --- a/drivers/net/wireless/ath/ath12k/mhi.c +++ b/drivers/net/wireless/ath/ath12k/mhi.c @@ -8,6 +8,8 @@ #include #include +#include + #include "core.h" #include "debug.h" #include "mhi.h" @@ -654,3 +656,23 @@ 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