]> 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 069e591981b264b074b6e754d3d6e5d89a416b27..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"
@@ -47,6 +45,9 @@ extern struct pci_device_id iwl4965_hw_card_ids[];
 #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
  *   is not compatible with earlier drivers.
@@ -293,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)
@@ -413,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
@@ -479,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];
 };
@@ -584,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
@@ -593,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)
@@ -659,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);
@@ -697,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);
@@ -739,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
  */
@@ -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,8 +1034,11 @@ 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 CONFIG_IWL4965_LEDS
+#ifdef CONFIG_IWLWIFI_LEDS
        struct iwl4965_led led[IWL_LED_TRG_MAX];
        unsigned long last_blink_time;
        u8 last_blink_rate;
@@ -1062,7 +1049,6 @@ struct iwl_priv {
        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 */
@@ -1127,6 +1113,10 @@ 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 */
        u8 is_open;
@@ -1155,12 +1145,16 @@ struct iwl_priv {
        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;
@@ -1216,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;
 }