summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/wil6210/pmc.c
diff options
context:
space:
mode:
authorKalle Valo <kvalo@codeaurora.org>2019-09-13 18:15:12 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-09-13 18:15:58 +0300
commitf9e568754562e0f506e12aa899c378b4155080e9 (patch)
tree6eaa7646bd6e074c5a9677fe058e3334dda29435 /drivers/net/wireless/ath/wil6210/pmc.c
parent98ab76ef6b6d16f3fcb5e13ed19448bcc7de83d2 (diff)
parent50e107ff221347494799bf038e0444f195e8ad2a (diff)
Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
ath.git patches for 5.4. Major changes: wil6210 * add support for Enhanced Directional Multi-Gigabit (EDMG) channels 9-11 * add debugfs file to show PCM ring content * report boottime_ns in scan results ath9k * add a separate loader for AR92XX (and older) pci(e) without eeprom, enabled with the new ATH9K_PCI_NO_EEPROM Kconfig option
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/pmc.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/pmc.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/wil6210/pmc.c b/drivers/net/wireless/ath/wil6210/pmc.c
index c49f7988369e..4b7ac14fc2a7 100644
--- a/drivers/net/wireless/ath/wil6210/pmc.c
+++ b/drivers/net/wireless/ath/wil6210/pmc.c
@@ -18,6 +18,7 @@
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/fs.h>
+#include <linux/seq_file.h>
#include "wmi.h"
#include "wil6210.h"
#include "txrx.h"
@@ -431,3 +432,28 @@ out:
return newpos;
}
+
+int wil_pmcring_read(struct seq_file *s, void *data)
+{
+ struct wil6210_priv *wil = s->private;
+ struct pmc_ctx *pmc = &wil->pmc;
+ size_t pmc_ring_size =
+ sizeof(struct vring_rx_desc) * pmc->num_descriptors;
+
+ mutex_lock(&pmc->lock);
+
+ if (!wil_is_pmc_allocated(pmc)) {
+ wil_err(wil, "error, pmc is not allocated!\n");
+ pmc->last_cmd_status = -EPERM;
+ mutex_unlock(&pmc->lock);
+ return -EPERM;
+ }
+
+ wil_dbg_misc(wil, "pmcring_read: size %zu\n", pmc_ring_size);
+
+ seq_write(s, pmc->pring_va, pmc_ring_size);
+
+ mutex_unlock(&pmc->lock);
+
+ return 0;
+}