#include <linux/types.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <linux/etherdevice.h>
#include <linux/pci.h>
#include <linux/firmware.h>
#include "iwl-drv.h"
#include "iwl-modparams.h"
#include "iwl-nvm-parse.h"
#include "iwl-prph.h"
#include "iwl-io.h"
#include "iwl-csr.h"
#include "fw/acpi.h"
#include "fw/api/nvm-reg.h"
#include "fw/api/commands.h"
#include "fw/api/cmdhdr.h"
#include "fw/img.h"
#include "mei/iwl-mei.h"
enum nvm_offsets { … };
enum ext_nvm_offsets { … };
enum nvm_sku_bits { … };
static const u16 iwl_nvm_channels[] = …;
static const u16 iwl_ext_nvm_channels[] = …;
static const u16 iwl_uhb_nvm_channels[] = …;
#define IWL_NVM_NUM_CHANNELS …
#define IWL_NVM_NUM_CHANNELS_EXT …
#define IWL_NVM_NUM_CHANNELS_UHB …
#define NUM_2GHZ_CHANNELS …
#define NUM_5GHZ_CHANNELS …
#define FIRST_2GHZ_HT_MINUS …
#define LAST_2GHZ_HT_PLUS …
#define N_HW_ADDR_MASK …
static struct ieee80211_rate iwl_cfg80211_rates[] = …;
#define RATES_24_OFFS …
#define N_RATES_24 …
#define RATES_52_OFFS …
#define N_RATES_52 …
enum iwl_nvm_channel_flags { … };
enum iwl_reg_capa_flags_v1 { … };
enum iwl_reg_capa_flags_v2 { … };
enum iwl_reg_capa_flags_v4 { … };
#define REG_CAPA_V2_RESP_VER …
#define REG_CAPA_V4_RESP_VER …
struct iwl_reg_capa { … };
static inline void iwl_nvm_print_channel_flags(struct device *dev, u32 level,
int chan, u32 flags)
{ … }
static u32 iwl_get_channel_flags(u8 ch_num, int ch_idx, enum nl80211_band band,
u32 nvm_flags, const struct iwl_cfg *cfg)
{ … }
static enum nl80211_band iwl_nl80211_band_from_channel_idx(int ch_idx)
{ … }
static int iwl_init_channel_map(struct iwl_trans *trans,
const struct iwl_fw *fw,
struct iwl_nvm_data *data,
const void * const nvm_ch_flags,
u32 sbands_flags, bool v4)
{ … }
static void iwl_init_vht_hw_capab(struct iwl_trans *trans,
struct iwl_nvm_data *data,
struct ieee80211_sta_vht_cap *vht_cap,
u8 tx_chains, u8 rx_chains)
{ … }
static const u8 iwl_vendor_caps[] = …;
static const struct ieee80211_sband_iftype_data iwl_he_eht_capa[] = …;
static void iwl_init_he_6ghz_capa(struct iwl_trans *trans,
struct iwl_nvm_data *data,
struct ieee80211_supported_band *sband,
u8 tx_chains, u8 rx_chains)
{ … }
static void
iwl_nvm_fixup_sband_iftd(struct iwl_trans *trans,
struct iwl_nvm_data *data,
struct ieee80211_supported_band *sband,
struct ieee80211_sband_iftype_data *iftype_data,
u8 tx_chains, u8 rx_chains,
const struct iwl_fw *fw)
{ … }
static void iwl_init_he_hw_capab(struct iwl_trans *trans,
struct iwl_nvm_data *data,
struct ieee80211_supported_band *sband,
u8 tx_chains, u8 rx_chains,
const struct iwl_fw *fw)
{ … }
void iwl_reinit_cab(struct iwl_trans *trans, struct iwl_nvm_data *data,
u8 tx_chains, u8 rx_chains, const struct iwl_fw *fw)
{ … }
IWL_EXPORT_SYMBOL(iwl_reinit_cab);
static void iwl_init_sbands(struct iwl_trans *trans,
struct iwl_nvm_data *data,
const void *nvm_ch_flags, u8 tx_chains,
u8 rx_chains, u32 sbands_flags, bool v4,
const struct iwl_fw *fw)
{ … }
static int iwl_get_sku(const struct iwl_cfg *cfg, const __le16 *nvm_sw,
const __le16 *phy_sku)
{ … }
static int iwl_get_nvm_version(const struct iwl_cfg *cfg, const __le16 *nvm_sw)
{ … }
static int iwl_get_radio_cfg(const struct iwl_cfg *cfg, const __le16 *nvm_sw,
const __le16 *phy_sku)
{ … }
static int iwl_get_n_hw_addrs(const struct iwl_cfg *cfg, const __le16 *nvm_sw)
{ … }
static void iwl_set_radio_cfg(const struct iwl_cfg *cfg,
struct iwl_nvm_data *data,
u32 radio_cfg)
{ … }
static void iwl_flip_hw_address(__le32 mac_addr0, __le32 mac_addr1, u8 *dest)
{ … }
static void iwl_set_hw_address_from_csr(struct iwl_trans *trans,
struct iwl_nvm_data *data)
{ … }
static void iwl_set_hw_address_family_8000(struct iwl_trans *trans,
const struct iwl_cfg *cfg,
struct iwl_nvm_data *data,
const __le16 *mac_override,
const __be16 *nvm_hw)
{ … }
static int iwl_set_hw_address(struct iwl_trans *trans,
const struct iwl_cfg *cfg,
struct iwl_nvm_data *data, const __be16 *nvm_hw,
const __le16 *mac_override)
{ … }
static bool
iwl_nvm_no_wide_in_5ghz(struct iwl_trans *trans, const struct iwl_cfg *cfg,
const __be16 *nvm_hw)
{ … }
struct iwl_nvm_data *
iwl_parse_mei_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
const struct iwl_mei_nvm *mei_nvm,
const struct iwl_fw *fw, u8 tx_ant, u8 rx_ant)
{ … }
IWL_EXPORT_SYMBOL(iwl_parse_mei_nvm_data);
struct iwl_nvm_data *
iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
const struct iwl_fw *fw,
const __be16 *nvm_hw, const __le16 *nvm_sw,
const __le16 *nvm_calib, const __le16 *regulatory,
const __le16 *mac_override, const __le16 *phy_sku,
u8 tx_chains, u8 rx_chains)
{ … }
IWL_EXPORT_SYMBOL(iwl_parse_nvm_data);
static u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
int ch_idx, u16 nvm_flags,
struct iwl_reg_capa reg_capa,
const struct iwl_cfg *cfg)
{ … }
static struct iwl_reg_capa iwl_get_reg_capa(u32 flags, u8 resp_ver)
{ … }
struct ieee80211_regdomain *
iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
int num_of_ch, __le32 *channels, u16 fw_mcc,
u16 geo_info, u32 cap, u8 resp_ver)
{ … }
IWL_EXPORT_SYMBOL(iwl_parse_nvm_mcc_info);
#define IWL_MAX_NVM_SECTION_SIZE …
#define IWL_MAX_EXT_NVM_SECTION_SIZE …
#define MAX_NVM_FILE_LEN …
void iwl_nvm_fixups(u32 hw_id, unsigned int section, u8 *data,
unsigned int len)
{ … }
IWL_EXPORT_SYMBOL(iwl_nvm_fixups);
int iwl_read_external_nvm(struct iwl_trans *trans,
const char *nvm_file_name,
struct iwl_nvm_section *nvm_sections)
{ … }
IWL_EXPORT_SYMBOL(iwl_read_external_nvm);
struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans,
const struct iwl_fw *fw,
u8 set_tx_ant, u8 set_rx_ant)
{ … }
IWL_EXPORT_SYMBOL(iwl_get_nvm);