aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-eeprom.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-eeprom.h')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.h58
1 files changed, 17 insertions, 41 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
index 7827566dcc8b..bd0a042ca77f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
@@ -63,7 +63,7 @@
63#ifndef __iwl_eeprom_h__ 63#ifndef __iwl_eeprom_h__
64#define __iwl_eeprom_h__ 64#define __iwl_eeprom_h__
65 65
66struct iwl4965_priv; 66struct iwl_priv;
67 67
68/* 68/*
69 * EEPROM access time values: 69 * EEPROM access time values:
@@ -137,6 +137,8 @@ struct iwl4965_eeprom_channel {
137 * Look for this in calib_version member of struct iwl4965_eeprom. */ 137 * Look for this in calib_version member of struct iwl4965_eeprom. */
138#define EEPROM_TX_POWER_VERSION_NEW (5) 138#define EEPROM_TX_POWER_VERSION_NEW (5)
139 139
140/* 2.4 GHz */
141extern const u8 iwl_eeprom_band_1[14];
140 142
141/* 143/*
142 * 4965 factory calibration data for one txpower level, on one channel, 144 * 4965 factory calibration data for one txpower level, on one channel,
@@ -228,49 +230,31 @@ struct iwl4965_eeprom_calib_info {
228 */ 230 */
229struct iwl4965_eeprom { 231struct iwl4965_eeprom {
230 u8 reserved0[16]; 232 u8 reserved0[16];
231#define EEPROM_DEVICE_ID (2*0x08) /* 2 bytes */
232 u16 device_id; /* abs.ofs: 16 */ 233 u16 device_id; /* abs.ofs: 16 */
233 u8 reserved1[2]; 234 u8 reserved1[2];
234#define EEPROM_PMC (2*0x0A) /* 2 bytes */
235 u16 pmc; /* abs.ofs: 20 */ 235 u16 pmc; /* abs.ofs: 20 */
236 u8 reserved2[20]; 236 u8 reserved2[20];
237#define EEPROM_MAC_ADDRESS (2*0x15) /* 6 bytes */
238 u8 mac_address[6]; /* abs.ofs: 42 */ 237 u8 mac_address[6]; /* abs.ofs: 42 */
239 u8 reserved3[58]; 238 u8 reserved3[58];
240#define EEPROM_BOARD_REVISION (2*0x35) /* 2 bytes */
241 u16 board_revision; /* abs.ofs: 106 */ 239 u16 board_revision; /* abs.ofs: 106 */
242 u8 reserved4[11]; 240 u8 reserved4[11];
243#define EEPROM_BOARD_PBA_NUMBER (2*0x3B+1) /* 9 bytes */
244 u8 board_pba_number[9]; /* abs.ofs: 119 */ 241 u8 board_pba_number[9]; /* abs.ofs: 119 */
245 u8 reserved5[8]; 242 u8 reserved5[8];
246#define EEPROM_VERSION (2*0x44) /* 2 bytes */
247 u16 version; /* abs.ofs: 136 */ 243 u16 version; /* abs.ofs: 136 */
248#define EEPROM_SKU_CAP (2*0x45) /* 1 bytes */
249 u8 sku_cap; /* abs.ofs: 138 */ 244 u8 sku_cap; /* abs.ofs: 138 */
250#define EEPROM_LEDS_MODE (2*0x45+1) /* 1 bytes */
251 u8 leds_mode; /* abs.ofs: 139 */ 245 u8 leds_mode; /* abs.ofs: 139 */
252#define EEPROM_OEM_MODE (2*0x46) /* 2 bytes */
253 u16 oem_mode; 246 u16 oem_mode;
254#define EEPROM_WOWLAN_MODE (2*0x47) /* 2 bytes */
255 u16 wowlan_mode; /* abs.ofs: 142 */ 247 u16 wowlan_mode; /* abs.ofs: 142 */
256#define EEPROM_LEDS_TIME_INTERVAL (2*0x48) /* 2 bytes */
257 u16 leds_time_interval; /* abs.ofs: 144 */ 248 u16 leds_time_interval; /* abs.ofs: 144 */
258#define EEPROM_LEDS_OFF_TIME (2*0x49) /* 1 bytes */
259 u8 leds_off_time; /* abs.ofs: 146 */ 249 u8 leds_off_time; /* abs.ofs: 146 */
260#define EEPROM_LEDS_ON_TIME (2*0x49+1) /* 1 bytes */
261 u8 leds_on_time; /* abs.ofs: 147 */ 250 u8 leds_on_time; /* abs.ofs: 147 */
262#define EEPROM_ALMGOR_M_VERSION (2*0x4A) /* 1 bytes */
263 u8 almgor_m_version; /* abs.ofs: 148 */ 251 u8 almgor_m_version; /* abs.ofs: 148 */
264#define EEPROM_ANTENNA_SWITCH_TYPE (2*0x4A+1) /* 1 bytes */
265 u8 antenna_switch_type; /* abs.ofs: 149 */ 252 u8 antenna_switch_type; /* abs.ofs: 149 */
266 u8 reserved6[8]; 253 u8 reserved6[8];
267#define EEPROM_4965_BOARD_REVISION (2*0x4F) /* 2 bytes */
268 u16 board_revision_4965; /* abs.ofs: 158 */ 254 u16 board_revision_4965; /* abs.ofs: 158 */
269 u8 reserved7[13]; 255 u8 reserved7[13];
270#define EEPROM_4965_BOARD_PBA (2*0x56+1) /* 9 bytes */
271 u8 board_pba_number_4965[9]; /* abs.ofs: 173 */ 256 u8 board_pba_number_4965[9]; /* abs.ofs: 173 */
272 u8 reserved8[10]; 257 u8 reserved8[10];
273#define EEPROM_REGULATORY_SKU_ID (2*0x60) /* 4 bytes */
274 u8 sku_id[4]; /* abs.ofs: 192 */ 258 u8 sku_id[4]; /* abs.ofs: 192 */
275 259
276/* 260/*
@@ -285,9 +269,7 @@ struct iwl4965_eeprom {
285 * 269 *
286 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 270 * 2.4 GHz channels 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14
287 */ 271 */
288#define EEPROM_REGULATORY_BAND_1 (2*0x62) /* 2 bytes */
289 u16 band_1_count; /* abs.ofs: 196 */ 272 u16 band_1_count; /* abs.ofs: 196 */
290#define EEPROM_REGULATORY_BAND_1_CHANNELS (2*0x63) /* 28 bytes */
291 struct iwl4965_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */ 273 struct iwl4965_eeprom_channel band_1_channels[14]; /* abs.ofs: 196 */
292 274
293/* 275/*
@@ -295,36 +277,28 @@ struct iwl4965_eeprom {
295 * 5.0 GHz channels 7, 8, 11, 12, 16 277 * 5.0 GHz channels 7, 8, 11, 12, 16
296 * (4915-5080MHz) (none of these is ever supported) 278 * (4915-5080MHz) (none of these is ever supported)
297 */ 279 */
298#define EEPROM_REGULATORY_BAND_2 (2*0x71) /* 2 bytes */
299 u16 band_2_count; /* abs.ofs: 226 */ 280 u16 band_2_count; /* abs.ofs: 226 */
300#define EEPROM_REGULATORY_BAND_2_CHANNELS (2*0x72) /* 26 bytes */
301 struct iwl4965_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */ 281 struct iwl4965_eeprom_channel band_2_channels[13]; /* abs.ofs: 228 */
302 282
303/* 283/*
304 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64 284 * 5.2 GHz channels 34, 36, 38, 40, 42, 44, 46, 48, 52, 56, 60, 64
305 * (5170-5320MHz) 285 * (5170-5320MHz)
306 */ 286 */
307#define EEPROM_REGULATORY_BAND_3 (2*0x7F) /* 2 bytes */
308 u16 band_3_count; /* abs.ofs: 254 */ 287 u16 band_3_count; /* abs.ofs: 254 */
309#define EEPROM_REGULATORY_BAND_3_CHANNELS (2*0x80) /* 24 bytes */
310 struct iwl4965_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */ 288 struct iwl4965_eeprom_channel band_3_channels[12]; /* abs.ofs: 256 */
311 289
312/* 290/*
313 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 291 * 5.5 GHz channels 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
314 * (5500-5700MHz) 292 * (5500-5700MHz)
315 */ 293 */
316#define EEPROM_REGULATORY_BAND_4 (2*0x8C) /* 2 bytes */
317 u16 band_4_count; /* abs.ofs: 280 */ 294 u16 band_4_count; /* abs.ofs: 280 */
318#define EEPROM_REGULATORY_BAND_4_CHANNELS (2*0x8D) /* 22 bytes */
319 struct iwl4965_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */ 295 struct iwl4965_eeprom_channel band_4_channels[11]; /* abs.ofs: 282 */
320 296
321/* 297/*
322 * 5.7 GHz channels 145, 149, 153, 157, 161, 165 298 * 5.7 GHz channels 145, 149, 153, 157, 161, 165
323 * (5725-5825MHz) 299 * (5725-5825MHz)
324 */ 300 */
325#define EEPROM_REGULATORY_BAND_5 (2*0x98) /* 2 bytes */
326 u16 band_5_count; /* abs.ofs: 304 */ 301 u16 band_5_count; /* abs.ofs: 304 */
327#define EEPROM_REGULATORY_BAND_5_CHANNELS (2*0x99) /* 12 bytes */
328 struct iwl4965_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */ 302 struct iwl4965_eeprom_channel band_5_channels[6]; /* abs.ofs: 306 */
329 303
330 u8 reserved10[2]; 304 u8 reserved10[2];
@@ -345,7 +319,6 @@ struct iwl4965_eeprom {
345 * 319 *
346 * NOTE: 4965 does not support FAT channels on 2.4 GHz. 320 * NOTE: 4965 does not support FAT channels on 2.4 GHz.
347 */ 321 */
348#define EEPROM_REGULATORY_BAND_24_FAT_CHANNELS (2*0xA0) /* 14 bytes */
349 struct iwl4965_eeprom_channel band_24_channels[7]; /* abs.ofs: 320 */ 322 struct iwl4965_eeprom_channel band_24_channels[7]; /* abs.ofs: 320 */
350 u8 reserved11[2]; 323 u8 reserved11[2];
351 324
@@ -353,7 +326,6 @@ struct iwl4965_eeprom {
353 * 5.2 GHz FAT channels 36 (40), 44 (48), 52 (56), 60 (64), 326 * 5.2 GHz FAT channels 36 (40), 44 (48), 52 (56), 60 (64),
354 * 100 (104), 108 (112), 116 (120), 124 (128), 132 (136), 149 (153), 157 (161) 327 * 100 (104), 108 (112), 116 (120), 124 (128), 132 (136), 149 (153), 157 (161)
355 */ 328 */
356#define EEPROM_REGULATORY_BAND_52_FAT_CHANNELS (2*0xA8) /* 22 bytes */
357 struct iwl4965_eeprom_channel band_52_channels[11]; /* abs.ofs: 336 */ 329 struct iwl4965_eeprom_channel band_52_channels[11]; /* abs.ofs: 336 */
358 u8 reserved12[6]; 330 u8 reserved12[6];
359 331
@@ -362,7 +334,6 @@ struct iwl4965_eeprom {
362 * Driver does not work with txpower calibration version < 5. 334 * Driver does not work with txpower calibration version < 5.
363 * This value is simply a 16-bit number, no major/minor versions here. 335 * This value is simply a 16-bit number, no major/minor versions here.
364 */ 336 */
365#define EEPROM_CALIB_VERSION_OFFSET (2*0xB6) /* 2 bytes */
366 u16 calib_version; /* abs.ofs: 364 */ 337 u16 calib_version; /* abs.ofs: 364 */
367 u8 reserved13[2]; 338 u8 reserved13[2];
368 u8 reserved14[96]; /* abs.ofs: 368 */ 339 u8 reserved14[96]; /* abs.ofs: 368 */
@@ -370,7 +341,6 @@ struct iwl4965_eeprom {
370/* 341/*
371 * 4965 Txpower calibration data. 342 * 4965 Txpower calibration data.
372 */ 343 */
373#define EEPROM_IWL_CALIB_TXPOWER_OFFSET (2*0xE8) /* 48 bytes */
374 struct iwl4965_eeprom_calib_info calib_info; /* abs.ofs: 464 */ 344 struct iwl4965_eeprom_calib_info calib_info; /* abs.ofs: 464 */
375 345
376 u8 reserved16[140]; /* fill out to full 1024 byte block */ 346 u8 reserved16[140]; /* fill out to full 1024 byte block */
@@ -383,17 +353,23 @@ struct iwl4965_eeprom {
383/* End of EEPROM */ 353/* End of EEPROM */
384 354
385struct iwl_eeprom_ops { 355struct iwl_eeprom_ops {
386 int (*verify_signature) (struct iwl4965_priv *priv); 356 int (*verify_signature) (struct iwl_priv *priv);
387 int (*acquire_semaphore) (struct iwl4965_priv *priv); 357 int (*acquire_semaphore) (struct iwl_priv *priv);
388 void (*release_semaphore) (struct iwl4965_priv *priv); 358 void (*release_semaphore) (struct iwl_priv *priv);
389}; 359};
390 360
391 361
392void iwl_eeprom_get_mac(const struct iwl4965_priv *priv, u8 *mac); 362void iwl_eeprom_get_mac(const struct iwl_priv *priv, u8 *mac);
393int iwl_eeprom_init(struct iwl4965_priv *priv); 363int iwl_eeprom_init(struct iwl_priv *priv);
394 364
395int iwlcore_eeprom_verify_signature(struct iwl4965_priv *priv); 365int iwlcore_eeprom_verify_signature(struct iwl_priv *priv);
396int iwlcore_eeprom_acquire_semaphore(struct iwl4965_priv *priv); 366int iwlcore_eeprom_acquire_semaphore(struct iwl_priv *priv);
397void iwlcore_eeprom_release_semaphore(struct iwl4965_priv *priv); 367void iwlcore_eeprom_release_semaphore(struct iwl_priv *priv);
368
369int iwl_init_channel_map(struct iwl_priv *priv);
370void iwl_free_channel_map(struct iwl_priv *priv);
371const struct iwl_channel_info *iwl_get_channel_info(
372 const struct iwl_priv *priv,
373 enum ieee80211_band band, u16 channel);
398 374
399#endif /* __iwl_eeprom_h__ */ 375#endif /* __iwl_eeprom_h__ */