]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-dev.h
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[mv-sheeva.git] / drivers / net / wireless / iwlwifi / iwl-dev.h
index f3f3473c5c7ec852bf73657596354fe99d473e6c..c4dba62b74af89557ef8e85207015921089c1f47 100644 (file)
 #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;
-
 struct iwl_tx_queue;
 
 /* CT-KILL constants */
@@ -133,8 +114,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 +138,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 +324,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 +348,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 +362,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,7 +414,7 @@ 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;
 };
@@ -583,6 +564,13 @@ 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,
 };
 
 struct iwl_ucode_tlv {
@@ -590,7 +578,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 +663,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 +690,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,11 +1037,12 @@ 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)
@@ -1075,6 +1066,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 */
@@ -1109,7 +1114,7 @@ struct iwl_priv {
        /* 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 +1132,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;
@@ -1174,7 +1180,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 +1194,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 +1228,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 +1275,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,6 +1317,16 @@ 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;
+
+                       struct iwl_notif_statistics statistics;
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+                       struct iwl_notif_statistics accum_statistics;
+                       struct iwl_notif_statistics delta_statistics;
+                       struct iwl_notif_statistics max_delta;
+#endif
                } _agn;
 #endif
        };
@@ -1336,6 +1348,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 +1366,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 +1375,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 +1430,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;
 }