diff options
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-eeprom.h')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-eeprom.h | 191 |
1 files changed, 3 insertions, 188 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h index 20b66469d68..0e9d9703636 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * GPL LICENSE SUMMARY | 6 | * GPL LICENSE SUMMARY |
7 | * | 7 | * |
8 | * Copyright(c) 2008 - 2010 Intel Corporation. All rights reserved. | 8 | * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved. |
9 | * | 9 | * |
10 | * This program is free software; you can redistribute it and/or modify | 10 | * This program is free software; you can redistribute it and/or modify |
11 | * it under the terms of version 2 of the GNU General Public License as | 11 | * it under the terms of version 2 of the GNU General Public License as |
@@ -30,7 +30,7 @@ | |||
30 | * | 30 | * |
31 | * BSD LICENSE | 31 | * BSD LICENSE |
32 | * | 32 | * |
33 | * Copyright(c) 2005 - 2010 Intel Corporation. All rights reserved. | 33 | * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved. |
34 | * All rights reserved. | 34 | * All rights reserved. |
35 | * | 35 | * |
36 | * Redistribution and use in source and binary forms, with or without | 36 | * Redistribution and use in source and binary forms, with or without |
@@ -110,10 +110,6 @@ enum { | |||
110 | }; | 110 | }; |
111 | 111 | ||
112 | /* SKU Capabilities */ | 112 | /* SKU Capabilities */ |
113 | /* 3945 only */ | ||
114 | #define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0) | ||
115 | #define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1) | ||
116 | |||
117 | /* 5000 and up */ | 113 | /* 5000 and up */ |
118 | #define EEPROM_SKU_CAP_BAND_POS (4) | 114 | #define EEPROM_SKU_CAP_BAND_POS (4) |
119 | #define EEPROM_SKU_CAP_BAND_SELECTION \ | 115 | #define EEPROM_SKU_CAP_BAND_SELECTION \ |
@@ -168,28 +164,6 @@ struct iwl_eeprom_enhanced_txpwr { | |||
168 | s8 mimo3_max; | 164 | s8 mimo3_max; |
169 | } __packed; | 165 | } __packed; |
170 | 166 | ||
171 | /* 3945 Specific */ | ||
172 | #define EEPROM_3945_EEPROM_VERSION (0x2f) | ||
173 | |||
174 | /* 4965 has two radio transmitters (and 3 radio receivers) */ | ||
175 | #define EEPROM_TX_POWER_TX_CHAINS (2) | ||
176 | |||
177 | /* 4965 has room for up to 8 sets of txpower calibration data */ | ||
178 | #define EEPROM_TX_POWER_BANDS (8) | ||
179 | |||
180 | /* 4965 factory calibration measures txpower gain settings for | ||
181 | * each of 3 target output levels */ | ||
182 | #define EEPROM_TX_POWER_MEASUREMENTS (3) | ||
183 | |||
184 | /* 4965 Specific */ | ||
185 | /* 4965 driver does not work with txpower calibration version < 5 */ | ||
186 | #define EEPROM_4965_TX_POWER_VERSION (5) | ||
187 | #define EEPROM_4965_EEPROM_VERSION (0x2f) | ||
188 | #define EEPROM_4965_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */ | ||
189 | #define EEPROM_4965_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */ | ||
190 | #define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */ | ||
191 | #define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */ | ||
192 | |||
193 | /* 5000 Specific */ | 167 | /* 5000 Specific */ |
194 | #define EEPROM_5000_TX_POWER_VERSION (4) | 168 | #define EEPROM_5000_TX_POWER_VERSION (4) |
195 | #define EEPROM_5000_EEPROM_VERSION (0x11A) | 169 | #define EEPROM_5000_EEPROM_VERSION (0x11A) |
@@ -282,90 +256,6 @@ struct iwl_eeprom_enhanced_txpwr { | |||
282 | /* 2.4 GHz */ | 256 | /* 2.4 GHz */ |
283 | extern const u8 iwl_eeprom_band_1[14]; | 257 | extern const u8 iwl_eeprom_band_1[14]; |
284 | 258 | ||
285 | /* | ||
286 | * factory calibration data for one txpower level, on one channel, | ||
287 | * measured on one of the 2 tx chains (radio transmitter and associated | ||
288 | * antenna). EEPROM contains: | ||
289 | * | ||
290 | * 1) Temperature (degrees Celsius) of device when measurement was made. | ||
291 | * | ||
292 | * 2) Gain table index used to achieve the target measurement power. | ||
293 | * This refers to the "well-known" gain tables (see iwl-4965-hw.h). | ||
294 | * | ||
295 | * 3) Actual measured output power, in half-dBm ("34" = 17 dBm). | ||
296 | * | ||
297 | * 4) RF power amplifier detector level measurement (not used). | ||
298 | */ | ||
299 | struct iwl_eeprom_calib_measure { | ||
300 | u8 temperature; /* Device temperature (Celsius) */ | ||
301 | u8 gain_idx; /* Index into gain table */ | ||
302 | u8 actual_pow; /* Measured RF output power, half-dBm */ | ||
303 | s8 pa_det; /* Power amp detector level (not used) */ | ||
304 | } __packed; | ||
305 | |||
306 | |||
307 | /* | ||
308 | * measurement set for one channel. EEPROM contains: | ||
309 | * | ||
310 | * 1) Channel number measured | ||
311 | * | ||
312 | * 2) Measurements for each of 3 power levels for each of 2 radio transmitters | ||
313 | * (a.k.a. "tx chains") (6 measurements altogether) | ||
314 | */ | ||
315 | struct iwl_eeprom_calib_ch_info { | ||
316 | u8 ch_num; | ||
317 | struct iwl_eeprom_calib_measure | ||
318 | measurements[EEPROM_TX_POWER_TX_CHAINS] | ||
319 | [EEPROM_TX_POWER_MEASUREMENTS]; | ||
320 | } __packed; | ||
321 | |||
322 | /* | ||
323 | * txpower subband info. | ||
324 | * | ||
325 | * For each frequency subband, EEPROM contains the following: | ||
326 | * | ||
327 | * 1) First and last channels within range of the subband. "0" values | ||
328 | * indicate that this sample set is not being used. | ||
329 | * | ||
330 | * 2) Sample measurement sets for 2 channels close to the range endpoints. | ||
331 | */ | ||
332 | struct iwl_eeprom_calib_subband_info { | ||
333 | u8 ch_from; /* channel number of lowest channel in subband */ | ||
334 | u8 ch_to; /* channel number of highest channel in subband */ | ||
335 | struct iwl_eeprom_calib_ch_info ch1; | ||
336 | struct iwl_eeprom_calib_ch_info ch2; | ||
337 | } __packed; | ||
338 | |||
339 | |||
340 | /* | ||
341 | * txpower calibration info. EEPROM contains: | ||
342 | * | ||
343 | * 1) Factory-measured saturation power levels (maximum levels at which | ||
344 | * tx power amplifier can output a signal without too much distortion). | ||
345 | * There is one level for 2.4 GHz band and one for 5 GHz band. These | ||
346 | * values apply to all channels within each of the bands. | ||
347 | * | ||
348 | * 2) Factory-measured power supply voltage level. This is assumed to be | ||
349 | * constant (i.e. same value applies to all channels/bands) while the | ||
350 | * factory measurements are being made. | ||
351 | * | ||
352 | * 3) Up to 8 sets of factory-measured txpower calibration values. | ||
353 | * These are for different frequency ranges, since txpower gain | ||
354 | * characteristics of the analog radio circuitry vary with frequency. | ||
355 | * | ||
356 | * Not all sets need to be filled with data; | ||
357 | * struct iwl_eeprom_calib_subband_info contains range of channels | ||
358 | * (0 if unused) for each set of data. | ||
359 | */ | ||
360 | struct iwl_eeprom_calib_info { | ||
361 | u8 saturation_power24; /* half-dBm (e.g. "34" = 17 dBm) */ | ||
362 | u8 saturation_power52; /* half-dBm */ | ||
363 | __le16 voltage; /* signed */ | ||
364 | struct iwl_eeprom_calib_subband_info | ||
365 | band_info[EEPROM_TX_POWER_BANDS]; | ||
366 | } __packed; | ||
367 | |||
368 | |||
369 | #define ADDRESS_MSK 0x0000FFFF | 259 | #define ADDRESS_MSK 0x0000FFFF |
370 | #define INDIRECT_TYPE_MSK 0x000F0000 | 260 | #define INDIRECT_TYPE_MSK 0x000F0000 |
371 | #define INDIRECT_HOST 0x00010000 | 261 | #define INDIRECT_HOST 0x00010000 |
@@ -398,83 +288,8 @@ struct iwl_eeprom_calib_info { | |||
398 | #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ | 288 | #define EEPROM_RF_CFG_TX_ANT_MSK(x) ((x >> 8) & 0xF) /* bits 8-11 */ |
399 | #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ | 289 | #define EEPROM_RF_CFG_RX_ANT_MSK(x) ((x >> 12) & 0xF) /* bits 12-15 */ |
400 | 290 | ||
401 | #define EEPROM_3945_RF_CFG_TYPE_MAX 0x0 | ||
402 | #define EEPROM_4965_RF_CFG_TYPE_MAX 0x1 | ||
403 | |||
404 | /* Radio Config for 5000 and up */ | ||
405 | #define EEPROM_RF_CONFIG_TYPE_R3x3 0x0 | ||
406 | #define EEPROM_RF_CONFIG_TYPE_R2x2 0x1 | ||
407 | #define EEPROM_RF_CONFIG_TYPE_R1x2 0x2 | ||
408 | #define EEPROM_RF_CONFIG_TYPE_MAX 0x3 | 291 | #define EEPROM_RF_CONFIG_TYPE_MAX 0x3 |
409 | 292 | ||
410 | /* | ||
411 | * Per-channel regulatory data. | ||
412 | * | ||
413 | * Each channel that *might* be supported by iwl has a fixed location | ||
414 | * in EEPROM containing EEPROM_CHANNEL_* usage flags (LSB) and max regulatory | ||
415 | * txpower (MSB). | ||
416 | * | ||
417 | * Entries immediately below are for 20 MHz channel width. HT40 (40 MHz) | ||
418 | * channels (only for 4965, not supported by 3945) appear later in the EEPROM. | ||
419 | * | ||
420 | * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 | ||
421 | */ | ||
422 | #define EEPROM_REGULATORY_SKU_ID (2*0x60) /* 4 bytes */ | ||
423 | #define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */ | ||
424 | #define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */ | ||
425 | |||
426 | /* | ||
427 | * 4.9 GHz channels 183, 184, 185, 187, 188, 189, 192, 196, | ||
428 | * 5.0 GHz channels 7, 8, 11, 12, 16 | ||
429 | * (4915-5080MHz) (none of these is ever supported) | ||
430 | */ | ||
431 | #define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */ | ||
432 | #define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */ | ||
433 | |||
434 | /* | ||
435 | * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 | ||
436 | * (5170-5320MHz) | ||
437 | */ | ||
438 | #define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */ | ||
439 | #define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */ | ||
440 | |||
441 | /* | ||
442 | * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 | ||
443 | * (5500-5700MHz) | ||
444 | */ | ||
445 | #define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */ | ||
446 | #define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */ | ||
447 | |||
448 | /* | ||
449 | * 5.7 GHz channels 145, 149, 153, 157, 161, 165 | ||
450 | * (5725-5825MHz) | ||
451 | */ | ||
452 | #define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */ | ||
453 | #define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */ | ||
454 | |||
455 | /* | ||
456 | * 2.4 GHz HT40 channels 1 (5), 2 (6), 3 (7), 4 (8), 5 (9), 6 (10), 7 (11) | ||
457 | * | ||
458 | * The channel listed is the center of the lower 20 MHz half of the channel. | ||
459 | * The overall center frequency is actually 2 channels (10 MHz) above that, | ||
460 | * and the upper half of each HT40 channel is centered 4 channels (20 MHz) away | ||
461 | * from the lower half; e.g. the upper half of HT40 channel 1 is channel 5, | ||
462 | * and the overall HT40 channel width centers on channel 3. | ||
463 | * | ||
464 | * NOTE: The RXON command uses 20 MHz channel numbers to specify the | ||
465 | * control channel to which to tune. RXON also specifies whether the | ||
466 | * control channel is the upper or lower half of a HT40 channel. | ||
467 | * | ||
468 | * NOTE: 4965 does not support HT40 channels on 2.4 GHz. | ||
469 | */ | ||
470 | #define EEPROM_4965_REGULATORY_BAND_24_HT40_CHANNELS (2*0xA0) /* 14 bytes */ | ||
471 | |||
472 | /* | ||
473 | * 5.2 GHz HT40 channels 36 (40), 44 (48), 52 (56), 60 (64), | ||
474 | * 100 (104), 108 (112), 116 (120), 124 (128), 132 (136), 149 (153), 157 (161) | ||
475 | */ | ||
476 | #define EEPROM_4965_REGULATORY_BAND_52_HT40_CHANNELS (2*0xA8) /* 22 bytes */ | ||
477 | |||
478 | #define EEPROM_REGULATORY_BAND_NO_HT40 (0) | 293 | #define EEPROM_REGULATORY_BAND_NO_HT40 (0) |
479 | 294 | ||
480 | struct iwl_eeprom_ops { | 295 | struct iwl_eeprom_ops { |
@@ -487,7 +302,7 @@ struct iwl_eeprom_ops { | |||
487 | }; | 302 | }; |
488 | 303 | ||
489 | 304 | ||
490 | int iwl_eeprom_init(struct iwl_priv *priv); | 305 | int iwl_eeprom_init(struct iwl_priv *priv, u32 hw_rev); |
491 | void iwl_eeprom_free(struct iwl_priv *priv); | 306 | void iwl_eeprom_free(struct iwl_priv *priv); |
492 | int iwl_eeprom_check_version(struct iwl_priv *priv); | 307 | int iwl_eeprom_check_version(struct iwl_priv *priv); |
493 | int iwl_eeprom_check_sku(struct iwl_priv *priv); | 308 | int iwl_eeprom_check_sku(struct iwl_priv *priv); |