ath9k: remove driver ASSERT, just use BUG_ON()
[safe/jmp/linux-2.6] / drivers / net / wireless / ath / ath9k / ath9k.h
index d816c9d..e512d51 100644 (file)
@@ -25,6 +25,8 @@
 #include "hw.h"
 #include "rc.h"
 #include "debug.h"
+#include "../ath.h"
+#include "../debug.h"
 
 struct ath_node;
 
@@ -52,15 +54,11 @@ struct ath_node;
 
 #define A_MAX(a, b) ((a) > (b) ? (a) : (b))
 
-#define ASSERT(exp) BUG_ON(!(exp))
-
 #define TSF_TO_TU(_h,_l) \
        ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
 
 #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;
@@ -189,8 +187,6 @@ void ath_descdma_cleanup(struct ath_softc *sc, struct ath_descdma *dd,
 /* minimum h/w qdepth to be sustained to maximize aggregation */
 #define ATH_AGGR_MIN_QDEPTH        2
 #define ATH_AMPDU_SUBFRAME_DEFAULT 32
-#define ATH_AMPDU_LIMIT_MAX        (64 * 1024 - 1)
-#define ATH_AMPDU_LIMIT_DEFAULT    ATH_AMPDU_LIMIT_MAX
 
 #define IEEE80211_SEQ_SEQ_SHIFT    4
 #define IEEE80211_SEQ_MAX          4096
@@ -238,7 +234,6 @@ struct ath_txq {
        spinlock_t axq_lock;
        u32 axq_depth;
        u8 axq_aggr_depth;
-       u32 axq_totalqueued;
        bool stopped;
        bool axq_tx_inprogress;
        struct ath_buf *axq_linkbuf;
@@ -451,11 +446,32 @@ 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    */
 /********************/
 
-#define ATH_LED_PIN    1
+#define ATH_LED_PIN_DEF                1
+#define ATH_LED_PIN_9287               8
 #define ATH_LED_ON_DURATION_IDLE       350     /* in msecs */
 #define ATH_LED_OFF_DURATION_IDLE      250     /* in msecs */
 
@@ -521,11 +537,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_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;
@@ -560,24 +578,17 @@ 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;
-       u16 cachelsz;
        u8 nbcnvifs;
        u16 nvifs;
-       u8 tx_chainmask;
-       u8 rx_chainmask;
        u32 keymax;
        DECLARE_BITMAP(keymap, ATH_KEYMAX);
        u8 splitmic;
+       bool ps_enabled;
        unsigned long ps_usecount;
        enum ath9k_int imask;
-       enum ath9k_ht_extprotspacing ht_extprotspacing;
-       enum ath9k_ht_macmode tx_chan_width;
 
        struct ath_config config;
        struct ath_rx rx;
@@ -601,13 +612,13 @@ struct ath_softc {
        int beacon_interval;
 
        struct ath_ani ani;
-       struct ath9k_node_stats nodestats;
 #ifdef CONFIG_ATH9K_DEBUG
        struct ath9k_debug debug;
 #endif
        struct ath_bus_ops *bus_ops;
        struct ath_beacon_config cur_beacon_conf;
        struct delayed_work tx_complete_work;
+       struct ath_btcoex btcoex;
 };
 
 struct ath_wiphy {
@@ -643,7 +654,7 @@ extern struct ieee80211_ops ath9k_ops;
 
 irqreturn_t ath_isr(int irq, void *dev);
 void ath_cleanup(struct ath_softc *sc);
-int ath_attach(u16 devid, struct ath_softc *sc);
+int ath_init_device(u16 devid, struct ath_softc *sc, u16 subsysid);
 void ath_detach(struct ath_softc *sc);
 const char *ath_mac_bb_name(u32 mac_bb_version);
 const char *ath_rf_name(u16 rf_version);
@@ -691,7 +702,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 */