aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/pci.h
diff options
context:
space:
mode:
authorRaja Mani <rmani@qti.qualcomm.com>2016-01-27 15:24:23 +0530
committerKalle Valo <kvalo@qca.qualcomm.com>2016-01-28 10:47:17 +0200
commit4ddb3299aa49ddeb40680d7427d3259d32aefa6d (patch)
tree483c2247ff1b34d772dc06b8d06af980f391f6ca /drivers/net/wireless/ath/ath10k/pci.h
parentath10k: make some of ath10k_pci_* func reusable (diff)
downloadlinux-dev-4ddb3299aa49ddeb40680d7427d3259d32aefa6d.tar.xz
linux-dev-4ddb3299aa49ddeb40680d7427d3259d32aefa6d.zip
ath10k: make ath10k_pci_read32/write32() ops more generic
ath10k_pci_read32/write32() does work more specific to PCI by ensuring pci wake/sleep for every read and write. There is a plan to use most of stuff available in pci.c (irq stuff, copy engine, etc) for AHB case. Such kind of pci wake/sleep for every read/write is not required in AHB case (qca4019). All those reusable areas in pci.c and ce.c calls ath10k_pci_read32/write32() for low level read and write. In fact, ath10k_pci_read32/write32() should do what it does today for PCI case. But for AHB, it has to do differently. To make ath10k_pci_read32/write32() more generic, new function pointers are added in ar_pci for the function which does operation more close to the bus. Later, corresponding bus specific read and write function will be mapped to that. ath10k_pci_read32/write32() are changed to call directly those function pointers without worrying which bus underlying to it. Also, the function to get number of bank is changed in the same way. Signed-off-by: Raja Mani <rmani@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/pci.h')
-rw-r--r--drivers/net/wireless/ath/ath10k/pci.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h
index ae76131aa081..41f3faced84c 100644
--- a/drivers/net/wireless/ath/ath10k/pci.h
+++ b/drivers/net/wireless/ath/ath10k/pci.h
@@ -157,6 +157,12 @@ struct ath10k_pci_supp_chip {
u32 rev_id;
};
+struct ath10k_bus_ops {
+ u32 (*read32)(struct ath10k *ar, u32 offset);
+ void (*write32)(struct ath10k *ar, u32 offset, u32 value);
+ int (*get_num_banks)(struct ath10k *ar);
+};
+
struct ath10k_pci {
struct pci_dev *pdev;
struct device *dev;
@@ -225,6 +231,8 @@ struct ath10k_pci {
* on MMIO read/write.
*/
bool pci_ps;
+
+ const struct ath10k_bus_ops *bus_ops;
};
static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar)