#include <linux/types.h>
#include <linux/slab.h>
#include <linux/export.h>
#include "iwl-drv.h"
#include "iwl-debug.h"
#include "iwl-io.h"
#include "iwl-prph.h"
#include "iwl-csr.h"
#include "agn.h"
#define ADDRESS_MSK …
#define INDIRECT_TYPE_MSK …
#define INDIRECT_HOST …
#define INDIRECT_GENERAL …
#define INDIRECT_REGULATORY …
#define INDIRECT_CALIBRATION …
#define INDIRECT_PROCESS_ADJST …
#define INDIRECT_OTHERS …
#define INDIRECT_TXP_LIMIT …
#define INDIRECT_TXP_LIMIT_SIZE …
#define INDIRECT_ADDRESS …
#define EEPROM_LINK_HOST …
#define EEPROM_LINK_GENERAL …
#define EEPROM_LINK_REGULATORY …
#define EEPROM_LINK_CALIBRATION …
#define EEPROM_LINK_PROCESS_ADJST …
#define EEPROM_LINK_OTHERS …
#define EEPROM_LINK_TXP_LIMIT …
#define EEPROM_LINK_TXP_LIMIT_SIZE …
#define EEPROM_DEVICE_ID …
#define EEPROM_SUBSYSTEM_ID …
#define EEPROM_MAC_ADDRESS …
#define EEPROM_BOARD_REVISION …
#define EEPROM_BOARD_PBA_NUMBER …
#define EEPROM_VERSION …
#define EEPROM_SKU_CAP …
#define EEPROM_OEM_MODE …
#define EEPROM_RADIO_CONFIG …
#define EEPROM_NUM_MAC_ADDRESS …
struct iwl_eeprom_calib_hdr { … } __packed;
#define EEPROM_CALIB_ALL …
#define EEPROM_XTAL …
#define EEPROM_KELVIN_TEMPERATURE …
#define EEPROM_RAW_TEMPERATURE …
enum eeprom_sku_bits { … };
#define EEPROM_RF_CFG_TYPE_MSK(x) …
#define EEPROM_RF_CFG_STEP_MSK(x) …
#define EEPROM_RF_CFG_DASH_MSK(x) …
#define EEPROM_RF_CFG_PNUM_MSK(x) …
#define EEPROM_RF_CFG_TX_ANT_MSK(x) …
#define EEPROM_RF_CFG_RX_ANT_MSK(x) …
static const u8 iwl_eeprom_band_1[14] = …;
static const u8 iwl_eeprom_band_2[] = …;
static const u8 iwl_eeprom_band_3[] = …;
static const u8 iwl_eeprom_band_4[] = …;
static const u8 iwl_eeprom_band_5[] = …;
static const u8 iwl_eeprom_band_6[] = …;
static const u8 iwl_eeprom_band_7[] = …;
#define IWL_NUM_CHANNELS …
static struct ieee80211_rate iwl_cfg80211_rates[] = …;
#define RATES_24_OFFS …
#define N_RATES_24 …
#define RATES_52_OFFS …
#define N_RATES_52 …
static u16 iwl_eeprom_query16(const u8 *eeprom, size_t eeprom_size, int offset)
{ … }
static u32 eeprom_indirect_address(const u8 *eeprom, size_t eeprom_size,
u32 address)
{ … }
static const u8 *iwl_eeprom_query_addr(const u8 *eeprom, size_t eeprom_size,
u32 offset)
{ … }
static int iwl_eeprom_read_calib(const u8 *eeprom, size_t eeprom_size,
struct iwl_nvm_data *data)
{ … }
enum iwl_eeprom_channel_flags { … };
struct iwl_eeprom_channel { … } __packed;
enum iwl_eeprom_enhanced_txpwr_flags { … };
struct iwl_eeprom_enhanced_txpwr { … } __packed;
static s8 iwl_get_max_txpwr_half_dbm(const struct iwl_nvm_data *data,
struct iwl_eeprom_enhanced_txpwr *txp)
{ … }
#define EEPROM_TXP_OFFS …
#define EEPROM_TXP_ENTRY_LEN …
#define EEPROM_TXP_SZ_OFFS …
#define TXP_CHECK_AND_PRINT(x) …
static void
iwl_eeprom_enh_txp_read_element(struct iwl_nvm_data *data,
struct iwl_eeprom_enhanced_txpwr *txp,
int n_channels, s8 max_txpower_avg)
{ … }
static void iwl_eeprom_enhanced_txpower(struct device *dev,
struct iwl_nvm_data *data,
const u8 *eeprom, size_t eeprom_size,
int n_channels)
{ … }
static void iwl_init_band_reference(const struct iwl_cfg *cfg,
const u8 *eeprom, size_t eeprom_size,
int eeprom_band, int *eeprom_ch_count,
const struct iwl_eeprom_channel **ch_info,
const u8 **eeprom_ch_array)
{ … }
#define CHECK_AND_PRINT(x) …
static void iwl_mod_ht40_chan_info(struct device *dev,
struct iwl_nvm_data *data, int n_channels,
enum nl80211_band band, u16 channel,
const struct iwl_eeprom_channel *eeprom_ch,
u8 clear_ht40_extension_channel)
{ … }
#define CHECK_AND_PRINT_I(x) …
static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
struct iwl_nvm_data *data,
const u8 *eeprom, size_t eeprom_size)
{ … }
#define IWL_EEPROM_ACCESS_TIMEOUT …
#define IWL_EEPROM_SEM_TIMEOUT …
#define IWL_EEPROM_SEM_RETRY_LIMIT …
static int iwl_eeprom_acquire_semaphore(struct iwl_trans *trans)
{ … }
static void iwl_eeprom_release_semaphore(struct iwl_trans *trans)
{ … }
static int iwl_eeprom_verify_signature(struct iwl_trans *trans, bool nvm_is_otp)
{ … }
static void iwl_set_otp_access_absolute(struct iwl_trans *trans)
{ … }
static int iwl_nvm_is_otp(struct iwl_trans *trans)
{ … }
static int iwl_init_otp_access(struct iwl_trans *trans)
{ … }
static int iwl_read_otp_word(struct iwl_trans *trans, u16 addr,
__le16 *eeprom_data)
{ … }
static bool iwl_is_otp_empty(struct iwl_trans *trans)
{ … }
static int iwl_find_otp_image(struct iwl_trans *trans,
u16 *validblockaddr)
{ … }
int iwl_read_eeprom(struct iwl_trans *trans, u8 **eeprom, size_t *eeprom_size)
{ … }
static void iwl_init_sbands(struct iwl_trans *trans, const struct iwl_cfg *cfg,
struct iwl_nvm_data *data,
const u8 *eeprom, size_t eeprom_size)
{ … }
struct iwl_nvm_data *
iwl_parse_eeprom_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
const u8 *eeprom, size_t eeprom_size)
{ … }