mirror of
https://github.com/breeze303/openwrt-ipq.git
synced 2025-12-16 20:41:05 +00:00
wifi_nss: Add threaded NAPI for ath10k and ath11k
Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
parent
711d1a21e5
commit
ee38f27aa6
@ -0,0 +1,32 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/pci.c
|
||||
@@ -1974,6 +1974,7 @@ static int ath10k_pci_hif_start(struct a
|
||||
|
||||
ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif start\n");
|
||||
|
||||
+ dev_set_threaded(&ar->napi_dev, true);
|
||||
ath10k_core_napi_enable(ar);
|
||||
|
||||
ath10k_pci_irq_enable(ar);
|
||||
--- a/drivers/net/wireless/ath/ath10k/sdio.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
|
||||
@@ -1862,6 +1862,7 @@ static int ath10k_sdio_hif_start(struct
|
||||
struct ath10k_sdio *ar_sdio = ath10k_sdio_priv(ar);
|
||||
int ret;
|
||||
|
||||
+ dev_set_threaded(&ar->napi_dev, true);
|
||||
ath10k_core_napi_enable(ar);
|
||||
|
||||
/* Sleep 20 ms before HIF interrupts are disabled.
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.c
|
||||
@@ -3702,6 +3702,9 @@ struct ath10k *ath10k_core_create(size_t
|
||||
ath10k_core_set_coverage_class_work);
|
||||
|
||||
init_dummy_netdev(&ar->napi_dev);
|
||||
+ snprintf(ar->napi_dev.name, sizeof(ar->napi_dev.name), "ath10k_%s",
|
||||
+ wiphy_name(ar->hw->wiphy));
|
||||
+ ar->napi_dev.threaded = 1;
|
||||
|
||||
ret = ath10k_coredump_create(ar);
|
||||
if (ret)
|
||||
@ -0,0 +1,70 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/ahb.c
|
||||
@@ -526,6 +526,7 @@ static int ath11k_ahb_config_ext_irq(str
|
||||
int irq;
|
||||
int ret;
|
||||
bool nss_offload;
|
||||
+ static int devidx = 0;
|
||||
|
||||
/* TCL Completion, REO Dest, ERR, Exception and h2rxdma rings are offloaded
|
||||
* to nss when its enabled, hence don't enable these interrupts
|
||||
@@ -539,6 +540,9 @@ static int ath11k_ahb_config_ext_irq(str
|
||||
irq_grp->ab = ab;
|
||||
irq_grp->grp_id = i;
|
||||
init_dummy_netdev(&irq_grp->napi_ndev);
|
||||
+ snprintf(irq_grp->napi_ndev.name, sizeof(irq_grp->napi_ndev.name), "%s%d:%d",
|
||||
+ "ath11k_ahb", devidx, i);
|
||||
+ irq_grp->napi_ndev.threaded = 1;
|
||||
netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi,
|
||||
ath11k_ahb_ext_grp_napi_poll);
|
||||
|
||||
@@ -604,6 +608,8 @@ static int ath11k_ahb_config_ext_irq(str
|
||||
}
|
||||
}
|
||||
|
||||
+ devidx++;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -308,6 +308,8 @@ static int ath11k_pci_fix_l1ss(struct at
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ devidx++;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/pcic.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
|
||||
@@ -505,8 +505,7 @@ static int ath11k_pcic_ext_grp_napi_poll
|
||||
int i;
|
||||
|
||||
work_done = ath11k_dp_service_srng(ab, irq_grp, budget);
|
||||
- if (work_done < budget) {
|
||||
- napi_complete_done(napi, work_done);
|
||||
+ if (work_done < budget && napi_complete_done(napi, work_done)) {
|
||||
for (i = 0; i < irq_grp->num_irq; i++)
|
||||
enable_irq(irq_grp->ab->irq_num[irq_grp->irqs[i]]);
|
||||
}
|
||||
@@ -550,6 +549,7 @@ static int ath11k_pcic_ext_irq_config(st
|
||||
int i, j, ret, num_vectors = 0;
|
||||
u32 user_base_data = 0, base_vector = 0;
|
||||
unsigned long irq_flags;
|
||||
+ static int devidx = 0;
|
||||
|
||||
ret = ath11k_pcic_get_user_msi_assignment(ab, "DP", &num_vectors,
|
||||
&user_base_data,
|
||||
@@ -568,6 +568,9 @@ static int ath11k_pcic_ext_irq_config(st
|
||||
irq_grp->ab = ab;
|
||||
irq_grp->grp_id = i;
|
||||
init_dummy_netdev(&irq_grp->napi_ndev);
|
||||
+ snprintf(irq_grp->napi_ndev.name, sizeof(irq_grp->napi_ndev.name), "%s%d:%d",
|
||||
+ "ath11k_pci", devidx, i);
|
||||
+ irq_grp->napi_ndev.threaded = 1;
|
||||
netif_napi_add(&irq_grp->napi_ndev, &irq_grp->napi,
|
||||
ath11k_pcic_ext_grp_napi_poll);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user