]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wireless/iwlwifi/iwl-4965.h
iwlwifi: make Makefile more concise
[linux-2.6-omap-h63xx.git] / drivers / net / wireless / iwlwifi / iwl-4965.h
index b73c1544e90987515eb83234dc7401e6956d1f03..17c4bcfe113b4150ce6a2ccdaee1487b36285dc2 100644 (file)
 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"
 
 /* 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,
@@ -140,7 +139,7 @@ struct iwl4965_tx_info {
 struct iwl4965_tx_queue {
        struct iwl4965_queue q;
        struct iwl4965_tfd_frame *bd;
-       struct iwl4965_cmd *cmd;
+       struct iwl_cmd *cmd;
        dma_addr_t dma_addr_cmd;
        struct iwl4965_tx_info *txb;
        int need_update;
@@ -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)
@@ -312,15 +311,15 @@ enum {
        CMD_WANT_SKB = (1 << 2),
 };
 
-struct iwl4965_cmd;
+struct iwl_cmd;
 struct iwl_priv;
 
-struct iwl4965_cmd_meta {
-       struct iwl4965_cmd_meta *source;
+struct iwl_cmd_meta {
+       struct iwl_cmd_meta *source;
        union {
                struct sk_buff *skb;
                int (*callback)(struct iwl_priv *priv,
-                               struct iwl4965_cmd *cmd, struct sk_buff *skb);
+                               struct iwl_cmd *cmd, struct sk_buff *skb);
        } __attribute__ ((packed)) u;
 
        /* The CMD_SIZE_HUGE flag bit indicates that the command
@@ -330,15 +329,15 @@ struct iwl4965_cmd_meta {
 } __attribute__ ((packed));
 
 /**
- * struct iwl4965_cmd
+ * struct iwl_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 iwl4965_cmd {
-       struct iwl4965_cmd_meta meta;   /* driver data */
-       struct iwl4965_cmd_header hdr;  /* uCode API */
+struct iwl_cmd {
+       struct iwl_cmd_meta meta;       /* driver data */
+       struct iwl_cmd_header hdr;      /* uCode API */
        union {
                struct iwl4965_addsta_cmd addsta;
                struct iwl4965_led_cmd led;
@@ -358,15 +357,15 @@ struct iwl4965_cmd {
        } __attribute__ ((packed)) cmd;
 } __attribute__ ((packed));
 
-struct iwl4965_host_cmd {
+struct iwl_host_cmd {
        u8 id;
        u16 len;
-       struct iwl4965_cmd_meta meta;
+       struct iwl_cmd_meta meta;
        const void *data;
 };
 
-#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl4965_cmd) - \
-                             sizeof(struct iwl4965_cmd_meta))
+#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
+                             sizeof(struct iwl_cmd_meta))
 
 /*
  * RX related structures and functions
@@ -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];
 };
@@ -656,10 +637,6 @@ extern int iwl4965_tx_queue_init(struct iwl_priv *priv,
                             struct iwl4965_tx_queue *txq, int count, u32 id);
 extern void iwl4965_rx_replenish(void *data);
 extern void iwl4965_tx_queue_free(struct iwl_priv *priv, struct iwl4965_tx_queue *txq);
-extern int iwl4965_send_cmd_pdu(struct iwl_priv *priv, u8 id, u16 len,
-                           const void *data);
-extern int __must_check iwl4965_send_cmd(struct iwl_priv *priv,
-               struct iwl4965_host_cmd *cmd);
 extern unsigned int iwl4965_fill_beacon_frame(struct iwl_priv *priv,
                                        struct ieee80211_hdr *hdr,
                                        const u8 *dest, int left);
@@ -674,6 +651,7 @@ int iwl4965_init_geos(struct iwl_priv *priv);
 void iwl4965_free_geos(struct iwl_priv *priv);
 
 extern const u8 iwl4965_broadcast_addr[ETH_ALEN];
+int iwl4965_enqueue_hcmd(struct iwl_priv *priv, struct iwl_host_cmd *cmd);
 
 /*
  * Currently used by iwl-3945-rs... look at restructuring so that it doesn't
@@ -718,7 +696,7 @@ extern unsigned int iwl4965_hw_get_beacon_cmd(struct iwl_priv *priv,
                                 struct iwl4965_frame *frame, u8 rate);
 extern int iwl4965_hw_get_rx_read(struct iwl_priv *priv);
 extern void iwl4965_hw_build_tx_cmd_rate(struct iwl_priv *priv,
-                                    struct iwl4965_cmd *cmd,
+                                    struct iwl_cmd *cmd,
                                     struct ieee80211_tx_control *ctrl,
                                     struct ieee80211_hdr *hdr,
                                     int sta_id, int tx_id);
@@ -744,6 +722,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
  */
@@ -764,7 +743,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);
@@ -776,7 +756,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 */
@@ -1053,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 */
@@ -1129,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;
 
@@ -1152,13 +1140,12 @@ 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;
@@ -1222,7 +1209,7 @@ struct iwl_priv {
        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;
 }
@@ -1268,6 +1255,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__ */