iwlwifi: remove unused members of iwl_ht_info
[safe/jmp/linux-2.6] / drivers / net / wireless / iwlwifi / iwl-dev.h
index cddf173..db74534 100644 (file)
@@ -56,8 +56,8 @@ extern struct iwl_cfg iwl5350_agn_cfg;
 extern struct iwl_cfg iwl5100_bg_cfg;
 extern struct iwl_cfg iwl5100_abg_cfg;
 extern struct iwl_cfg iwl5150_agn_cfg;
-extern struct iwl_cfg iwl6000_2ag_cfg;
-extern struct iwl_cfg iwl6000_2agn_cfg;
+extern struct iwl_cfg iwl6000h_2agn_cfg;
+extern struct iwl_cfg iwl6000i_2agn_cfg;
 extern struct iwl_cfg iwl6000_3agn_cfg;
 extern struct iwl_cfg iwl6050_2agn_cfg;
 extern struct iwl_cfg iwl6050_3agn_cfg;
@@ -150,6 +150,31 @@ struct iwl_rx_mem_buffer {
        struct list_head list;
 };
 
+/* defined below */
+struct iwl_device_cmd;
+
+struct iwl_cmd_meta {
+       /* only for SYNC commands, iff the reply skb is wanted */
+       struct iwl_host_cmd *source;
+       /*
+        * only for ASYNC commands
+        * (which is somewhat stupid -- look at iwl-sta.c for instance
+        * which duplicates a bunch of code because the callback isn't
+        * invoked for SYNC commands, if it were and its result passed
+        * through it would be simpler...)
+        */
+       void (*callback)(struct iwl_priv *priv,
+                        struct iwl_device_cmd *cmd,
+                        struct sk_buff *skb);
+
+       /* The CMD_SIZE_HUGE flag bit indicates that the command
+        * structure is stored at the end of the shared queue memory. */
+       u32 flags;
+
+       DECLARE_PCI_UNMAP_ADDR(mapping)
+       DECLARE_PCI_UNMAP_LEN(len)
+};
+
 /*
  * Generic queue structure
  *
@@ -177,7 +202,8 @@ struct iwl_tx_info {
  * struct iwl_tx_queue - Tx Queue for DMA
  * @q: generic Rx/Tx queue descriptor
  * @bd: base of circular buffer of TFDs
- * @cmd: array of command/Tx buffers
+ * @cmd: array of command/TX buffer pointers
+ * @meta: array of meta data for each command/tx buffer
  * @dma_addr_cmd: physical address of cmd/tx buffer array
  * @txb: array of per-TFD driver data
  * @need_update: indicates need to update read/write index
@@ -192,7 +218,8 @@ struct iwl_tx_info {
 struct iwl_tx_queue {
        struct iwl_queue q;
        void *tfds;
-       struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS];
+       struct iwl_device_cmd **cmd;
+       struct iwl_cmd_meta *meta;
        struct iwl_tx_info *txb;
        u8 need_update;
        u8 sched_retry;
@@ -250,8 +277,8 @@ struct iwl_channel_info {
        struct iwl4965_channel_tgd_info tgd;
        struct iwl4965_channel_tgh_info tgh;
        struct iwl_eeprom_channel eeprom;       /* EEPROM regulatory limit */
-       struct iwl_eeprom_channel fat_eeprom;   /* EEPROM regulatory limit for
-                                                * FAT channel */
+       struct iwl_eeprom_channel ht40_eeprom;  /* EEPROM regulatory limit for
+                                                * HT40 channel */
 
        u8 channel;       /* channel number */
        u8 flags;         /* flags copied from EEPROM */
@@ -264,13 +291,13 @@ struct iwl_channel_info {
        u8 band_index;    /* 0-4, maps channel to band1/2/3/4/5 */
        enum ieee80211_band band;
 
-       /* FAT channel info */
-       s8 fat_max_power_avg;   /* (dBm) regul. eeprom, normal Tx, any rate */
-       s8 fat_curr_txpow;      /* (dBm) regulatory/spectrum/user (not h/w) */
-       s8 fat_min_power;       /* always 0 */
-       s8 fat_scan_power;      /* (dBm) eeprom, direct scans, any rate */
-       u8 fat_flags;           /* flags copied from EEPROM */
-       u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */
+       /* HT40 channel info */
+       s8 ht40_max_power_avg;  /* (dBm) regul. eeprom, normal Tx, any rate */
+       s8 ht40_curr_txpow;     /* (dBm) regulatory/spectrum/user (not h/w) */
+       s8 ht40_min_power;      /* always 0 */
+       s8 ht40_scan_power;     /* (dBm) eeprom, direct scans, any rate */
+       u8 ht40_flags;          /* flags copied from EEPROM */
+       u8 ht40_extension_channel; /* HT_IE_EXT_CHANNEL_* */
 
        /* Radio/DSP gain settings for each "normal" data Tx rate.
         * These include, in addition to RF and DSP gain, a few fields for
@@ -329,35 +356,16 @@ enum {
        CMD_WANT_SKB = (1 << 2),
 };
 
-struct iwl_cmd;
-struct iwl_priv;
-
-struct iwl_cmd_meta {
-       struct iwl_cmd_meta *source;
-       union {
-               struct sk_buff *skb;
-               int (*callback)(struct iwl_priv *priv,
-                               struct iwl_cmd *cmd, struct sk_buff *skb);
-       } __attribute__ ((packed)) u;
-
-       /* The CMD_SIZE_HUGE flag bit indicates that the command
-        * structure is stored at the end of the shared queue memory. */
-       u32 flags;
-       DECLARE_PCI_UNMAP_ADDR(mapping)
-       DECLARE_PCI_UNMAP_LEN(len)
-} __attribute__ ((packed));
-
 #define IWL_CMD_MAX_PAYLOAD 320
 
 /**
- * struct iwl_cmd
+ * struct iwl_device_cmd
  *
  * For allocation of the command and tx queues, this establishes the overall
  * size of the largest command we send to uCode, except for a scan command
  * (which is relatively huge; space is allocated separately).
  */
