Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
iwl-eeprom-parse.c File Reference
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/export.h>
#include "iwl-modparams.h"
#include "iwl-eeprom-parse.h"

Go to the source code of this file.

Data Structures

struct  iwl_eeprom_calib_hdr
 
struct  iwl_eeprom_channel
 
struct  iwl_eeprom_enhanced_txpwr
 

Macros

#define ADDRESS_MSK   0x0000FFFF
 
#define INDIRECT_TYPE_MSK   0x000F0000
 
#define INDIRECT_HOST   0x00010000
 
#define INDIRECT_GENERAL   0x00020000
 
#define INDIRECT_REGULATORY   0x00030000
 
#define INDIRECT_CALIBRATION   0x00040000
 
#define INDIRECT_PROCESS_ADJST   0x00050000
 
#define INDIRECT_OTHERS   0x00060000
 
#define INDIRECT_TXP_LIMIT   0x00070000
 
#define INDIRECT_TXP_LIMIT_SIZE   0x00080000
 
#define INDIRECT_ADDRESS   0x00100000
 
#define EEPROM_LINK_HOST   (2*0x64)
 
#define EEPROM_LINK_GENERAL   (2*0x65)
 
#define EEPROM_LINK_REGULATORY   (2*0x66)
 
#define EEPROM_LINK_CALIBRATION   (2*0x67)
 
#define EEPROM_LINK_PROCESS_ADJST   (2*0x68)
 
#define EEPROM_LINK_OTHERS   (2*0x69)
 
#define EEPROM_LINK_TXP_LIMIT   (2*0x6a)
 
#define EEPROM_LINK_TXP_LIMIT_SIZE   (2*0x6b)
 
#define EEPROM_DEVICE_ID   (2*0x08) /* 2 bytes */
 
#define EEPROM_SUBSYSTEM_ID   (2*0x0A) /* 2 bytes */
 
#define EEPROM_MAC_ADDRESS   (2*0x15) /* 6 bytes */
 
#define EEPROM_BOARD_REVISION   (2*0x35) /* 2 bytes */
 
#define EEPROM_BOARD_PBA_NUMBER   (2*0x3B+1) /* 9 bytes */
 
#define EEPROM_VERSION   (2*0x44) /* 2 bytes */
 
#define EEPROM_SKU_CAP   (2*0x45) /* 2 bytes */
 
#define EEPROM_OEM_MODE   (2*0x46) /* 2 bytes */
 
#define EEPROM_RADIO_CONFIG   (2*0x48) /* 2 bytes */
 
#define EEPROM_NUM_MAC_ADDRESS   (2*0x4C) /* 2 bytes */
 
#define EEPROM_CALIB_ALL   (INDIRECT_ADDRESS | INDIRECT_CALIBRATION)
 
#define EEPROM_XTAL   ((2*0x128) | EEPROM_CALIB_ALL)
 
#define EEPROM_KELVIN_TEMPERATURE   ((2*0x12A) | EEPROM_CALIB_ALL)
 
#define EEPROM_RAW_TEMPERATURE   ((2*0x12B) | EEPROM_CALIB_ALL)
 
#define IWL_NUM_CHANNELS
 
#define RATES_24_OFFS   0
 
#define N_RATES_24   ARRAY_SIZE(iwl_cfg80211_rates)
 
#define RATES_52_OFFS   4
 
#define N_RATES_52   (N_RATES_24 - RATES_52_OFFS)
 
#define EEPROM_TXP_OFFS   (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT)
 
#define EEPROM_TXP_ENTRY_LEN   sizeof(struct iwl_eeprom_enhanced_txpwr)
 
#define EEPROM_TXP_SZ_OFFS   (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE)
 
#define TXP_CHECK_AND_PRINT(x)   ((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) ? # x " " : "")
 
#define CHECK_AND_PRINT(x)   ((eeprom_ch->flags & EEPROM_CHANNEL_##x) ? # x " " : "")
 
#define CHECK_AND_PRINT_I(x)   ((eeprom_ch_info[ch_idx].flags & EEPROM_CHANNEL_##x) ? # x " " : "")
 
#define MAX_BIT_RATE_40_MHZ   150 /* Mbps */
 
#define MAX_BIT_RATE_20_MHZ   72 /* Mbps */
 

Enumerations

enum  iwl_eeprom_channel_flags {
  EEPROM_CHANNEL_VALID = BIT(0), EEPROM_CHANNEL_IBSS = BIT(1), EEPROM_CHANNEL_ACTIVE = BIT(3), EEPROM_CHANNEL_RADAR = BIT(4),
  EEPROM_CHANNEL_WIDE = BIT(5), EEPROM_CHANNEL_DFS = BIT(7)
}
 
