ath9k_hw: Add abstraction for rx enable
authorVasanthakumar Thiagarajan <vasanth@atheros.com>
Thu, 15 Apr 2010 21:38:26 +0000 (17:38 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 16 Apr 2010 19:43:21 +0000 (15:43 -0400)
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hw-ops.h
drivers/net/wireless/ath/ath9k/hw.c
drivers/net/wireless/ath/ath9k/hw.h
drivers/net/wireless/ath/ath9k/mac.c
drivers/net/wireless/ath/ath9k/mac.h

index 81f3d03f0dbfb966ff19789ff5a0ba3f49d5fc01..19259fbad507a28c7e3bb280e97b5e237e665388 100644 (file)
@@ -28,6 +28,11 @@ static inline void ath9k_hw_configpcipowersave(struct ath_hw *ah,
        ath9k_hw_ops(ah)->config_pci_powersave(ah, restore, power_off);
 }
 
+static inline void ath9k_hw_rxena(struct ath_hw *ah)
+{
+       ath9k_hw_ops(ah)->rx_enable(ah);
+}
+
 /* Private hardware call ops */
 
 /* PHY ops */
index 8bd718c0123844bf128cb8d068f4dea99af36ab4..c06c44c396def7178c456324c20c961bc164004c 100644 (file)
@@ -1566,6 +1566,8 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
        if (tsf && AR_SREV_9280(ah) && ah->eep_ops->get_eeprom(ah, EEP_OL_PWRCTRL))
                ath9k_hw_settsf64(ah, tsf);
 
+       ar9002_hw_attach_mac_ops(ah);
+
        if (AR_SREV_9280_10_OR_LATER(ah))
                REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL, AR_GPIO_JTAG_DISABLE);
 
index 6bd87bf17ad45fb94354f156482ace00be6968db..b07ee8d6d33243c12904380f0fa1010414cd6bbc 100644 (file)
@@ -509,6 +509,7 @@ struct ath_hw_ops {
        void (*config_pci_powersave)(struct ath_hw *ah,
                                     int restore,
                                     int power_off);
+       void (*rx_enable)(struct ath_hw *ah);
 };
 
 struct ath_hw {
index 4a2060e5a7774616e438bb5f9dd4567e36d6c677..ae9d54c9c79a97324dc315cc4e8509d37930f8c8 100644 (file)
 
 #include "hw.h"
 
+static void ar9002_hw_rx_enable(struct ath_hw *ah)
+{
+       REG_WRITE(ah, AR_CR, AR_CR_RXE);
+}
+
+void ar9002_hw_attach_mac_ops(struct ath_hw *ah)
+{
+       struct ath_hw_ops *ops = ath9k_hw_ops(ah);
+
+       ops->rx_enable = ar9002_hw_rx_enable;
+}
 static void ath9k_hw_set_txq_interrupts(struct ath_hw *ah,
                                        struct ath9k_tx_queue_info *qi)
 {
@@ -999,12 +1010,6 @@ void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp)
 }
 EXPORT_SYMBOL(ath9k_hw_putrxbuf);
 
-void ath9k_hw_rxena(struct ath_hw *ah)
-{
-       REG_WRITE(ah, AR_CR, AR_CR_RXE);
-}
-EXPORT_SYMBOL(ath9k_hw_rxena);
-
 void ath9k_hw_startpcureceive(struct ath_hw *ah)
 {
        ath9k_enable_mib_counters(ah);
index 68dbd7a8ddca091502c536c4cb909a3195da9df7..9e8500a8c800f08993abc5ad73b636baedb41d22 100644 (file)
@@ -729,10 +729,11 @@ void ath9k_hw_setuprxdesc(struct ath_hw *ah, struct ath_desc *ds,
                          u32 size, u32 flags);
 bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
 void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
-void ath9k_hw_rxena(struct ath_hw *ah);
 void ath9k_hw_startpcureceive(struct ath_hw *ah);
 void ath9k_hw_stoppcurecv(struct ath_hw *ah);
 bool ath9k_hw_stopdmarecv(struct ath_hw *ah);
 int ath9k_hw_beaconq_setup(struct ath_hw *ah);
 
+void ar9002_hw_attach_mac_ops(struct ath_hw *ah);
+
 #endif /* MAC_H */