-struct iwl_cmd {
-       struct iwl_cmd_meta meta;       /* driver data */
+struct iwl_device_cmd {
        struct iwl_cmd_header hdr;      /* uCode API */
        union {
                u32 flags;
@@ -369,17 +377,20 @@ struct iwl_cmd {
        } __attribute__ ((packed)) cmd;
 } __attribute__ ((packed));
 
+#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_device_cmd))
+
 
 struct iwl_host_cmd {
-       u8 id;
-       u16 len;
-       struct iwl_cmd_meta meta;
        const void *data;
+       struct sk_buff *reply_skb;
+       void (*callback)(struct iwl_priv *priv,
+                        struct iwl_device_cmd *cmd,
+                        struct sk_buff *skb);
+       u32 flags;
+       u16 len;
+       u8 id;
 };
 
-#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
-                             sizeof(struct iwl_cmd_meta))
-
 /*
  * RX related structures and functions
  */
@@ -480,8 +491,16 @@ union iwl_ht_rate_supp {
 };
 
 #define CFG_HT_RX_AMPDU_FACTOR_DEF  (0x3)
-#define CFG_HT_MPDU_DENSITY_2USEC   (0x5)
-#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC
+
+/*
+ * Maximal MPDU density for TX aggregation
+ * 4 - 2us density
+ * 5 - 4us density
+ * 6 - 8us density
+ * 7 - 16us density
+ */
+#define CFG_HT_MPDU_DENSITY_4USEC   (0x5)
+#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_4USEC
 
 struct iwl_ht_info {
        /* self configuration data */
@@ -490,13 +509,9 @@ struct iwl_ht_info {
        u8 sm_ps;
        u8 is_green_field;
        u8 sgf;                 /* HT_SHORT_GI_* short guard interval */
-       u8 max_amsdu_size;
-       u8 ampdu_factor;
-       u8 mpdu_density;
        struct ieee80211_mcs_info mcs;
        /* BSS related data */
        u8 extension_chan_offset;
-       u8 tx_chan_width;
        u8 ht_protection;
        u8 non_GF_STA_present;
 };
@@ -630,7 +645,7 @@ struct iwl_sensitivity_ranges {
  * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR
  * @max_stations:
  * @bcast_sta_id:
- * @fat_channel: is 40MHz width possible in band 2.4
+ * @ht40_channel: is 40MHz width possible in band 2.4
  * BIT(IEEE80211_BAND_5GHZ) BIT(IEEE80211_BAND_5GHZ)
  * @sw_crypto: 0 for hw, 1 for sw
  * @max_xxx_size: for ucode uses
@@ -654,7 +669,7 @@ struct iwl_hw_params {
        u32 max_pkt_size;
        u8  max_stations;
        u8  bcast_sta_id;
-       u8 fat_channel;
+       u8  ht40_channel;
        u8  max_beacon_itrvl;   /* in 1024 ms */
        u32 max_inst_size;
        u32 max_data_size;
@@ -804,8 +819,6 @@ struct iwl_calib_result {
        size_t buf_len;
 };
 
-#define UCODE_ALIVE_TIMEOUT    (5 * HZ)
-
 enum ucode_type {
        UCODE_NONE = 0,
        UCODE_INIT,
@@ -858,6 +871,8 @@ struct iwl_chain_noise_data {
 #define        EEPROM_SEM_TIMEOUT 10           /* milliseconds */
 #define EEPROM_SEM_RETRY_LIMIT 1000    /* number of attempts (not time) */
 
+#define IWL_TRAFFIC_ENTRIES    (256)
+#define IWL_TRAFFIC_ENTRY_SIZE  (64)
 
 enum {
        MEASUREMENT_READY = (1 << 0),
@@ -869,6 +884,30 @@ enum iwl_nvm_type {
        NVM_DEVICE_TYPE_OTP,
 };
 
+/*
+ * Two types of OTP memory access modes
+ *   IWL_OTP_ACCESS_ABSOLUTE - absolute address mode,
+ *                             based on physical memory addressing
+ *   IWL_OTP_ACCESS_RELATIVE - relative address mode,
+ *                            based on logical memory addressing
+ */
+enum iwl_access_mode {
+       IWL_OTP_ACCESS_ABSOLUTE,
+       IWL_OTP_ACCESS_RELATIVE,
+};
+
+/**
+ * enum iwl_pa_type - Power Amplifier type
+ * @IWL_PA_SYSTEM:  based on uCode configuration
+ * @IWL_PA_HYBRID: use both Internal and external PA
+ * @IWL_PA_INTERNAL: use Internal only
+ */
+enum iwl_pa_type {
+       IWL_PA_SYSTEM = 0,
+       IWL_PA_HYBRID = 1,
+       IWL_PA_INTERNAL = 2,
+};
+
 /* interrupt statistics */
 struct isr_statistics {
        u32 hw;
@@ -885,6 +924,48 @@ struct isr_statistics {
        u32 unhandled;
 };
 
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+/* management statistics */
+enum iwl_mgmt_stats {
+       MANAGEMENT_ASSOC_REQ = 0,
+       MANAGEMENT_ASSOC_RESP,
+       MANAGEMENT_REASSOC_REQ,
+       MANAGEMENT_REASSOC_RESP,
+       MANAGEMENT_PROBE_REQ,
+       MANAGEMENT_PROBE_RESP,
+       MANAGEMENT_BEACON,
+       MANAGEMENT_ATIM,
+       MANAGEMENT_DISASSOC,
+       MANAGEMENT_AUTH,
+       MANAGEMENT_DEAUTH,
+       MANAGEMENT_ACTION,
+       MANAGEMENT_MAX,
+};
+/* control statistics */
+enum iwl_ctrl_stats {
+       CONTROL_BACK_REQ =  0,
+       CONTROL_BACK,
+       CONTROL_PSPOLL,
+       CONTROL_RTS,
+       CONTROL_CTS,
+       CONTROL_ACK,
+       CONTROL_CFEND,
+       CONTROL_CFENDACK,
+       CONTROL_MAX,
+};
+
+struct traffic_stats {
+       u32 mgmt[MANAGEMENT_MAX];
+       u32 ctrl[CONTROL_MAX];
+       u32 data_cnt;
+       u64 data_bytes;
+};
+#else
+struct traffic_stats {
+       u64 data_bytes;
+};
+#endif
+
 #define IWL_MAX_NUM_QUEUES     20 /* FIXME: do dynamic allocation */
 
 struct iwl_priv {
@@ -1030,15 +1111,14 @@ struct iwl_priv {
        int last_rx_noise;      /* From beacon statistics */
 
        /* counts mgmt, ctl, and data packets */
-       struct traffic_stats {
-               u32 cnt;
-               u64 bytes;
-       } tx_stats[3], rx_stats[3];
+       struct traffic_stats tx_stats;
+       struct traffic_stats rx_stats;
 
        /* counts interrupts */
        struct isr_statistics isr_stats;
 
        struct iwl_power_mgr power_data;
+       struct iwl_tt_mgmt thermal_throttle;
 
        struct iwl_notif_statistics statistics;
        unsigned long last_statistics_time;
@@ -1046,7 +1126,6 @@ struct iwl_priv {
        /* context information */
        u16 rates_mask;
 
-       u32 power_mode;
        u8 bssid[ETH_ALEN];
        u16 rts_threshold;
        u8 mac_addr[ETH_ALEN];
@@ -1125,6 +1204,9 @@ struct iwl_priv {
        struct work_struct report_work;
        struct work_struct request_scan;
        struct work_struct beacon_update;
+       struct work_struct tt_work;
+       struct work_struct ct_enter;
+       struct work_struct ct_exit;
 
        struct tasklet_struct irq_tasklet;
 
@@ -1143,10 +1225,17 @@ struct iwl_priv {
 
 #ifdef CONFIG_IWLWIFI_DEBUG
        /* 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;
 #ifdef CONFIG_IWLWIFI_DEBUGFS
        /* debugfs */
+       u16 tx_traffic_idx;
+       u16 rx_traffic_idx;
+       u8 *tx_traffic;
+       u8 *rx_traffic;
        struct iwl_debugfs *dbgfs;
 #endif /* CONFIG_IWLWIFI_DEBUGFS */
 #endif /* CONFIG_IWLWIFI_DEBUG */
@@ -1178,8 +1267,27 @@ 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
+ *
+ * Using sysfs it is possible to set per device debug level. This debug
+ * level will be used if set, otherwise the global debug level which can be
+ * set via module parameter is used.
+ */
+static inline u32 iwl_get_debug_level(struct iwl_priv *priv)
+{
+       if (priv->debug_level)
+               return priv->debug_level;
+       else
+               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;
+}
 #endif