iwlwifi: move tx fail code to agn
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-dev.h
index 90bf6b3..2b04714 100644 (file)
@@ -470,15 +470,8 @@ union iwl_ht_rate_supp {
 #define CFG_HT_MPDU_DENSITY_MIN     (0x1)
 
 struct iwl_ht_config {
-       /* self configuration data */
-       bool is_ht;
-       bool is_40mhz;
        bool single_chain_sufficient;
        enum ieee80211_smps_mode smps; /* current smps mode */
-       /* BSS related data */
-       u8 extension_chan_offset;
-       u8 ht_protection;
-       u8 non_GF_STA_present;
 };
 
 /* QoS structures */
@@ -502,6 +495,7 @@ struct iwl_station_entry {
 };
 
 struct iwl_station_priv_common {
+       struct iwl_rxon_context *ctx;
        u8 sta_id;
 };
 
@@ -588,6 +582,7 @@ enum iwl_ucode_tlv_type {
        IWL_UCODE_TLV_INIT_DATA         = 4,
        IWL_UCODE_TLV_BOOT              = 5,
        IWL_UCODE_TLV_PROBE_MAX_LEN     = 6, /* a u32 value */
+       IWL_UCODE_TLV_PAN               = 7,
        IWL_UCODE_TLV_RUNT_EVTLOG_PTR   = 8,
        IWL_UCODE_TLV_RUNT_EVTLOG_SIZE  = 9,
        IWL_UCODE_TLV_RUNT_ERRLOG_PTR   = 10,
@@ -689,6 +684,7 @@ struct iwl_sensitivity_ranges {
  * @ct_kill_threshold: temperature threshold
  * @beacon_time_tsf_bits: number of valid tsf bits for beacon time
  * @calib_init_cfg: setup initial calibrations for the hw
+ * @calib_rt_cfg: setup runtime calibrations for the hw
  * @struct iwl_sensitivity_ranges: range of sensitivity values
  */
 struct iwl_hw_params {
@@ -715,6 +711,7 @@ struct iwl_hw_params {
                                    /* for 1000, 6000 series and up */
        u16 beacon_time_tsf_bits;
        u32 calib_init_cfg;
+       u32 calib_rt_cfg;
        const struct iwl_sensitivity_ranges *sens;
 };
 
@@ -950,7 +947,7 @@ enum iwl_pa_type {
 struct isr_statistics {
        u32 hw;
        u32 sw;
-       u32 sw_err;
+       u32 err_code;
        u32 sch;
        u32 alive;
        u32 rfkill;
@@ -962,6 +959,50 @@ struct isr_statistics {
        u32 unhandled;
 };
 
+/* reply_tx_statistics (for _agn devices) */
+struct reply_tx_error_statistics {
+       u32 pp_delay;
+       u32 pp_few_bytes;
+       u32 pp_bt_prio;
+       u32 pp_quiet_period;
+       u32 pp_calc_ttak;
+       u32 int_crossed_retry;
+       u32 short_limit;
+       u32 long_limit;
+       u32 fifo_underrun;
+       u32 drain_flow;
+       u32 rfkill_flush;
+       u32 life_expire;
+       u32 dest_ps;
+       u32 host_abort;
+       u32 bt_retry;
+       u32 sta_invalid;
+       u32 frag_drop;
+       u32 tid_disable;
+       u32 fifo_flush;
+       u32 insuff_cf_poll;
+       u32 fail_hw_drop;
+       u32 sta_color_mismatch;
+       u32 unknown;
+};
+
+/* reply_agg_tx_statistics (for _agn devices) */
+struct reply_agg_tx_error_statistics {
+       u32 underrun;
+       u32 bt_prio;
+       u32 few_bytes;
+       u32 abort;
+       u32 last_sent_ttl;
+       u32 last_sent_try;
+       u32 last_sent_bt_kill;
+       u32 scd_query;
+       u32 bad_crc32;
+       u32 response;
+       u32 dump_tx;
+       u32 delay_tx;
+       u32 unknown;
+};
+
 #ifdef CONFIG_IWLWIFI_DEBUGFS
 /* management statistics */
 enum iwl_mgmt_stats {
@@ -1109,12 +1150,30 @@ struct iwl_force_reset {
 
 enum iwl_rxon_context_id {
        IWL_RXON_CTX_BSS,
+       IWL_RXON_CTX_PAN,
 
        NUM_IWL_RXON_CTX
 };
 
 struct iwl_rxon_context {
+       struct ieee80211_vif *vif;
+
+       const u8 *ac_to_fifo;
+       const u8 *ac_to_queue;
+       u8 mcast_queue;
+
+       /*
+        * We could use the vif to indicate active, but we
+        * also need it to be active during disabling when
+        * we already removed the vif for type setting.
+        */
+       bool always_active, is_active;
+
        enum iwl_rxon_context_id ctxid;
+
+       u32 interface_modes, exclusive_interface_modes;
+       u8 unused_devtype, ap_devtype, ibss_devtype, station_devtype;
+
        /*
         * We declare this const so it can only be
         * changed via explicit cast within the
@@ -1128,10 +1187,23 @@ struct iwl_rxon_context {
 
        struct iwl_qos_info qos_data;
 
-       u8 bcast_sta_id;
+       u8 bcast_sta_id, ap_sta_id;
 
        u8 rxon_cmd, rxon_assoc_cmd, rxon_timing_cmd;
        u8 qos_cmd;
+       u8 wep_key_cmd;
+
+       struct iwl_wep_key wep_keys[WEP_KEYS_MAX];
+       u8 key_mapping_keys;
+
+       __le32 station_flags;
+
+       struct {
+               bool non_gf_sta_present;
+               u8 protection;
+               bool enabled, is_40mhz;
+               u8 extension_chan_offset;
+       } ht;
 };
 
 struct iwl_priv {
@@ -1216,6 +1288,9 @@ struct iwl_priv {
        /* command queue number */
        u8 cmd_queue;
 
+       /* max number of station keys */
+       u8 sta_key_max_num;
+
        /* EEPROM MAC addresses */
        struct mac_address addresses[2];
 
@@ -1295,8 +1370,6 @@ struct iwl_priv {
        spinlock_t sta_lock;
        int num_stations;
        struct iwl_station_entry stations[IWL_STATION_COUNT];
-       struct iwl_wep_key wep_keys[WEP_KEYS_MAX]; /* protected by mutex */
-       u8 key_mapping_key;
        unsigned long ucode_key_table;
 
        /* queue refcounts */
@@ -1321,7 +1394,6 @@ struct iwl_priv {
 
        /* Last Rx'd beacon timestamp */
        u64 timestamp;
-       struct ieee80211_vif *vif;
 
        union {
 #if defined(CONFIG_IWL3945) || defined(CONFIG_IWL3945_MODULE)
@@ -1389,6 +1461,9 @@ struct iwl_priv {
 
                        struct iwl_notif_statistics statistics;
                        struct iwl_bt_notif_statistics statistics_bt;
+                       /* counts reply_tx error */
+                       struct reply_tx_error_statistics reply_tx_stats;
+                       struct reply_agg_tx_error_statistics reply_agg_tx_stats;
 #ifdef CONFIG_IWLWIFI_DEBUGFS
                        struct iwl_notif_statistics accum_statistics;
                        struct iwl_notif_statistics delta_statistics;
@@ -1429,6 +1504,8 @@ struct iwl_priv {
        struct work_struct rx_replenish;
        struct work_struct abort_scan;
        struct work_struct beacon_update;
+       struct iwl_rxon_context *beacon_ctx;
+
        struct work_struct tt_work;
        struct work_struct ct_enter;
        struct work_struct ct_exit;
@@ -1489,7 +1566,6 @@ static inline void iwl_txq_ctx_deactivate(struct iwl_priv *priv, int txq_id)
 }
 
 #ifdef CONFIG_IWLWIFI_DEBUG
-const char *iwl_get_tx_fail_reason(u32 status);
 /*
  * iwl_get_debug_level: Return active debug level for device
  *
@@ -1505,8 +1581,6 @@ static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
                return iwl_debug_level;
 }
 #else
-static inline const char *iwl_get_tx_fail_reason(u32 status) { return ""; }
-
 static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
 {
        return iwl_debug_level;