enum  iwl_eeprom_enhanced_txpwr_flags {
  IWL_EEPROM_ENH_TXP_FL_VALID = BIT(0), IWL_EEPROM_ENH_TXP_FL_BAND_52G = BIT(1), IWL_EEPROM_ENH_TXP_FL_OFDM = BIT(2), IWL_EEPROM_ENH_TXP_FL_40MHZ = BIT(3),
  IWL_EEPROM_ENH_TXP_FL_HT_AP = BIT(4), IWL_EEPROM_ENH_TXP_FL_RES1 = BIT(5), IWL_EEPROM_ENH_TXP_FL_RES2 = BIT(6), IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE = BIT(7)
}
 

Functions

struct iwl_eeprom_dataiwl_parse_eeprom_data (struct device *dev, const struct iwl_cfg *cfg, const u8 *eeprom, size_t eeprom_size)
 
 EXPORT_SYMBOL_GPL (iwl_parse_eeprom_data)
 
int iwl_eeprom_check_version (struct iwl_eeprom_data *data, struct iwl_trans *trans)
 
 EXPORT_SYMBOL_GPL (iwl_eeprom_check_version)
 

Variables

struct iwl_eeprom_calib_hdr __packed
 

Macro Definition Documentation

#define ADDRESS_MSK   0x0000FFFF

Definition at line 71 of file iwl-eeprom-parse.c.

#define CHECK_AND_PRINT (   x)    ((eeprom_ch->flags & EEPROM_CHANNEL_##x) ? # x " " : "")

Definition at line 503 of file iwl-eeprom-parse.c.

#define CHECK_AND_PRINT_I (   x)    ((eeprom_ch_info[ch_idx].flags & EEPROM_CHANNEL_##x) ? # x " " : "")

Definition at line 546 of file iwl-eeprom-parse.c.

#define EEPROM_BOARD_PBA_NUMBER   (2*0x3B+1) /* 9 bytes */

Definition at line 98 of file iwl-eeprom-parse.c.

#define EEPROM_BOARD_REVISION   (2*0x35) /* 2 bytes */

Definition at line 97 of file iwl-eeprom-parse.c.

#define EEPROM_CALIB_ALL   (INDIRECT_ADDRESS | INDIRECT_CALIBRATION)

Definition at line 112 of file iwl-eeprom-parse.c.

#define EEPROM_DEVICE_ID   (2*0x08) /* 2 bytes */

Definition at line 94 of file iwl-eeprom-parse.c.

#define EEPROM_KELVIN_TEMPERATURE   ((2*0x12A) | EEPROM_CALIB_ALL)

Definition at line 116 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_CALIBRATION   (2*0x67)

Definition at line 87 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_GENERAL   (2*0x65)

Definition at line 85 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_HOST   (2*0x64)

Definition at line 84 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_OTHERS   (2*0x69)

Definition at line 89 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_PROCESS_ADJST   (2*0x68)

Definition at line 88 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_REGULATORY   (2*0x66)

Definition at line 86 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_TXP_LIMIT   (2*0x6a)

Definition at line 90 of file iwl-eeprom-parse.c.

#define EEPROM_LINK_TXP_LIMIT_SIZE   (2*0x6b)

Definition at line 91 of file iwl-eeprom-parse.c.

#define EEPROM_MAC_ADDRESS   (2*0x15) /* 6 bytes */

Definition at line 96 of file iwl-eeprom-parse.c.

#define EEPROM_NUM_MAC_ADDRESS   (2*0x4C) /* 2 bytes */

Definition at line 103 of file iwl-eeprom-parse.c.

#define EEPROM_OEM_MODE   (2*0x46) /* 2 bytes */

Definition at line 101 of file iwl-eeprom-parse.c.

#define EEPROM_RADIO_CONFIG   (2*0x48) /* 2 bytes */

Definition at line 102 of file iwl-eeprom-parse.c.

#define EEPROM_RAW_TEMPERATURE   ((2*0x12B) | EEPROM_CALIB_ALL)

Definition at line 117 of file iwl-eeprom-parse.c.

#define EEPROM_SKU_CAP   (2*0x45) /* 2 bytes */

Definition at line 100 of file iwl-eeprom-parse.c.

#define EEPROM_SUBSYSTEM_ID   (2*0x0A) /* 2 bytes */

Definition at line 95 of file iwl-eeprom-parse.c.

#define EEPROM_TXP_ENTRY_LEN   sizeof(struct iwl_eeprom_enhanced_txpwr)

Definition at line 360 of file iwl-eeprom-parse.c.

#define EEPROM_TXP_OFFS   (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT)

Definition at line 359 of file iwl-eeprom-parse.c.

#define EEPROM_TXP_SZ_OFFS   (0x00 | INDIRECT_ADDRESS | INDIRECT_TXP_LIMIT_SIZE)

Definition at line 361 of file iwl-eeprom-parse.c.

#define EEPROM_VERSION   (2*0x44) /* 2 bytes */

Definition at line 99 of file iwl-eeprom-parse.c.

#define EEPROM_XTAL   ((2*0x128) | EEPROM_CALIB_ALL)

Definition at line 113 of file iwl-eeprom-parse.c.

