aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-10-25 05:15:50 -0400
committerDavid S. Miller <davem@davemloft.net>2008-01-28 18:03:24 -0500
commit5d08cd1dfdc57dc834c47eb9f023fcf861f3d6bf (patch)
treeabac0496b2ab958970c58c459070a8ca5f5fdde7 /drivers/net/wireless/iwlwifi/iwl-4965-hw.h
parent416e1438d5a921046fda6fc5673d5f2c69841c06 (diff)
iwlwifi: keep 3945 and 4965 headers separate
The iwl3945 and iwl4965 devices share some common structure, but with a lot of difference split all over. Currently the two drivers share a lot of headers and use ugly preprocessor magic to manage the difference. This patch keeps two entirely separate copies of the headers to get rid of these hacks an ease future development. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965-hw.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965-hw.h677
1 files changed, 677 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
index 5fc707b1ea7d..21c75774cf4e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-4965-hw.h
@@ -64,6 +64,683 @@
64#ifndef __iwl_4965_hw_h__ 64#ifndef __iwl_4965_hw_h__
65#define __iwl_4965_hw_h__ 65#define __iwl_4965_hw_h__
66 66
67/* uCode queue management definitions */
68#define IWL_CMD_QUEUE_NUM 4
69#define IWL_CMD_FIFO_NUM 4
70#define IWL_BACK_QUEUE_FIRST_ID 7
71
72/* Tx rates */
73#define IWL_CCK_RATES 4
74#define IWL_OFDM_RATES 8
75
76#define IWL_HT_RATES 16
77
78#define IWL_MAX_RATES (IWL_CCK_RATES+IWL_OFDM_RATES+IWL_HT_RATES)
79
80/* Time constants */
81#define SHORT_SLOT_TIME 9
82#define LONG_SLOT_TIME 20
83
84/* RSSI to dBm */
85#define IWL_RSSI_OFFSET 44
86
87/*
88 * This file defines EEPROM related constants, enums, and inline functions.
89 *
90 */
91
92#define IWL_EEPROM_ACCESS_TIMEOUT 5000 /* uSec */
93#define IWL_EEPROM_ACCESS_DELAY 10 /* uSec */
94/* EEPROM field values */
95#define ANTENNA_SWITCH_NORMAL 0
96#define ANTENNA_SWITCH_INVERSE 1
97
98enum {
99 EEPROM_CHANNEL_VALID = (1 << 0), /* usable for this SKU/geo */
100 EEPROM_CHANNEL_IBSS = (1 << 1), /* usable as an IBSS channel */
101 /* Bit 2 Reserved */
102 EEPROM_CHANNEL_ACTIVE = (1 << 3), /* active scanning allowed */
103 EEPROM_CHANNEL_RADAR = (1 << 4), /* radar detection required */
104 EEPROM_CHANNEL_WIDE = (1 << 5),
105 EEPROM_CHANNEL_NARROW = (1 << 6),
106 EEPROM_CHANNEL_DFS = (1 << 7), /* dynamic freq selection candidate */
107};
108
109/* EEPROM field lengths */
110#define EEPROM_BOARD_PBA_NUMBER_LENGTH 11
111
112/* EEPROM field lengths */
113#define EEPROM_BOARD_PBA_NUMBER_LENGTH 11
114#define EEPROM_REGULATORY_SKU_ID_LENGTH 4
115#define EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH 14
116#define EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH 13
117#define EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH 12
118#define EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH 11
119#define EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH 6
120
121#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS_LENGTH 7
122#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS_LENGTH 11
123#define EEPROM_REGULATORY_CHANNELS_LENGTH ( \
124 EEPROM_REGULATORY_BAND1_CHANNELS_LENGTH + \
125 EEPROM_REGULATORY_BAND2_CHANNELS_LENGTH + \
126 EEPROM_REGULATORY_BAND3_CHANNELS_LENGTH + \
127 EEPROM_REGULATORY_BAND4_CHANNELS_LENGTH + \
128 EEPROM_REGULATORY_BAND5_CHANNELS_LENGTH + \
129 EEPROM_REGULATORY_BAND_24_FAT_CHANNELS_LENGTH + \
130 EEPROM_REGULATORY_BAND_52_FAT_CHANNELS_LENGTH)
131
132#define EEPROM_REGULATORY_NUMBER_OF_BANDS 5
133
134/* SKU Capabilities */
135#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0)
136#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1)
137#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
138
139/* *regulatory* channel data from eeprom, one for each channel */
140struct iwl_eeprom_channel {
141 u8 flags; /* flags copied from EEPROM */
142 s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
143} __attribute__ ((packed));
144
145/*
146 * Mapping of a Tx power level, at factory calibration temperature,
147 * to a radio/DSP gain table index.
148 * One for each of 5 "sample" power levels in each band.
149 * v_det is measured at the factory, using the 3945's built-in power amplifier
150 * (PA) output voltage detector. This same detector is used during Tx of
151 * long packets in normal operation to provide feedback as to proper output
152 * level.
153 * Data copied from EEPROM.
154 */
155struct iwl_eeprom_txpower_sample {
156 u8 gain_index; /* index into power (gain) setup table ... */
157 s8 power; /* ... for this pwr level for this chnl group */
158 u16 v_det; /* PA output voltage */
159} __attribute__ ((packed));
160
161/*
162 * Mappings of Tx power levels -> nominal radio/DSP gain table indexes.
163 * One for each channel group (a.k.a. "band") (1 for BG, 4 for A).
164 * Tx power setup code interpolates between the 5 "sample" power levels
165 * to determine the nominal setup for a requested power level.
166 * Data copied from EEPROM.
167 * DO NOT ALTER THIS STRUCTURE!!!
168 */
169struct iwl_eeprom_txpower_group {
170 struct iwl_eeprom_txpower_sample samples[5]; /* 5 power levels */
171 s32 a, b, c, d, e; /* coefficients for voltage->power
172 * formula (signed) */
173 s32 Fa, Fb, Fc, Fd, Fe; /* these modify coeffs based on
174 * frequency (signed) */
175 s8 saturation_power; /* highest power possible by h/w in this
176 * band */
177 u8 group_channel; /* "representative" channel # in this band */
178 s16 temperature; /* h/w temperature at factory calib this band
179 * (signed) */
180} __attribute__ ((packed));
181
182/*
183 * Temperature-based Tx-power compensation data, not band-specific.
184 * These coefficients are use to modify a/b/c/d/e coeffs based on
185 * difference between current temperature and factory calib temperature.
186 * Data copied from EEPROM.
187 */
188struct iwl_eeprom_temperature_corr {
189 u32 Ta;
190 u32 Tb;
191 u32 Tc;
192 u32 Td;
193 u32 Te;
194} __attribute__ ((packed));
195
196#define EEPROM_TX_POWER_TX_CHAINS (2)
197#define EEPROM_TX_POWER_BANDS (8)
198#define EEPROM_TX_POWER_MEASUREMENTS (3)
199#define EEPROM_TX_POWER_VERSION (2)
200#define EEPROM_TX_POWER_VERSION_NEW (5)
201
202struct iwl_eeprom_calib_measure {
203 u8 temperature;
204 u8 gain_idx;
205 u8 actual_pow;
206 s8 pa_det;
207} __attribute__ ((packed));
208
209struct iwl_eeprom_calib_ch_info {
210 u8 ch_num;
211 struct iwl_eeprom_calib_measure measurements[EEPROM_TX_POWER_TX_CHAINS]
212 [EEPROM_TX_POWER_MEASUREMENTS];
213} __attribute__ ((packed));
214
215struct iwl_eeprom_calib_subband_info {
216 u8 ch_from;
217 u8 ch_to;
218 struct iwl_eeprom_calib_ch_info ch1;
219 struct iwl_eeprom_calib_ch_info ch2;
220} __attribute__ ((packed));
221
222struct iwl_eeprom_calib_info {
223 u8 saturation_power24;
224 u8 saturation_power52;
225 s16 voltage; /* signed */
226 struct iwl_eeprom_calib_subband_info band_info[EEPROM_TX_POWER_BANDS];
227} __attribute__ ((packed));
228
229
230struct iwl_eeprom {
231 u8 reserved0[16];
232#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
233 u16 device_id; /* abs.ofs: 16 */
234 u8 reserved1[2];
235#define EEPROM_PMC (2*0x0A) /* 2 bytes */
236 u16 pmc; /* abs.ofs: 20 */
237 u8 reserved2[20];
238#define EEPROM_MAC_ADDRESS (2*0x15) /* 6 bytes */
239 u8 mac_address[6]; /* abs.ofs: 42 */
240 u8 reserved3[58];
241#define EEPROM_BOARD_REVISION (2*0x35) /* 2 bytes */
242 u16 board_revision; /* abs.ofs: 106 */
243 u8 reserved4[11];
244#define EEPROM_BOARD_PBA_NUMBER (2*0x3B+1) /* 9 bytes */
245 u8 board_pba_number[9]; /* abs.ofs: 119 */
246 u8 reserved5[8];
247#define EEPROM_VERSION (2*0x44) /* 2 bytes */
248 u16 version; /* abs.ofs: 136 */
249#define EEPROM_SKU_CAP (2*0x45) /* 1 bytes */
250 u8 sku_cap; /* abs.ofs: 138 */
251#define EEPROM_LEDS_MODE (2*0x45+1) /* 1 bytes */
252 u8 leds_mode; /* abs.ofs: 139 */
253#define EEPROM_OEM_MODE (2*0x46) /* 2 bytes */
254 u16 oem_mode;
255#define EEPROM_WOWLAN_MODE (2*0x47) /* 2 bytes */
256 u16 wowlan_mode; /* abs.ofs: 142 */
257#define EEPROM_LEDS_TIME_INTERVAL (2*0x48) /* 2 bytes */
258 u16 leds_time_interval; /* abs.ofs: 144 */
259#define EEPROM_LEDS_OFF_TIME (2*0x49) /* 1 bytes */
260 u8 leds_off_time; /* abs.ofs: 146 */
261#define EEPROM_LEDS_ON_TIME (2*0x49+1) /* 1 bytes */
262 u8 leds_on_time; /* abs.ofs: 147 */
263#define EEPROM_ALMGOR_M_VERSION (2*0x4A) /* 1 bytes */
264 u8 almgor_m_version; /* abs.ofs: 148 */
265#define EEPROM_ANTENNA_SWITCH_TYPE (2*0x4A+1) /* 1 bytes */
266 u8 antenna_switch_type; /* abs.ofs: 149 */
267 u8 reserved6[8];
268#define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */
269 u16 board_revision_4965; /* abs.ofs: 158 */
270 u8 reserved7[13];
271#define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */
272 u8 board_pba_number_4965[9]; /* abs.ofs: 173 */
273 u8 reserved8[10];
274#define EEPROM_REGULATORY_SKU_ID (2*0x60) /* 4 bytes */
275 u8 sku_id[4]; /* abs.ofs: 192 */
276#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
277 u16 band_1_count; /* abs.ofs: 196 */
278#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
279 struct iwl_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
280#define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
281 u16 band_2_count; /* abs.ofs: 226 */
282#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
283 struct iwl_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
284#define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
285 u16 band_3_count; /* abs.ofs: 254 */
286#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
287 struct iwl_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
288#define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
289 u16 band_4_count; /* abs.ofs: 280 */
290#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
291 struct iwl_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
292#define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
293 u16 band_5_count; /* abs.ofs: 304 */
294#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
295 struct iwl_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
296
297 u8 reserved10[2];
298#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS (2*0xA0) /* 14 bytes */
299 struct iwl_eeprom_channel band_24_channels[7]; /* abs.ofs: 320 */
300 u8 reserved11[2];
301#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS (2*0xA8) /* 22 bytes */
302 struct iwl_eeprom_channel band_52_channels[11]; /* abs.ofs: 336 */
303 u8 reserved12[6];
304#define EEPROM_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */
305 u16 calib_version; /* abs.ofs: 364 */
306 u8 reserved13[2];
307#define EEPROM_SATURATION_POWER_OFFSET (2*0xB8) /* 2 bytes */
308 u16 satruation_power; /* abs.ofs: 368 */
309 u8 reserved14[94];
310#define EEPROM_IWL_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */
311 struct iwl_eeprom_calib_info calib_info; /* abs.ofs: 464 */
312
313 u8 reserved16[140]; /* fill out to full 1024 byte block */
314
315
316} __attribute__ ((packed));
317
318#define IWL_EEPROM_IMAGE_SIZE 1024
319
320
321#include "iwl-4965-commands.h"
322
323#define PCI_LINK_CTRL 0x0F0
324#define PCI_POWER_SOURCE 0x0C8
325#define PCI_REG_WUM8 0x0E8
326#define PCI_CFG_PMC_PME_FROM_D3COLD_SUPPORT (0x80000000)
327
328/*=== CSR (control and status registers) ===*/
329#define CSR_BASE (0x000)
330
331#define CSR_SW_VER (CSR_BASE+0x000)
332#define CSR_HW_IF_CONFIG_REG (CSR_BASE+0x000) /* hardware interface config */
333#define CSR_INT_COALESCING (CSR_BASE+0x004) /* accum ints, 32-usec units */
334#define CSR_INT (CSR_BASE+0x008) /* host interrupt status/ack */
335#define CSR_INT_MASK (CSR_BASE+0x00c) /* host interrupt enable */
336#define CSR_FH_INT_STATUS (CSR_BASE+0x010) /* busmaster int status/ack*/
337#define CSR_GPIO_IN (CSR_BASE+0x018) /* read external chip pins */
338#define CSR_RESET (CSR_BASE+0x020) /* busmaster enable, NMI, etc*/
339#define CSR_GP_CNTRL (CSR_BASE+0x024)
340#define CSR_HW_REV (CSR_BASE+0x028)
341#define CSR_EEPROM_REG (CSR_BASE+0x02c)
342#define CSR_EEPROM_GP (CSR_BASE+0x030)
343#define CSR_GP_UCODE (CSR_BASE+0x044)
344#define CSR_UCODE_DRV_GP1 (CSR_BASE+0x054)
345#define CSR_UCODE_DRV_GP1_SET (CSR_BASE+0x058)
346#define CSR_UCODE_DRV_GP1_CLR (CSR_BASE+0x05c)
347#define CSR_UCODE_DRV_GP2 (CSR_BASE+0x060)
348#define CSR_LED_REG (CSR_BASE+0x094)
349#define CSR_DRAM_INT_TBL_CTL (CSR_BASE+0x0A0)
350#define CSR_GIO_CHICKEN_BITS (CSR_BASE+0x100)
351#define CSR_ANA_PLL_CFG (CSR_BASE+0x20c)
352#define CSR_HW_REV_WA_REG (CSR_BASE+0x22C)
353
354/* HW I/F configuration */
355#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MB (0x00000100)
356#define CSR_HW_IF_CONFIG_REG_BIT_ALMAGOR_MM (0x00000200)
357#define CSR_HW_IF_CONFIG_REG_BIT_SKU_MRC (0x00000400)
358#define CSR_HW_IF_CONFIG_REG_BIT_BOARD_TYPE (0x00000800)
359#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_A (0x00000000)
360#define CSR_HW_IF_CONFIG_REG_BITS_SILICON_TYPE_B (0x00001000)
361#define CSR_HW_IF_CONFIG_REG_BIT_EEPROM_OWN_SEM (0x00200000)
362
363/* interrupt flags in INTA, set by uCode or hardware (e.g. dma),
364 * acknowledged (reset) by host writing "1" to flagged bits. */
365#define CSR_INT_BIT_FH_RX (1<<31) /* Rx DMA, cmd responses, FH_INT[17:16] */
366#define CSR_INT_BIT_HW_ERR (1<<29) /* DMA hardware error FH_INT[31] */
367#define CSR_INT_BIT_DNLD (1<<28) /* uCode Download */
368#define CSR_INT_BIT_FH_TX (1<<27) /* Tx DMA FH_INT[1:0] */
369#define CSR_INT_BIT_MAC_CLK_ACTV (1<<26) /* NIC controller's clock toggled on/off */
370#define CSR_INT_BIT_SW_ERR (1<<25) /* uCode error */
371#define CSR_INT_BIT_RF_KILL (1<<7) /* HW RFKILL switch GP_CNTRL[27] toggled */
372#define CSR_INT_BIT_CT_KILL (1<<6) /* Critical temp (chip too hot) rfkill */
373#define CSR_INT_BIT_SW_RX (1<<3) /* Rx, command responses, 3945 */
374#define CSR_INT_BIT_WAKEUP (1<<1) /* NIC controller waking up (pwr mgmt) */
375#define CSR_INT_BIT_ALIVE (1<<0) /* uCode interrupts once it initializes */
376
377#define CSR_INI_SET_MASK (CSR_INT_BIT_FH_RX | \
378 CSR_INT_BIT_HW_ERR | \
379 CSR_INT_BIT_FH_TX | \
380 CSR_INT_BIT_SW_ERR | \
381 CSR_INT_BIT_RF_KILL | \
382 CSR_INT_BIT_SW_RX | \
383 CSR_INT_BIT_WAKEUP | \
384 CSR_INT_BIT_ALIVE)
385
386/* interrupt flags in FH (flow handler) (PCI busmaster DMA) */
387#define CSR_FH_INT_BIT_ERR (1<<31) /* Error */
388#define CSR_FH_INT_BIT_HI_PRIOR (1<<30) /* High priority Rx, bypass coalescing */
389#define CSR_FH_INT_BIT_RX_CHNL2 (1<<18) /* Rx channel 2 (3945 only) */
390#define CSR_FH_INT_BIT_RX_CHNL1 (1<<17) /* Rx channel 1 */
391#define CSR_FH_INT_BIT_RX_CHNL0 (1<<16) /* Rx channel 0 */
392#define CSR_FH_INT_BIT_TX_CHNL6 (1<<6) /* Tx channel 6 (3945 only) */
393#define CSR_FH_INT_BIT_TX_CHNL1 (1<<1) /* Tx channel 1 */
394#define CSR_FH_INT_BIT_TX_CHNL0 (1<<0) /* Tx channel 0 */
395
396#define CSR_FH_INT_RX_MASK (CSR_FH_INT_BIT_HI_PRIOR | \
397 CSR_FH_INT_BIT_RX_CHNL2 | \
398 CSR_FH_INT_BIT_RX_CHNL1 | \
399 CSR_FH_INT_BIT_RX_CHNL0)
400
401#define CSR_FH_INT_TX_MASK (CSR_FH_INT_BIT_TX_CHNL6 | \
402 CSR_FH_INT_BIT_TX_CHNL1 | \
403 CSR_FH_INT_BIT_TX_CHNL0 )
404
405
406/* RESET */
407#define CSR_RESET_REG_FLAG_NEVO_RESET (0x00000001)
408#define CSR_RESET_REG_FLAG_FORCE_NMI (0x00000002)
409#define CSR_RESET_REG_FLAG_SW_RESET (0x00000080)
410#define CSR_RESET_REG_FLAG_MASTER_DISABLED (0x00000100)
411#define CSR_RESET_REG_FLAG_STOP_MASTER (0x00000200)
412
413/* GP (general purpose) CONTROL */
414#define CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY (0x00000001)
415#define CSR_GP_CNTRL_REG_FLAG_INIT_DONE (0x00000004)
416#define CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ (0x00000008)
417#define CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP (0x00000010)
418
419#define CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN (0x00000001)
420
421#define CSR_GP_CNTRL_REG_MSK_POWER_SAVE_TYPE (0x07000000)
422#define CSR_GP_CNTRL_REG_FLAG_MAC_POWER_SAVE (0x04000000)
423#define CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW (0x08000000)
424
425
426/* EEPROM REG */
427#define CSR_EEPROM_REG_READ_VALID_MSK (0x00000001)
428#define CSR_EEPROM_REG_BIT_CMD (0x00000002)
429
430/* EEPROM GP */
431#define CSR_EEPROM_GP_VALID_MSK (0x00000006)
432#define CSR_EEPROM_GP_BAD_SIGNATURE (0x00000000)
433#define CSR_EEPROM_GP_IF_OWNER_MSK (0x00000180)
434
435/* UCODE DRV GP */
436#define CSR_UCODE_DRV_GP1_BIT_MAC_SLEEP (0x00000001)
437#define CSR_UCODE_SW_BIT_RFKILL (0x00000002)
438#define CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED (0x00000004)
439#define CSR_UCODE_DRV_GP1_REG_BIT_CT_KILL_EXIT (0x00000008)
440
441/* GPIO */
442#define CSR_GPIO_IN_BIT_AUX_POWER (0x00000200)
443#define CSR_GPIO_IN_VAL_VAUX_PWR_SRC (0x00000000)
444#define CSR_GPIO_IN_VAL_VMAIN_PWR_SRC CSR_GPIO_IN_BIT_AUX_POWER
445
446/* GI Chicken Bits */
447#define CSR_GIO_CHICKEN_BITS_REG_BIT_L1A_NO_L0S_RX (0x00800000)
448#define CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER (0x20000000)
449
450/* CSR_ANA_PLL_CFG */
451#define CSR_ANA_PLL_CFG_SH (0x00880300)
452
453#define CSR_LED_REG_TRUN_ON (0x00000078)
454#define CSR_LED_REG_TRUN_OFF (0x00000038)
455#define CSR_LED_BSM_CTRL_MSK (0xFFFFFFDF)
456
457/* DRAM_INT_TBL_CTRL */
458#define CSR_DRAM_INT_TBL_CTRL_EN (1<<31)
459#define CSR_DRAM_INT_TBL_CTRL_WRAP_CHK (1<<27)
460
461/*=== HBUS (Host-side Bus) ===*/
462#define HBUS_BASE (0x400)
463
464#define HBUS_TARG_MEM_RADDR (HBUS_BASE+0x00c)
465#define HBUS_TARG_MEM_WADDR (HBUS_BASE+0x010)
466#define HBUS_TARG_MEM_WDAT (HBUS_BASE+0x018)
467#define HBUS_TARG_MEM_RDAT (HBUS_BASE+0x01c)
468#define HBUS_TARG_PRPH_WADDR (HBUS_BASE+0x044)
469#define HBUS_TARG_PRPH_RADDR (HBUS_BASE+0x048)
470#define HBUS_TARG_PRPH_WDAT (HBUS_BASE+0x04c)
471#define HBUS_TARG_PRPH_RDAT (HBUS_BASE+0x050)
472#define HBUS_TARG_WRPTR (HBUS_BASE+0x060)
473
474#define HBUS_TARG_MBX_C (HBUS_BASE+0x030)
475
476
477/* SCD (Scheduler) */
478#define SCD_BASE (CSR_BASE + 0x2E00)
479
480#define SCD_MODE_REG (SCD_BASE + 0x000)
481#define SCD_ARASTAT_REG (SCD_BASE + 0x004)
482#define SCD_TXFACT_REG (SCD_BASE + 0x010)
483#define SCD_TXF4MF_REG (SCD_BASE + 0x014)
484#define SCD_TXF5MF_REG (SCD_BASE + 0x020)
485#define SCD_SBYP_MODE_1_REG (SCD_BASE + 0x02C)
486#define SCD_SBYP_MODE_2_REG (SCD_BASE + 0x030)
487
488/*=== FH (data Flow Handler) ===*/
489#define FH_BASE (0x800)
490
491#define FH_CBCC_TABLE (FH_BASE+0x140)
492#define FH_TFDB_TABLE (FH_BASE+0x180)
493#define FH_RCSR_TABLE (FH_BASE+0x400)
494#define FH_RSSR_TABLE (FH_BASE+0x4c0)
495#define FH_TCSR_TABLE (FH_BASE+0x500)
496#define FH_TSSR_TABLE (FH_BASE+0x680)
497
498/* TFDB (Transmit Frame Buffer Descriptor) */
499#define FH_TFDB(_channel, buf) \
500 (FH_TFDB_TABLE+((_channel)*2+(buf))*0x28)
501#define ALM_FH_TFDB_CHNL_BUF_CTRL_REG(_channel) \
502 (FH_TFDB_TABLE + 0x50 * _channel)
503/* CBCC _channel is [0,2] */
504#define FH_CBCC(_channel) (FH_CBCC_TABLE+(_channel)*0x8)
505#define FH_CBCC_CTRL(_channel) (FH_CBCC(_channel)+0x00)
506#define FH_CBCC_BASE(_channel) (FH_CBCC(_channel)+0x04)
507
508/* RCSR _channel is [0,2] */
509#define FH_RCSR(_channel) (FH_RCSR_TABLE+(_channel)*0x40)
510#define FH_RCSR_CONFIG(_channel) (FH_RCSR(_channel)+0x00)
511#define FH_RCSR_RBD_BASE(_channel) (FH_RCSR(_channel)+0x04)
512#define FH_RCSR_WPTR(_channel) (FH_RCSR(_channel)+0x20)
513#define FH_RCSR_RPTR_ADDR(_channel) (FH_RCSR(_channel)+0x24)
514
515#define FH_RSCSR_CHNL0_WPTR (FH_RSCSR_CHNL0_RBDCB_WPTR_REG)
516
517/* RSSR */
518#define FH_RSSR_CTRL (FH_RSSR_TABLE+0x000)
519#define FH_RSSR_STATUS (FH_RSSR_TABLE+0x004)
520/* TCSR */
521#define FH_TCSR(_channel) (FH_TCSR_TABLE+(_channel)*0x20)
522#define FH_TCSR_CONFIG(_channel) (FH_TCSR(_channel)+0x00)
523#define FH_TCSR_CREDIT(_channel) (FH_TCSR(_channel)+0x04)
524#define FH_TCSR_BUFF_STTS(_channel) (FH_TCSR(_channel)+0x08)
525/* TSSR */
526#define FH_TSSR_CBB_BASE (FH_TSSR_TABLE+0x000)
527#define FH_TSSR_MSG_CONFIG (FH_TSSR_TABLE+0x008)
528#define FH_TSSR_TX_STATUS (FH_TSSR_TABLE+0x010)
529/* 18 - reserved */
530
531/* card static random access memory (SRAM) for processor data and instructs */
532#define RTC_INST_LOWER_BOUND (0x000000)
533#define RTC_DATA_LOWER_BOUND (0x800000)
534
535
536/* DBM */
537
538#define ALM_FH_SRVC_CHNL (6)
539
540#define ALM_FH_RCSR_RX_CONFIG_REG_POS_RBDC_SIZE (20)
541#define ALM_FH_RCSR_RX_CONFIG_REG_POS_IRQ_RBTH (4)
542
543#define ALM_FH_RCSR_RX_CONFIG_REG_BIT_WR_STTS_EN (0x08000000)
544
545#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_DMA_CHNL_EN_ENABLE (0x80000000)
546
547#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_RDRBD_EN_ENABLE (0x20000000)
548
549#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MAX_FRAG_SIZE_128 (0x01000000)
550
551#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_IRQ_DEST_INT_HOST (0x00001000)
552
553#define ALM_FH_RCSR_RX_CONFIG_REG_VAL_MSG_MODE_FH (0x00000000)
554
555#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_TXF (0x00000000)
556#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_MSG_MODE_DRIVER (0x00000001)
557
558#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE_VAL (0x00000000)
559#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_ENABLE_VAL (0x00000008)
560
561#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_HOST_IFTFD (0x00200000)
562
563#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_CIRQ_RTC_NOINT (0x00000000)
564
565#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE (0x00000000)
566#define ALM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE (0x80000000)
567
568#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID (0x00004000)
569
570#define ALM_FH_TCSR_CHNL_TX_BUF_STS_REG_BIT_TFDB_WPTR (0x00000001)
571
572#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TXPD_ON (0xFF000000)
573#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_TXPD_ON (0x00FF0000)
574
575#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_MAX_FRAG_SIZE_128B (0x00000400)
576
577#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_SNOOP_RD_TFD_ON (0x00000100)
578#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RD_CBB_ON (0x00000080)
579
580#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_ORDER_RSP_WAIT_TH (0x00000020)
581#define ALM_FH_TSSR_TX_MSG_CONFIG_REG_VAL_RSP_WAIT_TH (0x00000005)
582
583#define ALM_TB_MAX_BYTES_COUNT (0xFFF0)
584
585#define ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) \
586 ((1LU << _channel) << 24)
587#define ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel) \
588 ((1LU << _channel) << 16)
589
590#define ALM_FH_TSSR_TX_STATUS_REG_MSK_CHNL_IDLE(_channel) \
591 (ALM_FH_TSSR_TX_STATUS_REG_BIT_BUFS_EMPTY(_channel) | \
592 ALM_FH_TSSR_TX_STATUS_REG_BIT_NO_PEND_REQ(_channel))
593#define PCI_CFG_REV_ID_BIT_BASIC_SKU (0x40) /* bit 6 */
594#define PCI_CFG_REV_ID_BIT_RTP (0x80) /* bit 7 */
595
596#define HBUS_TARG_MBX_C_REG_BIT_CMD_BLOCKED (0x00000004)
597
598#define TFD_QUEUE_MIN 0
599#define TFD_QUEUE_MAX 6
600#define TFD_QUEUE_SIZE_MAX (256)
601
602/* spectrum and channel data structures */
603#define IWL_NUM_SCAN_RATES (2)
604
605#define IWL_SCAN_FLAG_24GHZ (1<<0)
606#define IWL_SCAN_FLAG_52GHZ (1<<1)
607#define IWL_SCAN_FLAG_ACTIVE (1<<2)
608#define IWL_SCAN_FLAG_DIRECT (1<<3)
609
610#define IWL_MAX_CMD_SIZE 1024
611
612#define IWL_DEFAULT_TX_RETRY 15
613#define IWL_MAX_TX_RETRY 16
614
615/*********************************************/
616
617#define RFD_SIZE 4
618#define NUM_TFD_CHUNKS 4
619
620#define RX_QUEUE_SIZE 256
621#define RX_QUEUE_MASK 255
622#define RX_QUEUE_SIZE_LOG 8
623
624/* QoS definitions */
625
626#define CW_MIN_OFDM 15
627#define CW_MAX_OFDM 1023
628#define CW_MIN_CCK 31
629#define CW_MAX_CCK 1023
630
631#define QOS_TX0_CW_MIN_OFDM CW_MIN_OFDM
632#define QOS_TX1_CW_MIN_OFDM CW_MIN_OFDM
633#define QOS_TX2_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
634#define QOS_TX3_CW_MIN_OFDM ((CW_MIN_OFDM + 1) / 4 - 1)
635
636#define QOS_TX0_CW_MIN_CCK CW_MIN_CCK
637#define QOS_TX1_CW_MIN_CCK CW_MIN_CCK
638#define QOS_TX2_CW_MIN_CCK ((CW_MIN_CCK + 1) / 2 - 1)
639#define QOS_TX3_CW_MIN_CCK ((CW_MIN_CCK + 1) / 4 - 1)
640
641#define QOS_TX0_CW_MAX_OFDM CW_MAX_OFDM
642#define QOS_TX1_CW_MAX_OFDM CW_MAX_OFDM
643#define QOS_TX2_CW_MAX_OFDM CW_MIN_OFDM
644#define QOS_TX3_CW_MAX_OFDM ((CW_MIN_OFDM + 1) / 2 - 1)
645
646#define QOS_TX0_CW_MAX_CCK CW_MAX_CCK
647#define QOS_TX1_CW_MAX_CCK CW_MAX_CCK
648#define QOS_TX2_CW_MAX_CCK CW_MIN_CCK
649#define QOS_TX3_CW_MAX_CCK ((CW_MIN_CCK + 1) / 2 - 1)
650
651#define QOS_TX0_AIFS 3
652#define QOS_TX1_AIFS 7
653#define QOS_TX2_AIFS 2
654#define QOS_TX3_AIFS 2
655
656#define QOS_TX0_ACM 0
657#define QOS_TX1_ACM 0
658#define QOS_TX2_ACM 0
659#define QOS_TX3_ACM 0
660
661#define QOS_TX0_TXOP_LIMIT_CCK 0
662#define QOS_TX1_TXOP_LIMIT_CCK 0
663#define QOS_TX2_TXOP_LIMIT_CCK 6016
664#define QOS_TX3_TXOP_LIMIT_CCK 3264
665
666#define QOS_TX0_TXOP_LIMIT_OFDM 0
667#define QOS_TX1_TXOP_LIMIT_OFDM 0
668#define QOS_TX2_TXOP_LIMIT_OFDM 3008
669#define QOS_TX3_TXOP_LIMIT_OFDM 1504
670
671#define DEF_TX0_CW_MIN_OFDM CW_MIN_OFDM
672#define DEF_TX1_CW_MIN_OFDM CW_MIN_OFDM
673#define DEF_TX2_CW_MIN_OFDM CW_MIN_OFDM
674#define DEF_TX3_CW_MIN_OFDM CW_MIN_OFDM
675
676#define DEF_TX0_CW_MIN_CCK CW_MIN_CCK
677#define DEF_TX1_CW_MIN_CCK CW_MIN_CCK
678#define DEF_TX2_CW_MIN_CCK CW_MIN_CCK
679#define DEF_TX3_CW_MIN_CCK CW_MIN_CCK
680
681#define DEF_TX0_CW_MAX_OFDM CW_MAX_OFDM
682#define DEF_TX1_CW_MAX_OFDM CW_MAX_OFDM
683#define DEF_TX2_CW_MAX_OFDM CW_MAX_OFDM
684#define DEF_TX3_CW_MAX_OFDM CW_MAX_OFDM
685
686#define DEF_TX0_CW_MAX_CCK CW_MAX_CCK
687#define DEF_TX1_CW_MAX_CCK CW_MAX_CCK
688#define DEF_TX2_CW_MAX_CCK CW_MAX_CCK
689#define DEF_TX3_CW_MAX_CCK CW_MAX_CCK
690
691#define DEF_TX0_AIFS (2)
692#define DEF_TX1_AIFS (2)
693#define DEF_TX2_AIFS (2)
694#define DEF_TX3_AIFS (2)
695
696#define DEF_TX0_ACM 0
697#define DEF_TX1_ACM 0
698#define DEF_TX2_ACM 0
699#define DEF_TX3_ACM 0
700
701#define DEF_TX0_TXOP_LIMIT_CCK 0
702#define DEF_TX1_TXOP_LIMIT_CCK 0
703#define DEF_TX2_TXOP_LIMIT_CCK 0
704#define DEF_TX3_TXOP_LIMIT_CCK 0
705
706#define DEF_TX0_TXOP_LIMIT_OFDM 0
707#define DEF_TX1_TXOP_LIMIT_OFDM 0
708#define DEF_TX2_TXOP_LIMIT_OFDM 0
709#define DEF_TX3_TXOP_LIMIT_OFDM 0
710
711#define QOS_QOS_SETS 3
712#define QOS_PARAM_SET_ACTIVE 0
713#define QOS_PARAM_SET_DEF_CCK 1
714#define QOS_PARAM_SET_DEF_OFDM 2
715
716#define CTRL_QOS_NO_ACK (0x0020)
717#define DCT_FLAG_EXT_QOS_ENABLED (0x10)
718
719#define U32_PAD(n) ((4-(n))&0x3)
720
721/*
722 * Generic queue structure
723 *
724 * Contains common data for Rx and Tx queues
725 */
726#define TFD_CTL_COUNT_SET(n) (n<<24)
727#define TFD_CTL_COUNT_GET(ctl) ((ctl>>24) & 7)
728#define TFD_CTL_PAD_SET(n) (n<<28)
729#define TFD_CTL_PAD_GET(ctl) (ctl>>28)
730
731#define TFD_TX_CMD_SLOTS 256
732#define TFD_CMD_SLOTS 32
733
734#define TFD_MAX_PAYLOAD_SIZE (sizeof(struct iwl_cmd) - \
735 sizeof(struct iwl_cmd_meta))
736
737/*
738 * RX related structures and functions
739 */
740#define RX_FREE_BUFFERS 64
741#define RX_LOW_WATERMARK 8
742
743
67#define IWL_RX_BUF_SIZE (4 * 1024) 744#define IWL_RX_BUF_SIZE (4 * 1024)
68#define IWL_MAX_BSM_SIZE BSM_SRAM_SIZE 745#define IWL_MAX_BSM_SIZE BSM_SRAM_SIZE
69#define KDR_RTC_INST_UPPER_BOUND (0x018000) 746#define KDR_RTC_INST_UPPER_BOUND (0x018000)