]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-dev.h
iwlagn: disable gen2b BT coexistence in IBSS
[karo-tx-linux.git] / drivers / net / wireless / iwlwifi / iwl-dev.h
index f3f3473c5c7ec852bf73657596354fe99d473e6c..815ba0af94cea9cfc0fc89ba8e1ef327352000f1 100644 (file)
 #include "iwl-led.h"
 #include "iwl-power.h"
 #include "iwl-agn-rs.h"
-
-/* configuration for the iwl4965 */
-extern struct iwl_cfg iwl4965_agn_cfg;
-extern struct iwl_cfg iwl5300_agn_cfg;
-extern struct iwl_cfg iwl5100_agn_cfg;
-extern struct iwl_cfg iwl5350_agn_cfg;
-extern struct iwl_cfg iwl5100_bgn_cfg;
-extern struct iwl_cfg iwl5100_abg_cfg;
-extern struct iwl_cfg iwl5150_agn_cfg;
-extern struct iwl_cfg iwl5150_abg_cfg;
-extern struct iwl_cfg iwl6000g2a_2agn_cfg;
-extern struct iwl_cfg iwl6000i_2agn_cfg;
-extern struct iwl_cfg iwl6000i_2abg_cfg;
-extern struct iwl_cfg iwl6000i_2bg_cfg;
-extern struct iwl_cfg iwl6000_3agn_cfg;
-extern struct iwl_cfg iwl6050_2agn_cfg;
-extern struct iwl_cfg iwl6050_2abg_cfg;
-extern struct iwl_cfg iwl1000_bgn_cfg;
-extern struct iwl_cfg iwl1000_bg_cfg;
+#include "iwl-agn-tt.h"
 
 struct iwl_tx_queue;
 
@@ -133,8 +115,8 @@ struct iwl_cmd_meta {
         * structure is stored at the end of the shared queue memory. */
        u32 flags;
 
-       DECLARE_PCI_UNMAP_ADDR(mapping)
-       DECLARE_PCI_UNMAP_LEN(len)
+       DEFINE_DMA_UNMAP_ADDR(mapping);
+       DEFINE_DMA_UNMAP_LEN(len);
 };
 
 /*
@@ -157,11 +139,11 @@ struct iwl_queue {
                                * space more than this */
        int high_mark;         /* high watermark, stop queue if free
                                * space less than this */
