aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-hw.h59
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.h4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c4
3 files changed, 11 insertions, 56 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
index 21719eb7e144..b6145b0b9255 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-hw.h
@@ -69,6 +69,8 @@
69#ifndef __iwl_3945_hw__ 69#ifndef __iwl_3945_hw__
70#define __iwl_3945_hw__ 70#define __iwl_3945_hw__
71 71
72#include "iwl-eeprom.h"
73
72/* 74/*
73 * uCode queue management definitions ... 75 * uCode queue management definitions ...
74 * Queue #4 is the command queue for 3945 and 4965. 76 * Queue #4 is the command queue for 3945 and 4965.
@@ -85,55 +87,8 @@
85/* 87/*
86 * EEPROM related constants, enums, and structures. 88 * EEPROM related constants, enums, and structures.
87 */ 89 */
88
89/*
90 * EEPROM access time values:
91 *
92 * Driver initiates EEPROM read by writing byte address << 1 to CSR_EEPROM_REG,
93 * then clearing (with subsequent read/modify/write) CSR_EEPROM_REG bit
94 * CSR_EEPROM_REG_BIT_CMD (0x2).
95 * Driver then polls CSR_EEPROM_REG for CSR_EEPROM_REG_READ_VALID_MSK (0x1).
96 * When polling, wait 10 uSec between polling loops, up to a maximum 5000 uSec.
97 * Driver reads 16-bit value from bits 31-16 of CSR_EEPROM_REG.
98 */
99#define IWL_EEPROM_ACCESS_TIMEOUT 5000 /* uSec */
100
101/*
102 * Regulatory channel usage flags in EEPROM struct iwl_eeprom_channel.flags.
103 *
104 * IBSS and/or AP operation is allowed *only* on those channels with
105 * (VALID && IBSS && ACTIVE && !RADAR). This restriction is in place because
106 * RADAR detection is not supported by the 3945 driver, but is a
107 * requirement for establishing a new network for legal operation on channels
108 * requiring RADAR detection or restricting ACTIVE scanning.
109 *
110 * NOTE: "WIDE" flag indicates that 20 MHz channel is supported;
111 * 3945 does not support FAT 40 MHz-wide channels.
112 *
113 * NOTE: Using a channel inappropriately will result in a uCode error!
114 */
115enum {
116 EEPROM_CHANNEL_VALID = (1 << 0), /* usable for this SKU/geo */
117 EEPROM_CHANNEL_IBSS = (1 << 1), /* usable as an IBSS channel */
118 /* Bit 2 Reserved */
119 EEPROM_CHANNEL_ACTIVE = (1 << 3), /* active scanning allowed */
120 EEPROM_CHANNEL_RADAR = (1 << 4), /* radar detection required */
121 EEPROM_CHANNEL_WIDE = (1 << 5), /* 20 MHz channel okay */
122 /* Bit 6 Reserved (was Narrow Channel) */
123 EEPROM_CHANNEL_DFS = (1 << 7), /* dynamic freq selection candidate */
124};
125
126/* SKU Capabilities */
127#define EEPROM_SKU_CAP_SW_RF_KILL_ENABLE (1 << 0)
128#define EEPROM_SKU_CAP_HW_RF_KILL_ENABLE (1 << 1)
129#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7) 90#define EEPROM_SKU_CAP_OP_MODE_MRC (1 << 7)
130 91
131/* *regulatory* channel data from eeprom, one for each channel */
132struct iwl3945_eeprom_channel {
133 u8 flags; /* flags copied from EEPROM */
134 s8 max_power_avg; /* max power (dBm) on this chnl, limit 31 */
135} __attribute__ ((packed));
136
137/* 92/*
138 * Mapping of a Tx power level, at factory calibration temperature, 93 * Mapping of a Tx power level, at factory calibration temperature,
139 * to a radio/DSP gain table index. 94 * to a radio/DSP gain table index.
@@ -227,7 +182,7 @@ struct iwl3945_eeprom {
227 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 182 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
228 */ 183 */
229 u16 band_1_count; /* abs.ofs: 196 */ 184 u16 band_1_count; /* abs.ofs: 196 */
230 struct iwl3945_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */ 185 struct iwl_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
231 186
232/* 187/*
233 * 4.9 GHz channels 183, 184, 185, 187, 188, 189, 192, 196, 188 * 4.9 GHz channels 183, 184, 185, 187, 188, 189, 192, 196,
@@ -235,28 +190,28 @@ struct iwl3945_eeprom {
235 * (4915-5080MHz) (none of these is ever supported) 190 * (4915-5080MHz) (none of these is ever supported)
236 */ 191 */
237 u16 band_2_count; /* abs.ofs: 226 */ 192 u16 band_2_count; /* abs.ofs: 226 */
238 struct iwl3945_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */ 193 struct iwl_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
239 194
240/* 195/*
241 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 196 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
242 * (5170-5320MHz) 197 * (5170-5320MHz)
243 */ 198 */
244 u16 band_3_count; /* abs.ofs: 254 */ 199 u16 band_3_count; /* abs.ofs: 254 */
245 struct iwl3945_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */ 200 struct iwl_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
246 201
247/* 202/*
248 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 203 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
249 * (5500-5700MHz) 204 * (5500-5700MHz)
250 */ 205 */
251 u16 band_4_count; /* abs.ofs: 280 */ 206 u16 band_4_count; /* abs.ofs: 280 */
252 struct iwl3945_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */ 207 struct iwl_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
253 208
254/* 209/*
255 * 5.7 GHz channels 145, 149, 153, 157, 161, 165 210 * 5.7 GHz channels 145, 149, 153, 157, 161, 165
256 * (5725-5825MHz) 211 * (5725-5825MHz)
257 */ 212 */
258 u16 band_5_count; /* abs.ofs: 304 */ 213 u16 band_5_count; /* abs.ofs: 304 */
259 struct iwl3945_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */ 214 struct iwl_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
260 215
261 u8 reserved9[194]; 216 u8 reserved9[194];
262 217
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.h b/drivers/net/wireless/iwlwifi/iwl-3945.h
index 7e9ba5449c56..3295244caf40 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.h
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.h
@@ -203,8 +203,8 @@ struct iwl3945_scan_power_info {
203struct iwl3945_channel_info { 203struct iwl3945_channel_info {
204 struct iwl3945_channel_tgd_info tgd; 204 struct iwl3945_channel_tgd_info tgd;
205 struct iwl3945_channel_tgh_info tgh; 205 struct iwl3945_channel_tgh_info tgh;
206 struct iwl3945_eeprom_channel eeprom; /* EEPROM regulatory limit */ 206 struct iwl_eeprom_channel eeprom; /* EEPROM regulatory limit */
207 struct iwl3945_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for 207 struct iwl_eeprom_channel fat_eeprom; /* EEPROM regulatory limit for
208 * FAT channel */ 208 * FAT channel */
209 209
210 u8 channel; /* channel number */ 210 u8 channel; /* channel number */
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index c2e0152108d3..b42354fda2c5 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -4483,7 +4483,7 @@ static const u8 iwl3945_eeprom_band_5[] = { /* 5725-5825MHz */
4483 4483
4484static void iwl3945_init_band_reference(const struct iwl3945_priv *priv, int band, 4484static void iwl3945_init_band_reference(const struct iwl3945_priv *priv, int band,
4485 int *eeprom_ch_count, 4485 int *eeprom_ch_count,
4486 const struct iwl3945_eeprom_channel 4486 const struct iwl_eeprom_channel
4487 **eeprom_ch_info, 4487 **eeprom_ch_info,
4488 const u8 **eeprom_ch_index) 4488 const u8 **eeprom_ch_index)
4489{ 4489{
@@ -4558,7 +4558,7 @@ static int iwl3945_init_channel_map(struct iwl3945_priv *priv)
4558{ 4558{
4559 int eeprom_ch_count = 0; 4559 int eeprom_ch_count = 0;
4560 const u8 *eeprom_ch_index = NULL; 4560 const u8 *eeprom_ch_index = NULL;
4561 const struct iwl3945_eeprom_channel *eeprom_ch_info = NULL; 4561 const struct iwl_eeprom_channel *eeprom_ch_info = NULL;
4562 int band, ch; 4562 int band, ch;
4563 struct iwl3945_channel_info *ch_info; 4563 struct iwl3945_channel_info *ch_info;
4564 4564