aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/ath9k.h
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-03-17 18:01:30 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-17 18:01:30 -0400
commit2d6a5e9500103680464a723a4564961675652680 (patch)
treed18903333aae8a4415b179d6e7d38f203724892c /drivers/net/wireless/ath9k/ath9k.h
parentbd257ed9f1d129b4e881f513a406b435c8852565 (diff)
parentf10023a4ef3f5cc05457b059c6880bc447adfa1f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/igb/igb_main.c drivers/net/qlge/qlge_main.c drivers/net/wireless/ath9k/ath9k.h drivers/net/wireless/ath9k/core.h drivers/net/wireless/ath9k/hw.c
Diffstat (limited to 'drivers/net/wireless/ath9k/ath9k.h')
-rw-r--r--drivers/net/wireless/ath9k/ath9k.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath9k/ath9k.h b/drivers/net/wireless/ath9k/ath9k.h
index f0b105a11ae2..b64be8e9a690 100644
--- a/drivers/net/wireless/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath9k/ath9k.h
@@ -579,6 +579,7 @@ struct ath_softc {
579 void __iomem *mem; 579 void __iomem *mem;
580 int irq; 580 int irq;
581 spinlock_t sc_resetlock; 581 spinlock_t sc_resetlock;
582 spinlock_t sc_serial_rw;
582 struct mutex mutex; 583 struct mutex mutex;
583 584
584 u8 curbssid[ETH_ALEN]; 585 u8 curbssid[ETH_ALEN];
@@ -724,4 +725,36 @@ void ath9k_wiphy_pause_all_forced(struct ath_softc *sc,
724bool ath9k_wiphy_scanning(struct ath_softc *sc); 725bool ath9k_wiphy_scanning(struct ath_softc *sc);
725void ath9k_wiphy_work(struct work_struct *work); 726void ath9k_wiphy_work(struct work_struct *work);
726 727
728/*
729 * Read and write, they both share the same lock. We do this to serialize
730 * reads and writes on Atheros 802.11n PCI devices only. This is required
731 * as the FIFO on these devices can only accept sanely 2 requests. After
732 * that the device goes bananas. Serializing the reads/writes prevents this
733 * from happening.
734 */
735
736static inline void ath9k_iowrite32(struct ath_hw *ah, u32 reg_offset, u32 val)
737{
738 if (ah->config.serialize_regmode == SER_REG_MODE_ON) {
739 unsigned long flags;
740 spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
741 iowrite32(val, ah->ah_sc->mem + reg_offset);
742 spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
743 } else
744 iowrite32(val, ah->ah_sc->mem + reg_offset);
745}
746
747static inline unsigned int ath9k_ioread32(struct ath_hw *ah, u32 reg_offset)
748{
749 u32 val;
750 if (ah->config.serialize_regmode == SER_REG_MODE_ON) {
751 unsigned long flags;
752 spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
753 val = ioread32(ah->ah_sc->mem + reg_offset);
754 spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
755 } else
756 val = ioread32(ah->ah_sc->mem + reg_offset);
757 return val;
758}
759
727#endif /* ATH9K_H */ 760#endif /* ATH9K_H */