-} __attribute__ ((packed));
+} __packed;
 
 /* One for each TFD */
 struct iwl_tx_info {
-       struct sk_buff *skb[IWL_NUM_OF_TBS - 1];
+       struct sk_buff *skb;
 };
 
 /**
@@ -343,8 +325,8 @@ struct iwl_device_cmd {
                struct iwl_tx_cmd tx;
                struct iwl6000_channel_switch_cmd chswitch;
                u8 payload[DEF_CMD_PAYLOAD_SIZE];
-       } __attribute__ ((packed)) cmd;
-} __attribute__ ((packed));
+       } __packed cmd;
+} __packed;
 
 #define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd))
 
@@ -367,7 +349,7 @@ struct iwl_host_cmd {
 /**
  * struct iwl_rx_queue - Rx queue
  * @bd: driver's pointer to buffer of receive buffer descriptors (rbd)
- * @dma_addr: bus address of buffer of receive buffer descriptors (rbd)
+ * @bd_dma: bus address of buffer of receive buffer descriptors (rbd)
  * @read: Shared index to newest available Rx buffer
  * @write: Shared index to oldest written Rx packet
  * @free_count: Number of pre-allocated buffers in rx_free
@@ -381,7 +363,7 @@ struct iwl_host_cmd {
  */
 struct iwl_rx_queue {
        __le32 *bd;
-       dma_addr_t dma_addr;
+       dma_addr_t bd_dma;
        struct iwl_rx_mem_buffer pool[RX_QUEUE_SIZE + RX_FREE_BUFFERS];
        struct iwl_rx_mem_buffer *queue[RX_QUEUE_SIZE];
        u32 read;
@@ -433,13 +415,13 @@ struct iwl_ht_agg {
 
 
 struct iwl_tid_data {
-       u16 seq_number;
+       u16 seq_number; /* agn only */
        u16 tfds_in_queue;
        struct iwl_ht_agg agg;
 };
 
 struct iwl_hw_key {
-       enum ieee80211_key_alg alg;
+       u32 cipher;
        int keylen;
        u8 keyidx;
        u8 key[32];
@@ -453,7 +435,13 @@ union iwl_ht_rate_supp {
        };
 };
 
-#define CFG_HT_RX_AMPDU_FACTOR_DEF  (0x3)
+#define CFG_HT_RX_AMPDU_FACTOR_8K   (0x0)
+#define CFG_HT_RX_AMPDU_FACTOR_16K  (0x1)
+#define CFG_HT_RX_AMPDU_FACTOR_32K  (0x2)
+#define CFG_HT_RX_AMPDU_FACTOR_64K  (0x3)
+#define CFG_HT_RX_AMPDU_FACTOR_DEF  CFG_HT_RX_AMPDU_FACTOR_64K
+#define CFG_HT_RX_AMPDU_FACTOR_MAX  CFG_HT_RX_AMPDU_FACTOR_64K
+#define CFG_HT_RX_AMPDU_FACTOR_MIN  CFG_HT_RX_AMPDU_FACTOR_8K
 
 /*
  * Maximal MPDU density for TX aggregation
@@ -462,8 +450,13 @@ union iwl_ht_rate_supp {
  * 6 - 8us density
  * 7 - 16us density
  */
+#define CFG_HT_MPDU_DENSITY_2USEC   (0x4)
 #define CFG_HT_MPDU_DENSITY_4USEC   (0x5)
+#define CFG_HT_MPDU_DENSITY_8USEC   (0x6)
+#define CFG_HT_MPDU_DENSITY_16USEC  (0x7)
 #define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_4USEC
+#define CFG_HT_MPDU_DENSITY_MAX CFG_HT_MPDU_DENSITY_16USEC
+#define CFG_HT_MPDU_DENSITY_MIN     (0x1)
 
 struct iwl_ht_config {
        /* self configuration data */
@@ -583,6 +576,14 @@ 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_RUNT_EVTLOG_PTR   = 8,
+       IWL_UCODE_TLV_RUNT_EVTLOG_SIZE  = 9,
+       IWL_UCODE_TLV_RUNT_ERRLOG_PTR   = 10,
+       IWL_UCODE_TLV_INIT_EVTLOG_PTR   = 11,
+       IWL_UCODE_TLV_INIT_EVTLOG_SIZE  = 12,
+       IWL_UCODE_TLV_INIT_ERRLOG_PTR   = 13,
+       IWL_UCODE_TLV_ENHANCE_SENS_TBL  = 14,
+       IWL_UCODE_TLV_PHY_CALIBRATION_SIZE = 15,
 };
 
 struct iwl_ucode_tlv {
@@ -590,7 +591,7 @@ struct iwl_ucode_tlv {
        __le16 alternative;     /* see comment */
        __le32 length;          /* not including type/length fields */
        u8 data[0];
-} __attribute__ ((packed));
+} __packed;
 
 #define IWL_TLV_UCODE_MAGIC    0x0a4c5749
 
@@ -675,6 +676,7 @@ struct iwl_sensitivity_ranges {
  * @sw_crypto: 0 for hw, 1 for sw
  * @max_xxx_size: for ucode uses
  * @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
  * @struct iwl_sensitivity_ranges: range of sensitivity values
  */
@@ -701,6 +703,7 @@ struct iwl_hw_params {
        u32 ct_kill_threshold; /* value in hw-dependent units */
        u32 ct_kill_exit_threshold; /* value in hw-dependent units */
                                    /* for 1000, 6000 series and up */
+       u16 beacon_time_tsf_bits;
        u32 calib_init_cfg;
        const struct iwl_sensitivity_ranges *sens;
 };
@@ -1047,19 +1050,20 @@ struct iwl_event_log {
  * This is the threshold value of plcp error rate per 100mSecs.  It is
  * used to set and check for the validity of plcp_delta.
  */
-#define IWL_MAX_PLCP_ERR_THRESHOLD_MIN (0)
+#define IWL_MAX_PLCP_ERR_THRESHOLD_MIN (1)
 #define IWL_MAX_PLCP_ERR_THRESHOLD_DEF (50)
 #define IWL_MAX_PLCP_ERR_LONG_THRESHOLD_DEF    (100)
 #define IWL_MAX_PLCP_ERR_EXT_LONG_THRESHOLD_DEF        (200)
 #define IWL_MAX_PLCP_ERR_THRESHOLD_MAX (255)
+#define IWL_MAX_PLCP_ERR_THRESHOLD_DISABLE     (0)
 
 #define IWL_DELAY_NEXT_FORCE_RF_RESET  (HZ*3)
 #define IWL_DELAY_NEXT_FORCE_FW_RELOAD (HZ*5)
 
 /* timer constants use to monitor and recover stuck tx queues in mSecs */
-#define IWL_MONITORING_PERIOD  (1000)
+#define IWL_DEF_MONITORING_PERIOD      (1000)
+#define IWL_LONG_MONITORING_PERIOD     (5000)
 #define IWL_ONE_HUNDRED_MSECS   (100)
-#define IWL_SIXTY_SECS          (60000)
 
 enum iwl_reset {
        IWL_RF_RESET = 0,
@@ -1075,6 +1079,20 @@ struct iwl_force_reset {
        unsigned long last_force_reset_jiffies;
 };
 
+/* extend beacon time format bit shifting  */
+/*
+ * for _3945 devices
+ * bits 31:24 - extended
+ * bits 23:0  - interval
+ */
+#define IWL3945_EXT_BEACON_TIME_POS    24
+/*
+ * for _agn devices
+ * bits 31:22 - extended
+ * bits 21:0  - interval
+ */
+#define IWLAGN_EXT_BEACON_TIME_POS     22
+
 struct iwl_priv {
 
        /* ieee device used by generic ieee processing code */
@@ -1103,13 +1121,16 @@ struct iwl_priv {
        u32 ucode_beacon_time;
        int missed_beacon_threshold;
 
+       /* track IBSS manager (last beacon) status */
+       u32 ibss_manager;
+
        /* storing the jiffies when the plcp error rate is received */
        unsigned long plcp_jiffies;
 
        /* force reset */
        struct iwl_force_reset force_reset[IWL_MAX_FORCE_RESET];
 
-       /* we allocate array of iwl4965_channel_info for NIC's valid channels.
+       /* we allocate array of iwl_channel_info for NIC's valid channels.
         *    Access via channel # using indirect index array */
        struct iwl_channel_info *channel_info;  /* channel info array */
        u8 channel_count;       /* # of channels */
@@ -1127,6 +1148,7 @@ struct iwl_priv {
        void *scan_cmd;
        enum ieee80211_band scan_band;
        struct cfg80211_scan_request *scan_request;
+       struct ieee80211_vif *scan_vif;
        bool is_internal_short_scan;
        u8 scan_tx_ant[IEEE80211_NUM_BANDS];
        u8 mgmt_tx_ant;
@@ -1147,6 +1169,9 @@ struct iwl_priv {
        u32  hw_wa_rev;
        u8   rev_id;
 
+       /* EEPROM MAC addresses */
+       struct mac_address addresses[2];
+
        /* uCode images, save to reload in case of failure */
        int fw_index;                   /* firmware we're trying to load */
        u32 ucode_ver;                  /* version of ucode, copy of
@@ -1174,7 +1199,7 @@ struct iwl_priv {
        struct iwl_switch_rxon switch_rxon;
 
        /* 1st responses from initialize and runtime uCode images.
-        * 4965's initialize alive response contains some calibration data. */
+        * _agn's initialize alive response contains some calibration data. */
        struct iwl_init_alive_resp card_alive_init;
        struct iwl_alive_resp card_alive;
 
@@ -1188,7 +1213,9 @@ struct iwl_priv {
        u8 start_calib;
        struct iwl_sensitivity_data sensitivity_data;
        struct iwl_chain_noise_data chain_noise_data;
+       bool enhance_sensitivity_table;
        __le16 sensitivity_tbl[HD_TABLE_SIZE];
+       __le16 enhance_sensitivity_tbl[ENHANCE_HD_TABLE_ENTRIES];
 
        struct iwl_ht_config current_ht_config;
 
@@ -1220,18 +1247,12 @@ struct iwl_priv {
        struct iwl_power_mgr power_data;
        struct iwl_tt_mgmt thermal_throttle;
 
-       struct iwl_notif_statistics statistics;
-#ifdef CONFIG_IWLWIFI_DEBUG
-       struct iwl_notif_statistics accum_statistics;
-       struct iwl_notif_statistics delta_statistics;
-       struct iwl_notif_statistics max_delta;
-#endif
-
        /* context information */
        u8 bssid[ETH_ALEN]; /* used only on 3945 but filled by core */
-       u8 mac_addr[ETH_ALEN];
 
-       /*station table variables */
+       /* station table variables */
+
+       /* Note: if lock and sta_lock are needed, lock must be acquired first */
        spinlock_t sta_lock;
        int num_stations;
        struct iwl_station_entry stations[IWL_STATION_COUNT];
@@ -1273,7 +1294,7 @@ struct iwl_priv {
                        struct delayed_work rfkill_poll;
 
                        struct iwl3945_notif_statistics statistics;
-#ifdef CONFIG_IWLWIFI_DEBUG
+#ifdef CONFIG_IWLWIFI_DEBUGFS
                        struct iwl3945_notif_statistics accum_statistics;
                        struct iwl3945_notif_statistics delta_statistics;
                        struct iwl3945_notif_statistics max_delta;
@@ -1315,10 +1336,36 @@ struct iwl_priv {
                        bool last_phy_res_valid;
 
                        struct completion firmware_loading_complete;
+
+                       u32 init_evtlog_ptr, init_evtlog_size, init_errlog_ptr;
+                       u32 inst_evtlog_ptr, inst_evtlog_size, inst_errlog_ptr;
+
+                       /*
+                        * chain noise reset and gain commands are the
+                        * two extra calibration commands follows the standard
+                        * phy calibration commands
+                        */
+                       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;
+#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
                } _agn;
 #endif
        };
 
+       u8 bt_traffic_load, notif_bt_traffic_load;
+       bool bt_sco_active;
+       struct work_struct bt_traffic_change_work;
+
        struct iwl_hw_params hw_params;
 
        u32 inta_mask;
@@ -1336,6 +1383,7 @@ struct iwl_priv {
        struct work_struct ct_enter;
        struct work_struct ct_exit;
        struct work_struct start_internal_scan;
+       struct work_struct tx_flush;
 
        struct tasklet_struct irq_tasklet;
 
@@ -1353,9 +1401,7 @@ struct iwl_priv {
        /* debugging info */
        u32 debug_level; /* per device debugging will override global
                            iwl_debug_level if set */
-       u32 framecnt_to_us;
-       atomic_t restrict_refcnt;
-       bool disable_ht40;
+#endif /* CONFIG_IWLWIFI_DEBUG */
 #ifdef CONFIG_IWLWIFI_DEBUGFS
        /* debugfs */
        u16 tx_traffic_idx;
@@ -1364,8 +1410,8 @@ struct iwl_priv {
        u8 *rx_traffic;
        struct dentry *debugfs_dir;
        u32 dbgfs_sram_offset, dbgfs_sram_len;
+       bool disable_ht40;
 #endif /* CONFIG_IWLWIFI_DEBUGFS */
-#endif /* CONFIG_IWLWIFI_DEBUG */
 
        struct work_struct txpower_work;
        u32 disable_sens_cal;
@@ -1419,9 +1465,9 @@ static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
 static inline struct ieee80211_hdr *iwl_tx_queue_get_hdr(struct iwl_priv *priv,
                                                         int txq_id, int idx)
 {
-       if (priv->txq[txq_id].txb[idx].skb[0])
+       if (priv->txq[txq_id].txb[idx].skb)
                return (struct ieee80211_hdr *)priv->txq[txq_id].
-                               txb[idx].skb[0]->data;
+                               txb[idx].skb->data;
        return NULL;
 }