Signed-off-by: Bartosz Markowski <bartosz.markow...@tieto.com> --- drivers/net/wireless/ath/ath10k/core.h | 3 --- drivers/net/wireless/ath/ath10k/pci.c | 4 ++-- drivers/net/wireless/ath/ath10k/pci.h | 16 +++++++++++----- 3 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index f47b2a0..954a33d 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -327,9 +327,6 @@ struct ath10k { struct mutex vdev_mtx; struct completion vdev_setup_done; - bool hw_v1_workaround; - spinlock_t hw_v1_workaround_lock; - struct workqueue_struct *workqueue; /* prevents concurrent FW reconfiguration */ diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index e4024ef..48a13b0 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -2222,8 +2222,8 @@ retry: /* Enable AR9888 V1 HW workarounds */ if (pci_dev->device == AR9888_1_0_DEVICE_ID) { - ar->hw_v1_workaround = true; - spin_lock_init(&ar->hw_v1_workaround_lock); + ar_pci->hw_v1_workaround = true; + spin_lock_init(&ar_pci->hw_v1_workaround_lock); } ar_pci->ar = ar; diff --git a/drivers/net/wireless/ath/ath10k/pci.h b/drivers/net/wireless/ath/ath10k/pci.h index 9b497a7..d468c31 100644 --- a/drivers/net/wireless/ath/ath10k/pci.h +++ b/drivers/net/wireless/ath/ath10k/pci.h @@ -218,6 +218,9 @@ struct ath10k_pci { /* Map CE id to ce_state */ struct ce_state *ce_id_to_state[CE_COUNT_MAX]; + + bool hw_v1_workaround; + spinlock_t hw_v1_workaround_lock; }; static inline struct ath10k_pci *ath10k_pci_priv(struct ath10k *ar) @@ -259,17 +262,19 @@ static inline void pci_write32_v1_workaround(struct ath10k *ar, void __iomem *addr, u32 offset, u32 value) { - if (ar->hw_v1_workaround) { + struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); + + if (ar_pci->hw_v1_workaround) { unsigned long irq_flags; - spin_lock_irqsave(&ar->hw_v1_workaround_lock, irq_flags); + spin_lock_irqsave(&ar_pci->hw_v1_workaround_lock, irq_flags); ioread32(addr+offset+4); /* 3rd read prior to write */ ioread32(addr+offset+4); /* 2nd read prior to write */ ioread32(addr+offset+4); /* 1st read prior to write */ iowrite32(value, addr+offset); - spin_unlock_irqrestore(&ar->hw_v1_workaround_lock, irq_flags); + spin_unlock_irqrestore(&ar_pci->hw_v1_workaround_lock, irq_flags); } else iowrite32(value, addr+offset); } @@ -315,10 +320,11 @@ static inline void WAR_CE_SRC_RING_WRITE_IDX_SET(struct ath10k *ar, u32 ctrl_addr, unsigned int write_index) { + struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); void __iomem *indicator_addr; - void __iomem *targid = ath10k_pci_priv(ar)->mem; + void __iomem *targid = ar_pci->mem; - if (!ar->hw_v1_workaround) { + if (!ar_pci->hw_v1_workaround) { CE_SRC_RING_WRITE_IDX_SET(ar, targid, ctrl_addr, write_index); return; } -- 1.7.10 _______________________________________________ ath9k-devel mailing list ath9k-devel@lists.ath9k.org https://lists.ath9k.org/mailman/listinfo/ath9k-devel