aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-dev.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h135
1 files changed, 122 insertions, 13 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index 0468fcc1ea98..437c05b9a335 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Copyright(c) 2003 - 2008 Intel Corporation. All rights reserved. 3 * Copyright(c) 2003 - 2009 Intel Corporation. All rights reserved.
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify it 5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as 6 * under the terms of version 2 of the GNU General Public License as
@@ -36,13 +36,15 @@
36#include <linux/kernel.h> 36#include <linux/kernel.h>
37#include <net/ieee80211_radiotap.h> 37#include <net/ieee80211_radiotap.h>
38 38
39#define DRV_NAME "iwlagn"
40#include "iwl-rfkill.h"
41#include "iwl-eeprom.h" 39#include "iwl-eeprom.h"
42#include "iwl-4965-hw.h"
43#include "iwl-csr.h" 40#include "iwl-csr.h"
44#include "iwl-prph.h" 41#include "iwl-prph.h"
42#include "iwl-fh.h"
45#include "iwl-debug.h" 43#include "iwl-debug.h"
44#include "iwl-rfkill.h"
45#include "iwl-4965-hw.h"
46#include "iwl-3945-hw.h"
47#include "iwl-3945-led.h"
46#include "iwl-led.h" 48#include "iwl-led.h"
47#include "iwl-power.h" 49#include "iwl-power.h"
48#include "iwl-agn-rs.h" 50#include "iwl-agn-rs.h"
@@ -55,6 +57,16 @@ extern struct iwl_cfg iwl5350_agn_cfg;
55extern struct iwl_cfg iwl5100_bg_cfg; 57extern struct iwl_cfg iwl5100_bg_cfg;
56extern struct iwl_cfg iwl5100_abg_cfg; 58extern struct iwl_cfg iwl5100_abg_cfg;
57extern struct iwl_cfg iwl5150_agn_cfg; 59extern struct iwl_cfg iwl5150_agn_cfg;
60extern struct iwl_cfg iwl6000_2ag_cfg;
61extern struct iwl_cfg iwl6000_2agn_cfg;
62extern struct iwl_cfg iwl6000_3agn_cfg;
63extern struct iwl_cfg iwl6050_2agn_cfg;
64extern struct iwl_cfg iwl6050_3agn_cfg;
65extern struct iwl_cfg iwl100_bgn_cfg;
66
67/* shared structures from iwl-5000.c */
68extern struct iwl_mod_params iwl50_mod_params;
69extern struct iwl_ops iwl5000_ops;
58 70
59/* CT-KILL constants */ 71/* CT-KILL constants */
60#define CT_KILL_THRESHOLD 110 /* in Celsius */ 72#define CT_KILL_THRESHOLD 110 /* in Celsius */
@@ -132,9 +144,12 @@ struct iwl_tx_info {
132 * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame 144 * A Tx queue consists of circular buffer of BDs (a.k.a. TFDs, transmit frame
133 * descriptors) and required locking structures. 145 * descriptors) and required locking structures.
134 */ 146 */
147#define TFD_TX_CMD_SLOTS 256
148#define TFD_CMD_SLOTS 32
149
135struct iwl_tx_queue { 150struct iwl_tx_queue {
136 struct iwl_queue q; 151 struct iwl_queue q;
137 struct iwl_tfd *tfds; 152 void *tfds;
138 struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS]; 153 struct iwl_cmd *cmd[TFD_TX_CMD_SLOTS];
139 struct iwl_tx_info *txb; 154 struct iwl_tx_info *txb;
140 u8 need_update; 155 u8 need_update;
@@ -154,6 +169,36 @@ struct iwl4965_channel_tgh_info {
154 s64 last_radar_time; 169 s64 last_radar_time;
155}; 170};
156 171
172#define IWL4965_MAX_RATE (33)
173
174struct iwl3945_clip_group {
175 /* maximum power level to prevent clipping for each rate, derived by
176 * us from this band's saturation power in EEPROM */
177 const s8 clip_powers[IWL_MAX_RATES];
178};
179
180/* current Tx power values to use, one for each rate for each channel.
181 * requested power is limited by:
182 * -- regulatory EEPROM limits for this channel
183 * -- hardware capabilities (clip-powers)
184 * -- spectrum management
185 * -- user preference (e.g. iwconfig)
186 * when requested power is set, base power index must also be set. */
187struct iwl3945_channel_power_info {
188 struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
189 s8 power_table_index; /* actual (compenst'd) index into gain table */
190 s8 base_power_index; /* gain index for power at factory temp. */
191 s8 requested_power; /* power (dBm) requested for this chnl/rate */
192};
193
194/* current scan Tx power values to use, one for each scan rate for each
195 * channel. */
196struct iwl3945_scan_power_info {
197 struct iwl3945_tx_power tpc; /* actual radio and DSP gain settings */
198 s8 power_table_index; /* actual (compenst'd) index into gain table */
199 s8 requested_power; /* scan pwr (dBm) requested for chnl/rate */
200};
201
157/* 202/*
158 * One for each channel, holds all channel setup data 203 * One for each channel, holds all channel setup data
159 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant 204 * Some of the fields (e.g. eeprom and flags/max_power_avg) are redundant
@@ -184,8 +229,15 @@ struct iwl_channel_info {
184 s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */ 229 s8 fat_scan_power; /* (dBm) eeprom, direct scans, any rate */
185 u8 fat_flags; /* flags copied from EEPROM */ 230 u8 fat_flags; /* flags copied from EEPROM */
186 u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */ 231 u8 fat_extension_channel; /* HT_IE_EXT_CHANNEL_* */
187};
188 232
233 /* Radio/DSP gain settings for each "normal" data Tx rate.
234 * These include, in addition to RF and DSP gain, a few fields for
235 * remembering/modifying gain settings (indexes). */
236 struct iwl3945_channel_power_info power_info[IWL4965_MAX_RATE];
237
238 /* Radio/DSP gain settings for each scan rate, for directed scans. */
239 struct iwl3945_scan_power_info scan_pwr_info[IWL_NUM_SCAN_RATES];
240};
189 241
190#define IWL_TX_FIFO_AC0 0 242#define IWL_TX_FIFO_AC0 0
191#define IWL_TX_FIFO_AC1 1 243#define IWL_TX_FIFO_AC1 1
@@ -370,7 +422,7 @@ struct iwl_hw_key {
370 u8 key[32]; 422 u8 key[32];
371}; 423};
372 424
373union iwl4965_ht_rate_supp { 425union iwl_ht_rate_supp {
374 u16 rates; 426 u16 rates;
375 struct { 427 struct {
376 u8 siso_rate; 428 u8 siso_rate;
@@ -430,6 +482,24 @@ struct iwl_qos_info {
430#define STA_PS_STATUS_WAKE 0 482#define STA_PS_STATUS_WAKE 0
431#define STA_PS_STATUS_SLEEP 1 483#define STA_PS_STATUS_SLEEP 1
432 484
485struct iwl3945_tid_data {
486 u16 seq_number;
487};
488
489struct iwl3945_hw_key {
490 enum ieee80211_key_alg alg;
491 int keylen;
492 u8 key[32];
493};
494
495struct iwl3945_station_entry {
496 struct iwl3945_addsta_cmd sta;
497 struct iwl3945_tid_data tid[MAX_TID_COUNT];
498 u8 used;
499 u8 ps_status;
500 struct iwl3945_hw_key keyinfo;
501};
502
433struct iwl_station_entry { 503struct iwl_station_entry {
434 struct iwl_addsta_cmd sta; 504 struct iwl_addsta_cmd sta;
435 struct iwl_tid_data tid[MAX_TID_COUNT]; 505 struct iwl_tid_data tid[MAX_TID_COUNT];
@@ -497,11 +567,13 @@ struct iwl_sensitivity_ranges {
497 * @max_txq_num: Max # Tx queues supported 567 * @max_txq_num: Max # Tx queues supported
498 * @dma_chnl_num: Number of Tx DMA/FIFO channels 568 * @dma_chnl_num: Number of Tx DMA/FIFO channels
499 * @scd_bc_tbls_size: size of scheduler byte count tables 569 * @scd_bc_tbls_size: size of scheduler byte count tables
570 * @tfd_size: TFD size
500 * @tx/rx_chains_num: Number of TX/RX chains 571 * @tx/rx_chains_num: Number of TX/RX chains
501 * @valid_tx/rx_ant: usable antennas 572 * @valid_tx/rx_ant: usable antennas
502 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2) 573 * @max_rxq_size: Max # Rx frames in Rx queue (must be power-of-2)
503 * @max_rxq_log: Log-base-2 of max_rxq_size 574 * @max_rxq_log: Log-base-2 of max_rxq_size
504 * @rx_buf_size: Rx buffer size 575 * @rx_buf_size: Rx buffer size
576 * @rx_wrt_ptr_reg: FH{39}_RSCSR_CHNL0_WPTR
505 * @max_stations: 577 * @max_stations:
506 * @bcast_sta_id: 578 * @bcast_sta_id:
507 * @fat_channel: is 40MHz width possible in band 2.4 579 * @fat_channel: is 40MHz width possible in band 2.4
@@ -516,6 +588,7 @@ struct iwl_hw_params {
516 u8 max_txq_num; 588 u8 max_txq_num;
517 u8 dma_chnl_num; 589 u8 dma_chnl_num;
518 u16 scd_bc_tbls_size; 590 u16 scd_bc_tbls_size;
591 u32 tfd_size;
519 u8 tx_chains_num; 592 u8 tx_chains_num;
520 u8 rx_chains_num; 593 u8 rx_chains_num;
521 u8 valid_tx_ant; 594 u8 valid_tx_ant;
@@ -523,6 +596,7 @@ struct iwl_hw_params {
523 u16 max_rxq_size; 596 u16 max_rxq_size;
524 u16 max_rxq_log; 597 u16 max_rxq_log;
525 u32 rx_buf_size; 598 u32 rx_buf_size;
599 u32 rx_wrt_ptr_reg;
526 u32 max_pkt_size; 600 u32 max_pkt_size;
527 u8 max_stations; 601 u8 max_stations;
528 u8 bcast_sta_id; 602 u8 bcast_sta_id;
@@ -755,7 +829,7 @@ struct iwl_priv {
755 829
756 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS]; 830 struct ieee80211_supported_band bands[IEEE80211_NUM_BANDS];
757 831
758#ifdef CONFIG_IWLAGN_SPECTRUM_MEASUREMENT 832#if defined(CONFIG_IWLAGN_SPECTRUM_MEASUREMENT) || defined(CONFIG_IWL3945_SPECTRUM_MEASUREMENT)
759 /* spectrum measurement report caching */ 833 /* spectrum measurement report caching */
760 struct iwl_spectrum_notification measure_report; 834 struct iwl_spectrum_notification measure_report;
761 u8 measurement_status; 835 u8 measurement_status;
@@ -768,6 +842,10 @@ struct iwl_priv {
768 struct iwl_channel_info *channel_info; /* channel info array */ 842 struct iwl_channel_info *channel_info; /* channel info array */
769 u8 channel_count; /* # of channels */ 843 u8 channel_count; /* # of channels */
770 844
845 /* each calibration channel group in the EEPROM has a derived
846 * clip setting for each rate. 3945 only.*/
847 const struct iwl3945_clip_group clip39_groups[5];
848
771 /* thermal calibration */ 849 /* thermal calibration */
772 s32 temperature; /* degrees Kelvin */ 850 s32 temperature; /* degrees Kelvin */
773 s32 last_temperature; 851 s32 last_temperature;
@@ -781,7 +859,7 @@ struct iwl_priv {
781 unsigned long scan_start; 859 unsigned long scan_start;
782 unsigned long scan_pass_start; 860 unsigned long scan_pass_start;
783 unsigned long scan_start_tsf; 861 unsigned long scan_start_tsf;
784 struct iwl_scan_cmd *scan; 862 void *scan;
785 int scan_bands; 863 int scan_bands;
786 int one_direct_scan; 864 int one_direct_scan;
787 u8 direct_ssid_len; 865 u8 direct_ssid_len;
@@ -832,18 +910,25 @@ struct iwl_priv {
832 * 4965's initialize alive response contains some calibration data. */ 910 * 4965's initialize alive response contains some calibration data. */
833 struct iwl_init_alive_resp card_alive_init; 911 struct iwl_init_alive_resp card_alive_init;
834 struct iwl_alive_resp card_alive; 912 struct iwl_alive_resp card_alive;
835#ifdef CONFIG_IWLWIFI_RFKILL 913#if defined(CONFIG_IWLWIFI_RFKILL) || defined(CONFIG_IWL3945_RFKILL)
836 struct rfkill *rfkill; 914 struct rfkill *rfkill;
837#endif 915#endif
838 916
839#ifdef CONFIG_IWLWIFI_LEDS 917#if defined(CONFIG_IWLWIFI_LEDS) || defined(CONFIG_IWL3945_LEDS)
840 struct iwl_led led[IWL_LED_TRG_MAX];
841 unsigned long last_blink_time; 918 unsigned long last_blink_time;
842 u8 last_blink_rate; 919 u8 last_blink_rate;
843 u8 allow_blinking; 920 u8 allow_blinking;
844 u64 led_tpt; 921 u64 led_tpt;
845#endif 922#endif
846 923
924#ifdef CONFIG_IWLWIFI_LEDS
925 struct iwl_led led[IWL_LED_TRG_MAX];
926#endif
927
928#ifdef CONFIG_IWL3945_LEDS
929 struct iwl3945_led led39[IWL_LED_TRG_MAX];
930 unsigned int rxtxpackets;
931#endif
847 u16 active_rate; 932 u16 active_rate;
848 u16 active_rate_basic; 933 u16 active_rate_basic;
849 934
@@ -893,7 +978,6 @@ struct iwl_priv {
893 u16 rates_mask; 978 u16 rates_mask;
894 979
895 u32 power_mode; 980 u32 power_mode;
896 u32 antenna;
897 u8 bssid[ETH_ALEN]; 981 u8 bssid[ETH_ALEN];
898 u16 rts_threshold; 982 u16 rts_threshold;
899 u8 mac_addr[ETH_ALEN]; 983 u8 mac_addr[ETH_ALEN];
@@ -929,6 +1013,10 @@ struct iwl_priv {
929 u16 beacon_int; 1013 u16 beacon_int;
930 struct ieee80211_vif *vif; 1014 struct ieee80211_vif *vif;
931 1015
1016 /*Added for 3945 */
1017 void *shared_virt;
1018 dma_addr_t shared_phys;
1019 /*End*/
932 struct iwl_hw_params hw_params; 1020 struct iwl_hw_params hw_params;
933 1021
934 1022
@@ -960,6 +1048,11 @@ struct iwl_priv {
960 struct delayed_work init_alive_start; 1048 struct delayed_work init_alive_start;
961 struct delayed_work alive_start; 1049 struct delayed_work alive_start;
962 struct delayed_work scan_check; 1050 struct delayed_work scan_check;
1051
1052 /*For 3945 only*/
1053 struct delayed_work thermal_periodic;
1054 struct delayed_work rfkill_poll;
1055
963 /* TX Power */ 1056 /* TX Power */
964 s8 tx_power_user_lmt; 1057 s8 tx_power_user_lmt;
965 s8 tx_power_channel_lmt; 1058 s8 tx_power_channel_lmt;
@@ -982,6 +1075,22 @@ struct iwl_priv {
982 u32 disable_tx_power_cal; 1075 u32 disable_tx_power_cal;
983 struct work_struct run_time_calib_work; 1076 struct work_struct run_time_calib_work;
984 struct timer_list statistics_periodic; 1077 struct timer_list statistics_periodic;
1078
1079 /*For 3945*/
1080#define IWL_DEFAULT_TX_POWER 0x0F
1081 /* We declare this const so it can only be
1082 * changed via explicit cast within the
1083 * routines that actually update the physical
1084 * hardware */
1085 const struct iwl3945_rxon_cmd active39_rxon;
1086 struct iwl3945_rxon_cmd staging39_rxon;
1087 struct iwl3945_rxon_cmd recovery39_rxon;
1088
1089 struct iwl3945_notif_statistics statistics_39;
1090
1091 struct iwl3945_station_entry stations_39[IWL_STATION_COUNT];
1092
1093 u32 sta_supp_rates;
985}; /*iwl_priv */ 1094}; /*iwl_priv */
986 1095
987static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id) 1096static inline void iwl_txq_ctx_activate(struct iwl_priv *priv, int txq_id)