mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-12-24 04:42:20 +00:00
157 lines
5.2 KiB
Diff
157 lines
5.2 KiB
Diff
From aa2f204ed12b5543aa5f1dfb2b1bb6b458a9dba5 Mon Sep 17 00:00:00 2001
|
|
From: Tamizh Chelvam <tamizhr@codeaurora.org>
|
|
Date: Thu, 27 May 2021 17:24:24 +0530
|
|
Subject: [PATCH 2/2] ath1k: Fix kernel API related compilation error
|
|
|
|
Signed-off-by: Tamizh Chelvam <tamizhr@codeaurora.org>
|
|
---
|
|
drivers/net/wireless/ath/ath11k/ahb.c | 53 +++++++-----------------------
|
|
drivers/net/wireless/ath/ath11k/ce.c | 7 ++++
|
|
drivers/net/wireless/ath/ath11k/core.h | 5 ++-
|
|
drivers/net/wireless/ath/ath11k/coredump.c | 4 +++
|
|
drivers/net/wireless/ath/ath11k/debugfs.c | 1 +
|
|
drivers/net/wireless/ath/ath11k/pci.c | 50 ++++------------------------
|
|
drivers/net/wireless/ath/ath11k/pci.h | 2 --
|
|
drivers/net/wireless/ath/ath11k/pktlog.c | 8 +++++
|
|
drivers/net/wireless/ath/ath11k/qmi.c | 14 ++++----
|
|
9 files changed, 46 insertions(+), 98 deletions(-)
|
|
|
|
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
|
@@ -702,17 +702,39 @@ static int ath11k_core_get_rproc(struct
|
|
struct device *dev = ab->dev;
|
|
struct rproc *prproc;
|
|
phandle rproc_phandle;
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
+ bool multi_pd_arch;
|
|
+ const char *name;
|
|
+#endif
|
|
|
|
- if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) {
|
|
- ath11k_err(ab, "failed to get q6_rproc handle\n");
|
|
- return -ENOENT;
|
|
- }
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
+ multi_pd_arch = of_property_read_bool(dev->of_node, "qcom,multipd_arch");
|
|
+ if (multi_pd_arch) {
|
|
+ if (of_property_read_string(dev->of_node, "qcom,userpd-subsys-name",
|
|
+ &name))
|
|
+ return -EINVAL;
|
|
+
|
|
+ prproc = rproc_get_by_name(name);
|
|
+ if (!prproc) {
|
|
+ ath11k_err(ab, "failed to get rproc\n");
|
|
+ return -EINVAL;
|
|
+ }
|
|
+ } else {
|
|
+#endif
|
|
+ if (of_property_read_u32(dev->of_node, "qcom,rproc", &rproc_phandle)) {
|
|
+ ath11k_err(ab, "failed to get q6_rproc handle\n");
|
|
+ return -ENOENT;
|
|
+ }
|
|
|
|
- prproc = rproc_get_by_phandle(rproc_phandle);
|
|
- if (!prproc) {
|
|
- ath11k_err(ab, "failed to get rproc\n");
|
|
- return -EINVAL;
|
|
+ prproc = rproc_get_by_phandle(rproc_phandle);
|
|
+ if (!prproc) {
|
|
+ ath11k_err(ab, "failed to get rproc\n");
|
|
+ return -EINVAL;
|
|
+ }
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
}
|
|
+#endif
|
|
+
|
|
ab_ahb->tgt_rproc = prproc;
|
|
|
|
return 0;
|
|
--- a/drivers/net/wireless/ath/ath11k/ce.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/ce.c
|
|
@@ -1112,10 +1112,17 @@ void ce_update_tasklet_time_duration_sta
|
|
{
|
|
s64 sched_us, exec_us;
|
|
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
sched_us = (ce_pipe->tasklet_ts.exec_entry_ts.tv64 -
|
|
ce_pipe->tasklet_ts.sched_entry_ts.tv64);
|
|
exec_us = (ce_pipe->tasklet_ts.exec_complete_ts.tv64 -
|
|
ce_pipe->tasklet_ts.exec_entry_ts.tv64);
|
|
+#elif LINUX_VERSION_IS_GEQ(5,4,0)
|
|
+ sched_us = (ce_pipe->tasklet_ts.exec_entry_ts -
|
|
+ ce_pipe->tasklet_ts.sched_entry_ts);
|
|
+ exec_us = (ce_pipe->tasklet_ts.exec_complete_ts -
|
|
+ ce_pipe->tasklet_ts.exec_entry_ts);
|
|
+#endif
|
|
|
|
sched_us = div_s64(sched_us, CE_TIME_DURATION_USEC * NSEC_PER_USEC);
|
|
if (sched_us > CE_TIME_DURATION_USEC_500) {
|
|
--- a/drivers/net/wireless/ath/ath11k/coredump.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/coredump.c
|
|
@@ -174,7 +174,11 @@ void ath11k_coredump_download_rddm(struc
|
|
struct ath11k_dump_segment *segment, *seg_info;
|
|
int i, rem_seg_cnt = 0, len, num_seg, seg_sz, qdss_seg_cnt = 1;
|
|
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
mhi_download_rddm_img(mhi_ctrl, false);
|
|
+#elif LINUX_VERSION_IS_GEQ(5,4,0)
|
|
+ mhi_download_rddm_image(mhi_ctrl, false);
|
|
+#endif
|
|
|
|
rddm_img = mhi_ctrl->rddm_image;
|
|
fw_img = mhi_ctrl->fbc_image;
|
|
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
|
@@ -574,7 +574,11 @@ static int ath11k_pci_alloc_msi(struct a
|
|
num_vectors = pci_alloc_irq_vectors(ab_pci->pdev,
|
|
msi_config->total_vectors,
|
|
msi_config->total_vectors,
|
|
- PCI_IRQ_NOMSIX);
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
+ PCI_IRQ_NOMSIX);
|
|
+#elif LINUX_VERSION_IS_GEQ(5,4,0)
|
|
+ PCI_IRQ_LEGACY|PCI_IRQ_MSI);
|
|
+#endif
|
|
if (num_vectors == msi_config->total_vectors) {
|
|
set_bit(ATH11K_PCI_FLAG_MULTI_MSI_VECTORS, &ab_pci->flags);
|
|
ab_pci->irq_flags = IRQF_SHARED;
|
|
--- a/drivers/net/wireless/ath/ath11k/pktlog.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/pktlog.c
|
|
@@ -157,7 +157,11 @@ static char *ath_pktlog_getbuf(struct at
|
|
|
|
static int pktlog_pgfault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
{
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
unsigned long address = (unsigned long)vmf->virtual_address;
|
|
+#elif LINUX_VERSION_IS_GEQ(5,4,0)
|
|
+ unsigned long address = vmf->address;
|
|
+#endif
|
|
|
|
if (address == 0UL)
|
|
return VM_FAULT_NOPAGE;
|
|
@@ -167,7 +171,11 @@ static int pktlog_pgfault(struct vm_are
|
|
|
|
get_page(virt_to_page(address));
|
|
vmf->page = virt_to_page(address);
|
|
+#if LINUX_VERSION_IS_LESS(5,4,0)
|
|
return VM_FAULT_MINOR;
|
|
+#elif LINUX_VERSION_IS_GEQ(5,4,0)
|
|
+ return 0;
|
|
+#endif
|
|
}
|
|
|
|
static struct vm_operations_struct pktlog_vmops = {
|
|
--- a/drivers/net/wireless/ath/ath11k/mhi.c
|
|
+++ b/drivers/net/wireless/ath/ath11k/mhi.c
|
|
@@ -394,8 +394,10 @@ int ath11k_mhi_register(struct ath11k_pc
|
|
return ret;
|
|
}
|
|
|
|
+#if LINUX_VERSION_IS_GEQ(5,15,0)
|
|
if (!test_bit(ATH11K_PCI_FLAG_MULTI_MSI_VECTORS, &ab_pci->flags))
|
|
mhi_ctrl->irq_flags = IRQF_SHARED | IRQF_NOBALANCING;
|
|
+#endif
|
|
|
|
np = of_find_node_by_type(NULL, "memory");
|
|
if (!np) {
|