#define INDIRECT_ADDRESS   0x00100000

Definition at line 81 of file iwl-eeprom-parse.c.

#define INDIRECT_CALIBRATION   0x00040000

Definition at line 76 of file iwl-eeprom-parse.c.

#define INDIRECT_GENERAL   0x00020000

Definition at line 74 of file iwl-eeprom-parse.c.

#define INDIRECT_HOST   0x00010000

Definition at line 73 of file iwl-eeprom-parse.c.

#define INDIRECT_OTHERS   0x00060000

Definition at line 78 of file iwl-eeprom-parse.c.

#define INDIRECT_PROCESS_ADJST   0x00050000

Definition at line 77 of file iwl-eeprom-parse.c.

#define INDIRECT_REGULATORY   0x00030000

Definition at line 75 of file iwl-eeprom-parse.c.

#define INDIRECT_TXP_LIMIT   0x00070000

Definition at line 79 of file iwl-eeprom-parse.c.

#define INDIRECT_TXP_LIMIT_SIZE   0x00080000

Definition at line 80 of file iwl-eeprom-parse.c.

#define INDIRECT_TYPE_MSK   0x000F0000

Definition at line 72 of file iwl-eeprom-parse.c.

#define IWL_NUM_CHANNELS
Value:
(ARRAY_SIZE(iwl_eeprom_band_1) + \
ARRAY_SIZE(iwl_eeprom_band_2) + \
ARRAY_SIZE(iwl_eeprom_band_3) + \
ARRAY_SIZE(iwl_eeprom_band_4) + \
ARRAY_SIZE(iwl_eeprom_band_5))

Definition at line 154 of file iwl-eeprom-parse.c.

#define MAX_BIT_RATE_20_MHZ   72 /* Mbps */

Definition at line 711 of file iwl-eeprom-parse.c.

#define MAX_BIT_RATE_40_MHZ   150 /* Mbps */

Definition at line 710 of file iwl-eeprom-parse.c.

#define N_RATES_24   ARRAY_SIZE(iwl_cfg80211_rates)

Definition at line 179 of file iwl-eeprom-parse.c.

#define N_RATES_52   (N_RATES_24 - RATES_52_OFFS)

Definition at line 181 of file iwl-eeprom-parse.c.

#define RATES_24_OFFS   0

Definition at line 178 of file iwl-eeprom-parse.c.

#define RATES_52_OFFS   4

Definition at line 180 of file iwl-eeprom-parse.c.

#define TXP_CHECK_AND_PRINT (   x)    ((txp->flags & IWL_EEPROM_ENH_TXP_FL_##x) ? # x " " : "")

Definition at line 363 of file iwl-eeprom-parse.c.

Enumeration Type Documentation

enum iwl_eeprom_channel_flags - channel flags in EEPROM : channel is usable for this SKU/geo : usable as an IBSS channel : active scanning allowed : radar detection required : 20 MHz channel okay (?) : dynamic freq selection candidate

Enumerator:
EEPROM_CHANNEL_VALID 
EEPROM_CHANNEL_IBSS 
EEPROM_CHANNEL_ACTIVE 
EEPROM_CHANNEL_RADAR 
EEPROM_CHANNEL_WIDE 
EEPROM_CHANNEL_DFS 

Definition at line 277 of file iwl-eeprom-parse.c.

Enumerator:
IWL_EEPROM_ENH_TXP_FL_VALID 
IWL_EEPROM_ENH_TXP_FL_BAND_52G 
IWL_EEPROM_ENH_TXP_FL_OFDM 
IWL_EEPROM_ENH_TXP_FL_40MHZ 
IWL_EEPROM_ENH_TXP_FL_HT_AP 
IWL_EEPROM_ENH_TXP_FL_RES1 
IWL_EEPROM_ENH_TXP_FL_RES2 
IWL_EEPROM_ENH_TXP_FL_COMMON_TYPE 

Definition at line 297 of file iwl-eeprom-parse.c.

Function Documentation

EXPORT_SYMBOL_GPL ( iwl_parse_eeprom_data  )
EXPORT_SYMBOL_GPL ( iwl_eeprom_check_version  )
int iwl_eeprom_check_version ( struct iwl_eeprom_data data,
struct iwl_trans trans 
)

Definition at line 887 of file iwl-eeprom-parse.c.

struct iwl_eeprom_data* iwl_parse_eeprom_data ( struct device dev,
const struct iwl_cfg cfg,
const u8 eeprom,
size_t  eeprom_size 
)
read

iwl_parse_eeprom_data - parse EEPROM data and return values

: device pointer we're parsing for, for debug only : device configuration for parsing and overrides : the EEPROM data : length of the EEPROM data

This function parses all EEPROM values we need and then returns a (newly allocated) struct containing all the relevant values for driver use. The struct must be freed later with iwl_free_eeprom_data().

Definition at line 808 of file iwl-eeprom-parse.c.

Variable Documentation