atheros/ath9k: add common read/write ops and port ath9k to use it
[linux-2.6-block.git] / drivers / net / wireless / ath / ath9k / ath9k.h
index 1d59f10f68da77fd8066028fb9998a93106c5aa2..7c740cf50f7c28480ef029398d8dde2cd28edf18 100644 (file)
@@ -26,7 +26,6 @@
 #include "rc.h"
 #include "debug.h"
 #include "../ath.h"
-#include "btcoex.h"
 
 struct ath_node;
 
@@ -61,8 +60,6 @@ struct ath_node;
 
 #define        ATH_TXQ_SETUP(sc, i)        ((sc)->tx.txqsetup & (1<<i))
 
-static const u8 ath_bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
 struct ath_config {
        u32 ath_aggr_prot;
        u16 txpowlimit;
@@ -451,6 +448,26 @@ struct ath_ani {
        struct timer_list timer;
 };
 
+/* Defines the BT AR_BT_COEX_WGHT used */
+enum ath_stomp_type {
+       ATH_BTCOEX_NO_STOMP,
+       ATH_BTCOEX_STOMP_ALL,
+       ATH_BTCOEX_STOMP_LOW,
+       ATH_BTCOEX_STOMP_NONE
+};
+
+struct ath_btcoex {
+       bool hw_timer_enabled;
+       spinlock_t btcoex_lock;
+       struct timer_list period_timer; /* Timer for BT period */
+       u32 bt_priority_cnt;
+       unsigned long bt_priority_time;
+       int bt_stomp_type; /* Types of BT stomping */
+       u32 btcoex_no_stomp; /* in usec */
+       u32 btcoex_period; /* in usec */
+       struct ath_gen_timer *no_stomp_timer; /* Timer for no BT stomping */
+};
+
 /********************/
 /*   LED Control    */
 /********************/
@@ -522,13 +539,13 @@ struct ath_led {
 #define SC_OP_WAIT_FOR_PSPOLL_DATA BIT(17)
 #define SC_OP_WAIT_FOR_TX_ACK   BIT(18)
 #define SC_OP_BEACON_SYNC       BIT(19)
-#define SC_OP_BTCOEX_ENABLED    BIT(20)
 #define SC_OP_BT_PRIORITY_DETECTED BIT(21)
 
 struct ath_bus_ops {
        void            (*read_cachesize)(struct ath_softc *sc, int *csz);
        void            (*cleanup)(struct ath_softc *sc);
        bool            (*eeprom_read)(struct ath_hw *ah, u32 off, u16 *data);
+       void            (*bt_coex_prep)(struct ath_softc *sc);
 };
 
 struct ath_wiphy;
@@ -537,8 +554,6 @@ struct ath_softc {
        struct ieee80211_hw *hw;
        struct device *dev;
 
-       struct ath_common common;
-
        spinlock_t wiphy_lock; /* spinlock to protect ath_wiphy data */
        struct ath_wiphy *pri_wiphy;
        struct ath_wiphy **sec_wiphy; /* secondary wiphys (virtual radios); may
@@ -565,12 +580,9 @@ struct ath_softc {
        spinlock_t sc_pm_lock;
        struct mutex mutex;
 
-       u8 curbssid[ETH_ALEN];
-       u8 bssidmask[ETH_ALEN];
        u32 intrstatus;
        u32 sc_flags; /* SC_OP_* */
        u16 curtxpow;
-       u16 curaid;
        u8 nbcnvifs;
        u16 nvifs;
        u8 tx_chainmask;
@@ -612,7 +624,7 @@ struct ath_softc {
        struct ath_bus_ops *bus_ops;
        struct ath_beacon_config cur_beacon_conf;
        struct delayed_work tx_complete_work;
-       struct ath_btcoex_info btcoex_info;
+       struct ath_btcoex btcoex;
 };
 
 struct ath_wiphy {
@@ -634,16 +646,6 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
 int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
 int ath_cabq_update(struct ath_softc *);
 
-static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)
-{
-       return &ah->ah_sc->common;
-}
-
-static inline struct ath_regulatory *ath9k_hw_regulatory(struct ath_hw *ah)
-{
-       return &(ath9k_hw_common(ah)->regulatory);
-}
-
 static inline void ath_read_cachesize(struct ath_softc *sc, int *csz)
 {
        sc->bus_ops->read_cachesize(sc, csz);
@@ -706,8 +708,5 @@ bool ath9k_wiphy_scanning(struct ath_softc *sc);
 void ath9k_wiphy_work(struct work_struct *work);
 bool ath9k_all_wiphys_idle(struct ath_softc *sc);
 
-void ath9k_iowrite32(struct ath_hw *ah, u32 reg_offset, u32 val);
-unsigned int ath9k_ioread32(struct ath_hw *ah, u32 reg_offset);
-
 int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype);
 #endif /* ATH9K_H */