drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h

Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h

File Facts

System
Linux kernel
Corpus path
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h
Extension
.h
Size
6663 bytes
Lines
192
Domain
Driver Families
Bucket
drivers/net
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct iwl_reg_capa {
	bool allow_40mhz;
	bool allow_80mhz;
	bool allow_160mhz;
	bool allow_320mhz;
	bool disable_11ax;
	bool disable_11be;
	bool disable_11bn;
};

/**
 * enum iwl_nvm_channel_flags - channel flags in NVM
 * @NVM_CHANNEL_VALID: channel is usable for this SKU/geo
 * @NVM_CHANNEL_IBSS: usable as an IBSS channel and deprecated
 *	when %IWL_NVM_SBANDS_FLAGS_LAR enabled.
 * @NVM_CHANNEL_ALLOW_20MHZ_ACTIVITY: active scanning allowed and
 *	AP allowed only in 20 MHz. Valid only
 *	when %IWL_NVM_SBANDS_FLAGS_LAR enabled.
 * @NVM_CHANNEL_ACTIVE: active scanning allowed and allows IBSS
 *	when %IWL_NVM_SBANDS_FLAGS_LAR enabled.
 * @NVM_CHANNEL_RADAR: radar detection required
 * @NVM_CHANNEL_INDOOR_ONLY: only indoor use is allowed
 * @NVM_CHANNEL_GO_CONCURRENT: GO operation is allowed when connected to BSS
 *	on same channel on 2.4 or same UNII band on 5.2
 * @NVM_CHANNEL_UNIFORM: uniform spreading required
 * @NVM_CHANNEL_20MHZ: 20 MHz channel okay
 * @NVM_CHANNEL_40MHZ: 40 MHz channel okay
 * @NVM_CHANNEL_80MHZ: 80 MHz channel okay
 * @NVM_CHANNEL_160MHZ: 160 MHz channel okay
 * @NVM_CHANNEL_DC_HIGH: DC HIGH required/allowed (?)
 * @NVM_CHANNEL_VLP: client support connection to UHB VLP AP
 * @NVM_CHANNEL_AFC: client support connection to UHB AFC AP
 * @NVM_CHANNEL_VLP_AP_NOT_ALLOWED: UHB VLP AP not allowed,
 *	Valid only when %NVM_CHANNEL_VLP is enabled.
 */
enum iwl_nvm_channel_flags {
	NVM_CHANNEL_VALID			= BIT(0),
	NVM_CHANNEL_IBSS			= BIT(1),
	NVM_CHANNEL_ALLOW_20MHZ_ACTIVITY	= BIT(2),
	NVM_CHANNEL_ACTIVE			= BIT(3),
	NVM_CHANNEL_RADAR			= BIT(4),
	NVM_CHANNEL_INDOOR_ONLY			= BIT(5),
	NVM_CHANNEL_GO_CONCURRENT		= BIT(6),
	NVM_CHANNEL_UNIFORM			= BIT(7),
	NVM_CHANNEL_20MHZ			= BIT(8),
	NVM_CHANNEL_40MHZ			= BIT(9),
	NVM_CHANNEL_80MHZ			= BIT(10),
	NVM_CHANNEL_160MHZ			= BIT(11),
	NVM_CHANNEL_DC_HIGH			= BIT(12),
	NVM_CHANNEL_VLP				= BIT(13),
	NVM_CHANNEL_AFC				= BIT(14),
	NVM_CHANNEL_VLP_AP_NOT_ALLOWED		= BIT(15),
};

#if IS_ENABLED(CONFIG_IWLWIFI_KUNIT_TESTS)
u32 iwl_nvm_get_regdom_bw_flags(const u16 *nvm_chan,
				int ch_idx, u16 nvm_flags,
				struct iwl_reg_capa reg_capa);
#endif

/*
 * iwl_parse_nvm_data - parse NVM data and return values
 *
 * This function parses all NVM 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_nvm_data().
 */
struct iwl_nvm_data *
iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_rf_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_parse_nvm_mcc_info - parse MCC (mobile country code) info coming from FW
 *
 * This function parses the regulatory channel data received as a
 * MCC_UPDATE_CMD command.
 *
 * Return: a newly allocation regulatory domain, to be given to the regulatory
 *	core. In case the geo_info is set handle accordingly. An ERR_PTR is
 *	returned on error. If not given to the regulatory core, the user is
 *	responsible for freeing the regdomain returned here with kfree().
 *
 * @trans: the transport
 * @num_of_ch: the number of channels
 * @channels: channel map

Annotation

Implementation Notes