Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[pandora-kernel.git] / drivers / net / wireless / ath / ath9k / hw.h
index d032939..cc8f3b9 100644 (file)
 #define PAPRD_GAIN_TABLE_ENTRIES    32
 #define PAPRD_TABLE_SZ              24
 
+enum ath_hw_txq_subtype {
+       ATH_TXQ_AC_BE = 0,
+       ATH_TXQ_AC_BK = 1,
+       ATH_TXQ_AC_VI = 2,
+       ATH_TXQ_AC_VO = 3,
+};
+
 enum ath_ini_subsys {
        ATH_INI_PRE = 0,
        ATH_INI_CORE,
@@ -477,6 +484,40 @@ struct ath_hw_antcomb_conf {
        u8 fast_div_bias;
 };
 
+/**
+ * struct ath_hw_radar_conf - radar detection initialization parameters
+ *
+ * @pulse_inband: threshold for checking the ratio of in-band power
+ *     to total power for short radar pulses (half dB steps)
+ * @pulse_inband_step: threshold for checking an in-band power to total
+ *     power ratio increase for short radar pulses (half dB steps)
+ * @pulse_height: threshold for detecting the beginning of a short
+ *     radar pulse (dB step)
+ * @pulse_rssi: threshold for detecting if a short radar pulse is
+ *     gone (dB step)
+ * @pulse_maxlen: maximum pulse length (0.8 us steps)
+ *
+ * @radar_rssi: RSSI threshold for starting long radar detection (dB steps)
+ * @radar_inband: threshold for checking the ratio of in-band power
+ *     to total power for long radar pulses (half dB steps)
+ * @fir_power: threshold for detecting the end of a long radar pulse (dB)
+ *
+ * @ext_channel: enable extension channel radar detection
+ */
+struct ath_hw_radar_conf {
+       unsigned int pulse_inband;
+       unsigned int pulse_inband_step;
+       unsigned int pulse_height;
+       unsigned int pulse_rssi;
+       unsigned int pulse_maxlen;
+
+       unsigned int radar_rssi;
+       unsigned int radar_inband;
+       int fir_power;
+
+       bool ext_channel;
+};
+
 /**
  * struct ath_hw_private_ops - callbacks used internally by hardware code
  *
@@ -542,6 +583,8 @@ struct ath_hw_private_ops {
        bool (*ani_control)(struct ath_hw *ah, enum ath9k_ani_cmd cmd,
                            int param);
        void (*do_getnf)(struct ath_hw *ah, int16_t nfarray[NUM_NF_READINGS]);
+       void (*set_radar_params)(struct ath_hw *ah,
+                                struct ath_hw_radar_conf *conf);
 
        /* ANI */
        void (*ani_cache_ini_regs)(struct ath_hw *ah);
@@ -622,6 +665,7 @@ struct ath_hw {
 
        bool sw_mgmt_crypto;
        bool is_pciexpress;
+       bool is_monitoring;
        bool need_an_top2_fixup;
        u16 tx_trig_level;
 
@@ -739,6 +783,8 @@ struct ath_hw {
        u8 txchainmask;
        u8 rxchainmask;
 
+       struct ath_hw_radar_conf radar_conf;
+
        u32 originalGain[22];
        int initPDADC;
        int PDADCdelta;
@@ -796,6 +842,9 @@ struct ath_hw {
         * this register when in sleep states.
         */
        u32 WARegVal;
+
+       /* Enterprise mode cap */
+       u32 ent_mode;
 };
 
 static inline struct ath_common *ath9k_hw_common(struct ath_hw *ah)
@@ -818,12 +867,6 @@ static inline struct ath_hw_ops *ath9k_hw_ops(struct ath_hw *ah)
        return &ah->ops;
 }
 
-static inline int sign_extend(int val, const int nbits)
-{
-       int order = BIT(nbits-1);
-       return (val ^ order) - order;
-}
-
 /* Initialization, Detach, Reset */
 const char *ath9k_hw_probe(u16 vendorid, u16 devid);
 void ath9k_hw_deinit(struct ath_hw *ah);
@@ -860,7 +903,7 @@ u32 ath9k_hw_getrxfilter(struct ath_hw *ah);
 void ath9k_hw_setrxfilter(struct ath_hw *ah, u32 bits);
 bool ath9k_hw_phy_disable(struct ath_hw *ah);
 bool ath9k_hw_disable(struct ath_hw *ah);
-void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit);
+void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test);
 void ath9k_hw_setopmode(struct ath_hw *ah);
 void ath9k_hw_setmcastfilter(struct ath_hw *ah, u32 filter0, u32 filter1);
 void ath9k_hw_setbssidmask(struct ath_hw *ah);
@@ -892,7 +935,6 @@ void ath9k_hw_gen_timer_stop(struct ath_hw *ah, struct ath_gen_timer *timer);
 
 void ath_gen_timer_free(struct ath_hw *ah, struct ath_gen_timer *timer);
 void ath_gen_timer_isr(struct ath_hw *hw);
-u32 ath9k_hw_gettsf32(struct ath_hw *ah);
 
 void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);