162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) 2005-2014, 2018, 2020-2022 Intel Corporation 462306a36Sopenharmony_ci * Copyright (C) 2015 Intel Mobile Communications GmbH 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci#ifndef __iwl_eeprom_parse_h__ 762306a36Sopenharmony_ci#define __iwl_eeprom_parse_h__ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#include <linux/types.h> 1062306a36Sopenharmony_ci#include <linux/if_ether.h> 1162306a36Sopenharmony_ci#include <net/cfg80211.h> 1262306a36Sopenharmony_ci#include "iwl-trans.h" 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_cistruct iwl_nvm_data { 1562306a36Sopenharmony_ci int n_hw_addrs; 1662306a36Sopenharmony_ci u8 hw_addr[ETH_ALEN]; 1762306a36Sopenharmony_ci 1862306a36Sopenharmony_ci u8 calib_version; 1962306a36Sopenharmony_ci __le16 calib_voltage; 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci __le16 raw_temperature; 2262306a36Sopenharmony_ci __le16 kelvin_temperature; 2362306a36Sopenharmony_ci __le16 kelvin_voltage; 2462306a36Sopenharmony_ci __le16 xtal_calib[2]; 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci bool sku_cap_band_24ghz_enable; 2762306a36Sopenharmony_ci bool sku_cap_band_52ghz_enable; 2862306a36Sopenharmony_ci bool sku_cap_11n_enable; 2962306a36Sopenharmony_ci bool sku_cap_11ac_enable; 3062306a36Sopenharmony_ci bool sku_cap_11ax_enable; 3162306a36Sopenharmony_ci bool sku_cap_amt_enable; 3262306a36Sopenharmony_ci bool sku_cap_ipan_enable; 3362306a36Sopenharmony_ci bool sku_cap_mimo_disabled; 3462306a36Sopenharmony_ci bool sku_cap_11be_enable; 3562306a36Sopenharmony_ci 3662306a36Sopenharmony_ci u16 radio_cfg_type; 3762306a36Sopenharmony_ci u8 radio_cfg_step; 3862306a36Sopenharmony_ci u8 radio_cfg_dash; 3962306a36Sopenharmony_ci u8 radio_cfg_pnum; 4062306a36Sopenharmony_ci u8 valid_tx_ant, valid_rx_ant; 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci u32 nvm_version; 4362306a36Sopenharmony_ci s8 max_tx_pwr_half_dbm; 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci bool lar_enabled; 4662306a36Sopenharmony_ci bool vht160_supported; 4762306a36Sopenharmony_ci struct ieee80211_supported_band bands[NUM_NL80211_BANDS]; 4862306a36Sopenharmony_ci 4962306a36Sopenharmony_ci /* 5062306a36Sopenharmony_ci * iftype data for low (2.4 GHz) high (5 GHz) and uhb (6 GHz) bands 5162306a36Sopenharmony_ci */ 5262306a36Sopenharmony_ci struct { 5362306a36Sopenharmony_ci struct ieee80211_sband_iftype_data low[2]; 5462306a36Sopenharmony_ci struct ieee80211_sband_iftype_data high[2]; 5562306a36Sopenharmony_ci struct ieee80211_sband_iftype_data uhb[2]; 5662306a36Sopenharmony_ci } iftd; 5762306a36Sopenharmony_ci 5862306a36Sopenharmony_ci struct ieee80211_channel channels[]; 5962306a36Sopenharmony_ci}; 6062306a36Sopenharmony_ci 6162306a36Sopenharmony_ci/** 6262306a36Sopenharmony_ci * iwl_parse_eeprom_data - parse EEPROM data and return values 6362306a36Sopenharmony_ci * 6462306a36Sopenharmony_ci * @dev: device pointer we're parsing for, for debug only 6562306a36Sopenharmony_ci * @cfg: device configuration for parsing and overrides 6662306a36Sopenharmony_ci * @eeprom: the EEPROM data 6762306a36Sopenharmony_ci * @eeprom_size: length of the EEPROM data 6862306a36Sopenharmony_ci * 6962306a36Sopenharmony_ci * This function parses all EEPROM values we need and then 7062306a36Sopenharmony_ci * returns a (newly allocated) struct containing all the 7162306a36Sopenharmony_ci * relevant values for driver use. The struct must be freed 7262306a36Sopenharmony_ci * later with iwl_free_nvm_data(). 7362306a36Sopenharmony_ci */ 7462306a36Sopenharmony_cistruct iwl_nvm_data * 7562306a36Sopenharmony_ciiwl_parse_eeprom_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, 7662306a36Sopenharmony_ci const u8 *eeprom, size_t eeprom_size); 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ciint iwl_init_sband_channels(struct iwl_nvm_data *data, 7962306a36Sopenharmony_ci struct ieee80211_supported_band *sband, 8062306a36Sopenharmony_ci int n_channels, enum nl80211_band band); 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_civoid iwl_init_ht_hw_capab(struct iwl_trans *trans, 8362306a36Sopenharmony_ci struct iwl_nvm_data *data, 8462306a36Sopenharmony_ci struct ieee80211_sta_ht_cap *ht_info, 8562306a36Sopenharmony_ci enum nl80211_band band, 8662306a36Sopenharmony_ci u8 tx_chains, u8 rx_chains); 8762306a36Sopenharmony_ci 8862306a36Sopenharmony_ci#endif /* __iwl_eeprom_parse_h__ */ 89