Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
0002 /*
0003  * Copyright (C) 2005-2014, 2018 Intel Corporation
0004  * Copyright (C) 2015 Intel Mobile Communications GmbH
0005  */
0006 #ifndef __iwl_eeprom_parse_h__
0007 #define __iwl_eeprom_parse_h__
0008 
0009 #include <linux/types.h>
0010 #include <linux/if_ether.h>
0011 #include <net/cfg80211.h>
0012 #include "iwl-trans.h"
0013 
0014 struct iwl_nvm_data {
0015     int n_hw_addrs;
0016     u8 hw_addr[ETH_ALEN];
0017 
0018     u8 calib_version;
0019     __le16 calib_voltage;
0020 
0021     __le16 raw_temperature;
0022     __le16 kelvin_temperature;
0023     __le16 kelvin_voltage;
0024     __le16 xtal_calib[2];
0025 
0026     bool sku_cap_band_24ghz_enable;
0027     bool sku_cap_band_52ghz_enable;
0028     bool sku_cap_11n_enable;
0029     bool sku_cap_11ac_enable;
0030     bool sku_cap_11ax_enable;
0031     bool sku_cap_amt_enable;
0032     bool sku_cap_ipan_enable;
0033     bool sku_cap_mimo_disabled;
0034 
0035     u16 radio_cfg_type;
0036     u8 radio_cfg_step;
0037     u8 radio_cfg_dash;
0038     u8 radio_cfg_pnum;
0039     u8 valid_tx_ant, valid_rx_ant;
0040 
0041     u32 nvm_version;
0042     s8 max_tx_pwr_half_dbm;
0043 
0044     bool lar_enabled;
0045     bool vht160_supported;
0046     struct ieee80211_supported_band bands[NUM_NL80211_BANDS];
0047 
0048     /*
0049      * iftype data for low (2.4 GHz) and high (5 and 6 GHz) bands,
0050      * we can use the same for 5 and 6 GHz bands because they have
0051      * the same data
0052      */
0053     struct {
0054         struct ieee80211_sband_iftype_data low[2];
0055         struct ieee80211_sband_iftype_data high[2];
0056     } iftd;
0057 
0058     struct ieee80211_channel channels[];
0059 };
0060 
0061 /**
0062  * iwl_parse_eeprom_data - parse EEPROM data and return values
0063  *
0064  * @dev: device pointer we're parsing for, for debug only
0065  * @cfg: device configuration for parsing and overrides
0066  * @eeprom: the EEPROM data
0067  * @eeprom_size: length of the EEPROM data
0068  *
0069  * This function parses all EEPROM values we need and then
0070  * returns a (newly allocated) struct containing all the
0071  * relevant values for driver use. The struct must be freed
0072  * later with iwl_free_nvm_data().
0073  */
0074 struct iwl_nvm_data *
0075 iwl_parse_eeprom_data(struct iwl_trans *trans, const struct iwl_cfg *cfg,
0076               const u8 *eeprom, size_t eeprom_size);
0077 
0078 int iwl_init_sband_channels(struct iwl_nvm_data *data,
0079                 struct ieee80211_supported_band *sband,
0080                 int n_channels, enum nl80211_band band);
0081 
0082 void iwl_init_ht_hw_capab(struct iwl_trans *trans,
0083               struct iwl_nvm_data *data,
0084               struct ieee80211_sta_ht_cap *ht_info,
0085               enum nl80211_band band,
0086               u8 tx_chains, u8 rx_chains);
0087 
0088 #endif /* __iwl_eeprom_parse_h__ */