iwl3945: kill iwl3945_rx_queue_restock
[safe/jmp/linux-2.6] / drivers / net / wireless / iwlwifi / iwl-dev.h
index 245f1d2..fbc4822 100644 (file)
 #include <linux/kernel.h>
 #include <net/ieee80211_radiotap.h>
 
-#include "iwl-rfkill.h"
 #include "iwl-eeprom.h"
-#include "iwl-4965-hw.h"
-#include "iwl-3945-hw.h"
 #include "iwl-csr.h"
 #include "iwl-prph.h"
+#include "iwl-fh.h"
 #include "iwl-debug.h"
+#include "iwl-rfkill.h"
+#include "iwl-4965-hw.h"
+#include "iwl-3945-hw.h"
+#include "iwl-3945-led.h"
 #include "iwl-led.h"
 #include "iwl-power.h"
 #include "iwl-agn-rs.h"
@@ -132,9 +134,13 @@ struct iwl_tx_info {
  * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
  * descriptors) and required locking structures.
  */
+#define TFD_TX_CMD_SLOTS 256
+#define TFD_CMD_SLOTS 32
+
 struct iwl_tx_queue {
        struct iwl_queue q;
        struct iwl_tfd *tfds;
+       struct iwl3945_tfd *tfds39;
        struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS];
        struct iwl_tx_info *txb;
        u8 need_update;
@@ -224,28 +230,6 @@ struct iwl_channel_info {
        struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
 };
 
-/**
- * struct iwl3945_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
- * @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
- *
- * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
- * descriptors) and required locking structures.
- */
-struct iwl3945_tx_queue {
-       struct iwl_queue q;
-       struct iwl3945_tfd_frame *bd;
-       struct iwl3945_cmd *cmd;
-       dma_addr_t dma_addr_cmd;
-       struct iwl3945_tx_info *txb;
-       int need_update;
-       int active;
-};
-
 #define IWL_TX_FIFO_AC0        0
 #define IWL_TX_FIFO_AC1        1
 #define IWL_TX_FIFO_AC2        2
@@ -579,6 +563,7 @@ struct iwl_sensitivity_ranges {
  * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
  * @max_rxq_log: Log-base-2 of max_rxq_size
  * @rx_buf_size: Rx buffer size
+ * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR
  * @max_stations:
  * @bcast_sta_id:
  * @fat_channel: is 40MHz width possible in band 2.4
@@ -600,6 +585,7 @@ struct iwl_hw_params {
        u16 max_rxq_size;
        u16 max_rxq_log;
        u32 rx_buf_size;
+       u32 rx_wrt_ptr_reg;
        u32 max_pkt_size;
        u8  max_stations;
        u8  bcast_sta_id;
@@ -832,7 +818,7 @@ struct iwl_priv {
 
        struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
 
-#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT
+#if defined(CONFIG_IWLAGN_SPECTRUM_MEASUREMENT) || defined(CONFIG_IWL3945_SPECTRUM_MEASUREMENT)
        /* spectrum measurement report caching */
        struct iwl_spectrum_notification measure_report;
        u8 measurement_status;
@@ -913,18 +899,25 @@ struct iwl_priv {
         * 4965's initialize alive response contains some calibration data. */
        struct iwl_init_alive_resp card_alive_init;
        struct iwl_alive_resp card_alive;
-#ifdef CONFIG_IWLWIFI_RFKILL
+#if defined(CONFIG_IWLWIFI_RFKILL) || defined(CONFIG_IWL3945_RFKILL)
        struct rfkill *rfkill;
 #endif
 
-#ifdef CONFIG_IWLWIFI_LEDS
-       struct iwl_led led[IWL_LED_TRG_MAX];
+#if defined(CONFIG_IWLWIFI_LEDS) || defined(CONFIG_IWL3945_LEDS)
        unsigned long last_blink_time;
        u8 last_blink_rate;
        u8 allow_blinking;
        u64 led_tpt;
 #endif
 
+#ifdef CONFIG_IWLWIFI_LEDS
+       struct iwl_led led[IWL_LED_TRG_MAX];
+#endif
+
+#ifdef CONFIG_IWL3945_LEDS
+       struct iwl3945_led led39[IWL_LED_TRG_MAX];
+       unsigned int rxtxpackets;
+#endif
        u16 active_rate;
        u16 active_rate_basic;
 
@@ -1010,6 +1003,10 @@ struct iwl_priv {
        u16 beacon_int;
        struct ieee80211_vif *vif;
 
+       /*Added for 3945 */
+       void *shared_virt;
+       dma_addr_t shared_phys;
+       /*End*/
        struct iwl_hw_params hw_params;
 
 
@@ -1041,12 +1038,16 @@ struct iwl_priv {
        struct delayed_work init_alive_start;
        struct delayed_work alive_start;
        struct delayed_work scan_check;
+
+       /*For 3945 only*/
+       struct delayed_work thermal_periodic;
+
        /* TX Power */
        s8 tx_power_user_lmt;
        s8 tx_power_channel_lmt;
 
 
-#ifdef CONFIG_IWLWIFI_DEBUG
+#if defined(CONFIG_IWLWIFI_DEBUG) || defined(CONFIG_IWL3945_DEBUG)
        /* debugging info */
        u32 debug_level;
        u32 framecnt_to_us;
@@ -1063,6 +1064,33 @@ struct iwl_priv {
        u32 disable_tx_power_cal;
        struct work_struct run_time_calib_work;
        struct timer_list statistics_periodic;
+
+       /*For 3945*/
+#define IWL_DEFAULT_TX_POWER 0x0F
+       s8 user_txpower_limit;
+       s8 max_channel_txpower_limit;
+
+       struct iwl3945_scan_cmd *scan39;
+
+       /* We declare this const so it can only be
+        * changed via explicit cast within the
+        * routines that actually update the physical
+        * hardware */
+       const struct iwl3945_rxon_cmd active39_rxon;
+       struct iwl3945_rxon_cmd staging39_rxon;
+       struct iwl3945_rxon_cmd recovery39_rxon;
+
+       struct iwl3945_power_mgr power_data_39;
+       struct iwl3945_notif_statistics statistics_39;
+
+       struct iwl3945_station_entry stations_39[IWL_STATION_COUNT];
+
+       /* eeprom */
+       struct iwl3945_eeprom eeprom39;
+
+       u32 sta_supp_rates;
+       u8 call_post_assoc_from_beacon;
+
 }; /*iwl_priv */
 
 static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id)