Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[pandora-kernel.git] / drivers / net / wireless / iwlwifi / iwl-dev.h
index 7213336..214e465 100644 (file)
@@ -238,15 +238,6 @@ struct iwl_channel_info {
 #define IEEE80211_HLEN                  (IEEE80211_4ADDR_LEN)
 #define IEEE80211_FRAME_LEN             (IEEE80211_DATA_LEN + IEEE80211_HLEN)
 
-struct iwl_frame {
-       union {
-               struct ieee80211_hdr frame;
-               struct iwl_tx_beacon_cmd beacon;
-               u8 raw[IEEE80211_FRAME_LEN];
-               u8 cmd[360];
-       } u;
-       struct list_head list;
-};
 
 #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
 #define SN_TO_SEQ(ssn) (((ssn) << 4) & IEEE80211_SCTL_SEQ)
@@ -479,6 +470,10 @@ struct fw_desc {
        u32 len;                /* bytes */
 };
 
+struct fw_img {
+       struct fw_desc code, data;
+};
+
 /* v1/v2 uCode file layout */
 struct iwl_ucode_header {
        __le32 ver;     /* major/minor/API/serial */
@@ -543,13 +538,13 @@ enum iwl_ucode_tlv_type {
  * enum iwl_ucode_tlv_flag - ucode API flags
  * @IWL_UCODE_TLV_FLAGS_PAN: This is PAN capable microcode; this previously
  *     was a separate TLV but moved here to save space.
- * @IWL_UCODE_TLV_FLAGS_BTSTATS: This uCode image uses BT statistics, which
- *     may be true even if the device doesn't have BT.
+ * @IWL_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behaviour on hidden SSID,
+ *     treats good CRC threshold as a boolean
  * @IWL_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w).
  */
 enum iwl_ucode_tlv_flag {
        IWL_UCODE_TLV_FLAGS_PAN         = BIT(0),
-       IWL_UCODE_TLV_FLAGS_BTSTATS     = BIT(1),
+       IWL_UCODE_TLV_FLAGS_NEWSCAN     = BIT(1),
        IWL_UCODE_TLV_FLAGS_MFP         = BIT(2),
 };
 
@@ -795,12 +790,6 @@ struct iwl_calib_result {
        size_t buf_len;
 };
 
-enum ucode_type {
-       UCODE_NONE = 0,
-       UCODE_INIT,
-       UCODE_RT
-};
-
 /* Sensitivity calib data */
 struct iwl_sensitivity_data {
        u32 auto_corr_ofdm;
@@ -1106,10 +1095,12 @@ struct iwl_force_reset {
 struct iwl_notification_wait {
        struct list_head list;
 
-       void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt);
+       void (*fn)(struct iwl_priv *priv, struct iwl_rx_packet *pkt,
+                  void *data);
+       void *fn_data;
 
        u8 cmd;
-       bool triggered;
+       bool triggered, aborted;
 };
 
 enum iwl_rxon_context_id {
@@ -1170,6 +1161,8 @@ struct iwl_rxon_context {
                bool enabled, is_40mhz;
                u8 extension_chan_offset;
        } ht;
+
+       bool last_tx_rejected;
 };
 
 enum iwl_scan_type {
@@ -1186,12 +1179,10 @@ struct iwl_priv {
        struct ieee80211_rate *ieee_rates;
        struct iwl_cfg *cfg;
 
-       /* temporary frame storage list */
-       struct list_head free_frames;
-       int frames_count;
-
        enum ieee80211_band band;
 
+       void (*pre_rx_handler)(struct iwl_priv *priv,
+                              struct iwl_rx_mem_buffer *rxb);
        void (*rx_handlers[REPLY_MAX])(struct iwl_priv *priv,
                                       struct iwl_rx_mem_buffer *rxb);
 
@@ -1262,6 +1253,8 @@ struct iwl_priv {
        /* max number of station keys */
        u8 sta_key_max_num;
 
+       bool new_scan_threshold_behaviour;
+
        /* EEPROM MAC addresses */
        struct mac_address addresses[2];
 
@@ -1269,11 +1262,10 @@ struct iwl_priv {
        int fw_index;                   /* firmware we're trying to load */
        u32 ucode_ver;                  /* version of ucode, copy of
                                           iwl_ucode.ver */
-       struct fw_desc ucode_code;      /* runtime inst */
-       struct fw_desc ucode_data;      /* runtime data original */
-       struct fw_desc ucode_init;      /* initialization inst */
-       struct fw_desc ucode_init_data; /* initialization data */
-       enum ucode_type ucode_type;
+       struct fw_img ucode_rt;
+       struct fw_img ucode_init;
+
+       enum iwlagn_ucode_subtype ucode_type;
        u8 ucode_write_complete;        /* the image write is complete */
        char firmware_name[25];
 
@@ -1354,6 +1346,31 @@ struct iwl_priv {
        /* Last Rx'd beacon timestamp */
        u64 timestamp;
 
+       struct {
+               __le32 flag;
+               struct statistics_general_common common;
+               struct statistics_rx_non_phy rx_non_phy;
+               struct statistics_rx_phy rx_ofdm;
+               struct statistics_rx_ht_phy rx_ofdm_ht;
+               struct statistics_rx_phy rx_cck;
+               struct statistics_tx tx;
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+               struct statistics_bt_activity bt_activity;
+               __le32 num_bt_kills, accum_num_bt_kills;
+#endif
+       } statistics;
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+       struct {
+               struct statistics_general_common common;
+               struct statistics_rx_non_phy rx_non_phy;
+               struct statistics_rx_phy rx_ofdm;
+               struct statistics_rx_ht_phy rx_ofdm_ht;
+               struct statistics_rx_phy rx_cck;
+               struct statistics_tx tx;
+               struct statistics_bt_activity bt_activity;
+       } accum_stats, delta_stats, max_delta_stats;
+#endif
+
        struct {
                /* INT ICT Table */
                __le32 *ict_tbl;
@@ -1385,19 +1402,9 @@ struct iwl_priv {
                u8 phy_calib_chain_noise_reset_cmd;
                u8 phy_calib_chain_noise_gain_cmd;
 
-               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;
-               struct iwl_notif_statistics max_delta;
-               struct iwl_bt_notif_statistics accum_statistics_bt;
-               struct iwl_bt_notif_statistics delta_statistics_bt;
-               struct iwl_bt_notif_statistics max_delta_bt;
-#endif
                /* notification wait support */
                struct list_head notif_waits;
                spinlock_t notif_wait_lock;
@@ -1422,7 +1429,6 @@ struct iwl_priv {
        bool bt_ch_announce;
        bool bt_full_concurrent;
        bool bt_ant_couple_ok;
-       bool bt_statistics;
        __le32 kill_ack_mask;
        __le32 kill_cts_mask;
        __le16 bt_valid;
@@ -1457,8 +1463,6 @@ struct iwl_priv {
 
        struct tasklet_struct irq_tasklet;
 
-       struct delayed_work init_alive_start;
-       struct delayed_work alive_start;
        struct delayed_work scan_check;
 
        /* TX Power */
@@ -1487,12 +1491,10 @@ struct iwl_priv {
        struct work_struct txpower_work;
        u32 disable_sens_cal;
        u32 disable_chain_noise_cal;
-       u32 disable_tx_power_cal;
        struct work_struct run_time_calib_work;
        struct timer_list statistics_periodic;
        struct timer_list ucode_trace;
        struct timer_list watchdog;
-       bool hw_ready;
 
        struct iwl_event_log event_log;
 
@@ -1556,21 +1558,24 @@ iwl_rxon_ctx_from_vif(struct ieee80211_vif *vif)
             ctx < &priv->contexts[NUM_IWL_RXON_CTX]; ctx++)    \
                if (priv->valid_contexts & BIT(ctx->ctxid))
 
-static inline int iwl_is_associated(struct iwl_priv *priv,
-                                   enum iwl_rxon_context_id ctxid)
+static inline int iwl_is_associated_ctx(struct iwl_rxon_context *ctx)
 {
-       return (priv->contexts[ctxid].active.filter_flags &
-                       RXON_FILTER_ASSOC_MSK) ? 1 : 0;
+       return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
 }
 
-static inline int iwl_is_any_associated(struct iwl_priv *priv)
+static inline int iwl_is_associated(struct iwl_priv *priv,
+                                   enum iwl_rxon_context_id ctxid)
 {
-       return iwl_is_associated(priv, IWL_RXON_CTX_BSS);
+       return iwl_is_associated_ctx(&priv->contexts[ctxid]);
 }
 
-static inline int iwl_is_associated_ctx(struct iwl_rxon_context *ctx)
+static inline int iwl_is_any_associated(struct iwl_priv *priv)
 {
-       return (ctx->active.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
+       struct iwl_rxon_context *ctx;
+       for_each_context(priv, ctx)
+               if (iwl_is_associated_ctx(ctx))
+                       return true;
+       return false;
 }
 
 static inline int is_channel_valid(const struct iwl_channel_info *ch_info)