]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-4965.h
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / iwlwifi / iwl-4965.h
index 810b8e28dc83cb18fa576cc775be9e4a453518b1..9ed13cb0a2a9f0354b95dc04d29ec9e0e517f942 100644 (file)
 #include <linux/kernel.h>
 #include <net/ieee80211_radiotap.h>
 
-/* Hardware specific file defines the PCI IDs table for that hardware module */
-extern struct pci_device_id iwl4965_hw_card_ids[];
-
 #define DRV_NAME        "iwl4965"
+#include "iwl-rfkill.h"
 #include "iwl-eeprom.h"
 #include "iwl-4965-hw.h"
 #include "iwl-csr.h"
 #include "iwl-prph.h"
 #include "iwl-debug.h"
+#include "iwl-led.h"
+
+/* configuration for the iwl4965 */
+extern struct iwl_cfg iwl4965_agn_cfg;
 
 /* Change firmware file name, using "-" and incrementing number,
  *   *only* when uCode interface or architecture changes so that it
@@ -66,9 +68,6 @@ extern struct pci_device_id iwl4965_hw_card_ids[];
  *   averages within an s8's (used in some apps) range of negative values. */
 #define IWL_NOISE_MEAS_NOT_AVAILABLE (-127)
 
-/* Module parameters accessible from iwl-*.c */
-extern struct iwl_mod_params iwl4965_mod_params;
-
 enum iwl4965_antenna {
        IWL_ANTENNA_DIVERSITY,
        IWL_ANTENNA_MAIN,
@@ -295,8 +294,8 @@ struct iwl4965_frame {
 
 #define SEQ_TO_QUEUE(x)  ((x >> 8) & 0xbf)
 #define QUEUE_TO_SEQ(x)  ((x & 0xbf) << 8)
-#define SEQ_TO_INDEX(x) (x & 0xff)
-#define INDEX_TO_SEQ(x) (x & 0xff)
+#define SEQ_TO_INDEX(x) ((u8)(x & 0xff))
+#define INDEX_TO_SEQ(x) ((u8)(x & 0xff))
 #define SEQ_HUGE_FRAME  (0x4000)
 #define SEQ_RX_FRAME    __constant_cpu_to_le16(0x8000)
 #define SEQ_TO_SN(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
@@ -415,25 +414,6 @@ struct iwl4965_rx_queue {
 #define MAX_B_CHANNELS  14
 #define MIN_B_CHANNELS  1
 
-#define STATUS_HCMD_ACTIVE     0       /* host command in progress */
-#define STATUS_INT_ENABLED     1
-#define STATUS_RF_KILL_HW      2
-#define STATUS_RF_KILL_SW      3
-#define STATUS_INIT            4
-#define STATUS_ALIVE           5
-#define STATUS_READY           6
-#define STATUS_TEMPERATURE     7
-#define STATUS_GEO_CONFIGURED  8
-#define STATUS_EXIT_PENDING    9
-#define STATUS_IN_SUSPEND      10
-#define STATUS_STATISTICS      11
-#define STATUS_SCANNING                12
-#define STATUS_SCAN_ABORTING   13
-#define STATUS_SCAN_HW         14
-#define STATUS_POWER_PMI       15
-#define STATUS_FW_ERROR                16
-#define STATUS_CONF_PENDING    17
-
 #define MAX_TID_COUNT        9
 
 #define IWL_INVALID_RATE     0xFF
@@ -481,6 +461,7 @@ struct iwl4965_tid_data {
 struct iwl4965_hw_key {
        enum ieee80211_key_alg alg;
        int keylen;
+       u8 keyidx;
        struct ieee80211_key_conf *conf;
        u8 key[32];
 };
@@ -586,7 +567,7 @@ struct iwl4965_ibss_seq {
 };
 
 /**
- * struct iwl4965_driver_hw_info
+ * struct iwl_hw_params
  * @max_txq_num: Max # Tx queues supported
  * @tx_cmd_len: Size of Tx command (but not including frame itself)
  * @tx_ant_num: Number of TX antennas
@@ -595,21 +576,20 @@ struct iwl4965_ibss_seq {
  * @max_rxq_log: Log-base-2 of max_rxq_size
  * @max_stations:
  * @bcast_sta_id:
- * @shared_virt: Pointer to driver/uCode shared Tx Byte Counts and Rx status
- * @shared_phys: Physical Pointer to Tx Byte Counts and Rx status
  */
-struct iwl4965_driver_hw_info {
+struct iwl_hw_params {
        u16 max_txq_num;
        u16 tx_cmd_len;
-       u16 tx_ant_num;
+       u8  tx_chains_num;
+       u8  rx_chains_num;
+       u8  valid_tx_ant;
+       u8  valid_rx_ant;
        u16 max_rxq_size;
+       u16 max_rxq_log;
        u32 rx_buf_size;
        u32 max_pkt_size;
-       u16 max_rxq_log;
        u8  max_stations;
        u8  bcast_sta_id;
-       void *shared_virt;
-       dma_addr_t shared_phys;
 };
 
 #define HT_SHORT_GI_20MHZ_ONLY          (1 << 0)
@@ -661,7 +641,6 @@ extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
                                        const u8 *dest, int left);
 extern int iwl4965_rx_queue_update_write_ptr(struct iwl_priv *priv,
                                         struct iwl4965_rx_queue *q);
-extern int iwl4965_send_statistics_request(struct iwl_priv *priv);
 extern void iwl4965_set_decrypted_flag(struct iwl_priv *priv, struct sk_buff *skb,
                                   u32 decrypt_res,
                                   struct ieee80211_rx_status *stats);
@@ -699,7 +678,7 @@ extern void iwl4965_hw_rx_handler_setup(struct iwl_priv *priv);
 extern void iwl4965_hw_setup_deferred_work(struct iwl_priv *priv);
 extern void iwl4965_hw_cancel_deferred_work(struct iwl_priv *priv);
 extern int iwl4965_hw_rxq_stop(struct iwl_priv *priv);
-extern int iwl4965_hw_set_hw_setting(struct iwl_priv *priv);
+extern int iwl4965_hw_set_hw_params(struct iwl_priv *priv);
 extern int iwl4965_hw_nic_init(struct iwl_priv *priv);
 extern int iwl4965_hw_nic_stop_master(struct iwl_priv *priv);
 extern void iwl4965_hw_txq_ctx_free(struct iwl_priv *priv);
@@ -741,6 +720,7 @@ extern int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index
 extern int iwl4965_queue_space(const struct iwl4965_queue *q);
 struct iwl_priv;
 
+extern void iwl4965_radio_kill_sw(struct iwl_priv *priv, int disable_radio);
 /*
  * Forward declare iwl-4965.c functions for iwl-base.c
  */
@@ -761,7 +741,8 @@ extern void iwl4965_hwrate_to_tx_control(struct iwl_priv *priv,
                                         struct ieee80211_tx_control *control);
 
 #ifdef CONFIG_IWL4965_HT
-void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info,
+void iwl4965_init_ht_hw_capab(struct iwl_priv *priv,
+                             struct ieee80211_ht_info *ht_info,
                              enum ieee80211_band band);
 void iwl4965_set_rxon_ht(struct iwl_priv *priv,
                         struct iwl_ht_info *ht_info);
@@ -773,7 +754,8 @@ int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
 int iwl4965_check_empty_hw_queue(struct iwl_priv *priv, int sta_id,
                                        u8 tid, int txq_id);
 #else
-static inline void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info,
+static inline void iwl4965_init_ht_hw_capab(struct iwl_priv *priv,
+                                           struct ieee80211_ht_info *ht_info,
                                            enum ieee80211_band band) {}
 
 #endif /*CONFIG_IWL4965_HT */
@@ -959,6 +941,8 @@ enum {
 
 #endif
 
+#define IWL_MAX_NUM_QUEUES     20 /* FIXME: do dynamic allocation */
+
 struct iwl_priv {
 
        /* ieee device used by generic ieee processing code */
@@ -1050,18 +1034,21 @@ struct iwl_priv {
         * 4965's initialize alive response contains some calibration data. */
        struct iwl4965_init_alive_resp card_alive_init;
        struct iwl4965_alive_resp card_alive;
+#ifdef CONFIG_IWLWIFI_RFKILL
+       struct iwl_rfkill_mngr rfkill_mngr;
+#endif
 
-#ifdef LED
-       /* LED related variables */
-       struct iwl4965_activity_blink activity;
-       unsigned long led_packets;
-       int led_state;
+#ifdef CONFIG_IWLWIFI_LEDS
+       struct iwl4965_led led[IWL_LED_TRG_MAX];
+       unsigned long last_blink_time;
+       u8 last_blink_rate;
+       u8 allow_blinking;
+       u64 led_tpt;
 #endif
 
        u16 active_rate;
        u16 active_rate_basic;
 
-       u8 call_post_assoc_from_beacon;
        u8 assoc_station_added;
        u8 use_ant_b_for_management_frame;      /* Tx antenna selection */
        u8 valid_antenna;       /* Bit mask of antennas actually connected */
@@ -1126,9 +1113,13 @@ struct iwl_priv {
        spinlock_t sta_lock;
        int num_stations;
        struct iwl4965_station_entry stations[IWL_STATION_COUNT];
+       struct iwl_wep_key wep_keys[WEP_KEYS_MAX];
+       u8 default_wep_key;
+       u8 key_mapping_key;
+       unsigned long ucode_key_table;
 
        /* Indication if ieee80211_ops->open has been called */
-       int is_open;
+       u8 is_open;
 
        u8 mac80211_registered;
 
@@ -1149,17 +1140,21 @@ struct iwl_priv {
        /* eeprom */
        struct iwl4965_eeprom eeprom;
 
-       int iw_mode;
+       enum ieee80211_if_types iw_mode;
 
        struct sk_buff *ibss_beacon;
 
        /* Last Rx'd beacon timestamp */
-       u32 timestamp0;
-       u32 timestamp1;
+       u64 timestamp;
        u16 beacon_int;
-       struct iwl4965_driver_hw_info hw_setting;
        struct ieee80211_vif *vif;
 
+       struct iwl_hw_params hw_params;
+       /* driver/uCode shared Tx Byte Counts and Rx status */
+       void *shared_virt;
+       /* Physical Pointer to Tx Byte Counts and Rx status */
+       dma_addr_t shared_phys;
+
        /* Current association information needed to configure the
         * hardware */
        u16 assoc_id;
@@ -1215,11 +1210,10 @@ struct iwl_priv {
 #ifdef CONFIG_IWL4965_SENSITIVITY
        struct work_struct sensitivity_work;
 #endif
-       struct work_struct statistics_work;
        struct timer_list statistics_periodic;
 }; /*iwl_priv */
 
-static inline int iwl4965_is_associated(struct iwl_priv *priv)
+static inline int iwl_is_associated(struct iwl_priv *priv)
 {
        return (priv->active_rxon.filter_flags & RXON_FILTER_ASSOC_MSK) ? 1 : 0;
 }
@@ -1265,6 +1259,5 @@ extern const struct iwl_channel_info *iwl_get_channel_info(
        const struct iwl_priv *priv, enum ieee80211_band band, u16 channel);
 
 /* Requires full declaration of iwl_priv before including */
-#include "iwl-4965-io.h"
 
 #endif                         /* __iwl4965_4965_h__ */