aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVasanthakumar Thiagarajan <vasanth@atheros.com>2010-04-15 17:38:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-04-16 15:43:21 -0400
commitcee1f625bfcabeed39138547be21d8995357f8e1 (patch)
tree6facde377b0df9ea0239c4ea5a207f628dd91cbb
parentceb2644576bcb9fe7b79614512c1efe2bf3c307c (diff)
ath9k_hw: Add abstraction for rx enable
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/hw-ops.h5
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c17
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.h3
5 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/wireless/ath/ath9k/hw-ops.h b/drivers/net/wireless/ath/ath9k/hw-ops.h
index 81f3d03f0dbf..19259fbad507 100644
--- a/drivers/net/wireless/ath/ath9k/hw-ops.h
+++ b/drivers/net/wireless/ath/ath9k/hw-ops.h
@@ -28,6 +28,11 @@ static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah,
28 ath9k_hw_ops(ah)->config_pci_powersave(ah, restore, power_off); 28 ath9k_hw_ops(ah)->config_pci_powersave(ah, restore, power_off);
29} 29}
30 30
31static inline void ath9k_hw_rxena(struct ath_hw *ah)
32{
33 ath9k_hw_ops(ah)->rx_enable(ah);
34}
35
31/* Private hardware call ops */ 36/* Private hardware call ops */
32 37
33/* PHY ops */ 38/* PHY ops */
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 8bd718c01238..c06c44c396de 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1566,6 +1566,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1566 if (tsf && AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL)) 1566 if (tsf && AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
1567 ath9k_hw_settsf64(ah, tsf); 1567 ath9k_hw_settsf64(ah, tsf);
1568 1568
1569 ar9002_hw_attach_mac_ops(ah);
1570
1569 if (AR_SREV_9280_10_OR_LATER(ah)) 1571 if (AR_SREV_9280_10_OR_LATER(ah))
1570 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE); 1572 REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
1571 1573
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index 6bd87bf17ad4..b07ee8d6d332 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -509,6 +509,7 @@ struct ath_hw_ops {
509 void (*config_pci_powersave)(struct ath_hw *ah, 509 void (*config_pci_powersave)(struct ath_hw *ah,
510 int restore, 510 int restore,
511 int power_off); 511 int power_off);
512 void (*rx_enable)(struct ath_hw *ah);
512}; 513};
513 514
514struct ath_hw { 515struct ath_hw {
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 4a2060e5a777..ae9d54c9c79a 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -16,6 +16,17 @@
16 16
17#include "hw.h" 17#include "hw.h"
18 18
19static void ar9002_hw_rx_enable(struct ath_hw *ah)
20{
21 REG_WRITE(ah, AR_CR, AR_CR_RXE);
22}
23
24void ar9002_hw_attach_mac_ops(struct ath_hw *ah)
25{
26 struct ath_hw_ops *ops = ath9k_hw_ops(ah);
27
28 ops->rx_enable = ar9002_hw_rx_enable;
29}
19static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah, 30static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
20 struct ath9k_tx_queue_info *qi) 31 struct ath9k_tx_queue_info *qi)
21{ 32{
@@ -999,12 +1010,6 @@ void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp)
999} 1010}
1000EXPORT_SYMBOL(ath9k_hw_putrxbuf); 1011EXPORT_SYMBOL(ath9k_hw_putrxbuf);
1001 1012
1002void ath9k_hw_rxena(struct ath_hw *ah)
1003{
1004 REG_WRITE(ah, AR_CR, AR_CR_RXE);
1005}
1006EXPORT_SYMBOL(ath9k_hw_rxena);
1007
1008void ath9k_hw_startpcureceive(struct ath_hw *ah) 1013void ath9k_hw_startpcureceive(struct ath_hw *ah)
1009{ 1014{
1010 ath9k_enable_mib_counters(ah); 1015 ath9k_enable_mib_counters(ah);
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 68dbd7a8ddca..9e8500a8c800 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -729,10 +729,11 @@ void ath9k_hw_setuprxdesc(struct ath_hw *ah, struct ath_desc *ds,
729 u32 size, u32 flags); 729 u32 size, u32 flags);
730bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set); 730bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
731void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); 731void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
732void ath9k_hw_rxena(struct ath_hw *ah);
733void ath9k_hw_startpcureceive(struct ath_hw *ah); 732void ath9k_hw_startpcureceive(struct ath_hw *ah);
734void ath9k_hw_stoppcurecv(struct ath_hw *ah); 733void ath9k_hw_stoppcurecv(struct ath_hw *ah);
735bool ath9k_hw_stopdmarecv(struct ath_hw *ah); 734bool ath9k_hw_stopdmarecv(struct ath_hw *ah);
736int ath9k_hw_beaconq_setup(struct ath_hw *ah); 735int ath9k_hw_beaconq_setup(struct ath_hw *ah);
737 736
737void ar9002_hw_attach_mac_ops(struct ath_hw *ah);
738
738#endif /* MAC_H */ 739#endif /* MAC_H */