Lines Matching full:eeprom

13 #include "eeprom.h"
51 /* Parts of eeprom not in the usage map (0x80-0xc0,0xf0) in mt7601u_efuse_read()
90 …dev_err(dev->dev, "Error: your device needs default EEPROM file and this driver doesn't support it… in mt7601u_efuse_physical_size_check()
98 mt7601u_has_tssi(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_has_tssi() argument
100 u16 nic_conf1 = get_unaligned_le16(eeprom + MT_EE_NIC_CONF_1); in mt7601u_has_tssi()
106 mt7601u_set_chip_cap(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_set_chip_cap() argument
108 u16 nic_conf0 = get_unaligned_le16(eeprom + MT_EE_NIC_CONF_0); in mt7601u_set_chip_cap()
109 u16 nic_conf1 = get_unaligned_le16(eeprom + MT_EE_NIC_CONF_1); in mt7601u_set_chip_cap()
114 dev->ee->tssi_enabled = mt7601u_has_tssi(dev, eeprom) && in mt7601u_set_chip_cap()
131 u8 *eeprom, u8 max_pwr) in mt7601u_set_channel_target_power() argument
133 u8 trgt_pwr = eeprom[MT_EE_TX_TSSI_TARGET_POWER]; in mt7601u_set_channel_target_power()
136 dev_warn(dev->dev, "Error: EEPROM trgt power invalid %hhx!\n", in mt7601u_set_channel_target_power()
145 mt7601u_set_channel_power(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_set_channel_power() argument
153 if (mt7601u_has_tssi(dev, eeprom)) { in mt7601u_set_channel_power()
154 mt7601u_set_channel_target_power(dev, eeprom, max_pwr); in mt7601u_set_channel_power()
159 s8 power = field_validate(eeprom[MT_EE_TX_POWER_OFFSET + i]); in mt7601u_set_channel_power()
169 mt7601u_set_country_reg(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_set_country_reg() argument
175 /* EEPROM country regions 0 - 7 */ in mt7601u_set_country_reg()
178 /* EEPROM country regions 32 - 33 */ in mt7601u_set_country_reg()
181 u8 val = eeprom[MT_EE_COUNTRY_REGION]; in mt7601u_set_country_reg()
191 "EEPROM country region %02x (channels %d-%d)\n", in mt7601u_set_country_reg()
205 mt7601u_set_rf_freq_off(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_set_rf_freq_off() argument
209 dev->ee->rf_freq_off = field_validate(eeprom[MT_EE_FREQ_OFFSET]); in mt7601u_set_rf_freq_off()
210 comp = field_validate(eeprom[MT_EE_FREQ_OFFSET_COMPENSATION]); in mt7601u_set_rf_freq_off()
219 mt7601u_set_rssi_offset(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_set_rssi_offset() argument
225 rssi_offset[i] = eeprom[MT_EE_RSSI_OFFSET + i]; in mt7601u_set_rssi_offset()
229 "Warning: EEPROM RSSI is invalid %02hhx\n", in mt7601u_set_rssi_offset()
309 mt7601u_config_tx_power_per_rate(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_config_tx_power_per_rate() argument
315 bw40_delta = get_delta(eeprom[MT_EE_TX_POWER_DELTA_BW40]); in mt7601u_config_tx_power_per_rate()
318 val = get_unaligned_le32(eeprom + MT_EE_TX_POWER_BYRATE(i)); in mt7601u_config_tx_power_per_rate()
330 mt7601u_init_tssi_params(struct mt7601u_dev *dev, u8 *eeprom) in mt7601u_init_tssi_params() argument
337 d->slope = eeprom[MT_EE_TX_TSSI_SLOPE]; in mt7601u_init_tssi_params()
338 d->tx0_delta_offset = eeprom[MT_EE_TX_TSSI_OFFSET] * 1024; in mt7601u_init_tssi_params()
339 d->offset[0] = eeprom[MT_EE_TX_TSSI_OFFSET_GROUP]; in mt7601u_init_tssi_params()
340 d->offset[1] = eeprom[MT_EE_TX_TSSI_OFFSET_GROUP + 1]; in mt7601u_init_tssi_params()
341 d->offset[2] = eeprom[MT_EE_TX_TSSI_OFFSET_GROUP + 2]; in mt7601u_init_tssi_params()
347 u8 *eeprom; in mt7601u_eeprom_init() local
358 eeprom = kmalloc(MT7601U_EEPROM_SIZE, GFP_KERNEL); in mt7601u_eeprom_init()
359 if (!eeprom) in mt7601u_eeprom_init()
363 ret = mt7601u_efuse_read(dev, i, eeprom + i, MT_EE_READ); in mt7601u_eeprom_init()
368 if (eeprom[MT_EE_VERSION_EE] > MT7601U_EE_MAX_VER) in mt7601u_eeprom_init()
370 "Warning: unsupported EEPROM version %02hhx\n", in mt7601u_eeprom_init()
371 eeprom[MT_EE_VERSION_EE]); in mt7601u_eeprom_init()
372 dev_info(dev->dev, "EEPROM ver:%02hhx fae:%02hhx\n", in mt7601u_eeprom_init()
373 eeprom[MT_EE_VERSION_EE], eeprom[MT_EE_VERSION_FAE]); in mt7601u_eeprom_init()
375 mt7601u_set_macaddr(dev, eeprom + MT_EE_MAC_ADDR); in mt7601u_eeprom_init()
376 mt7601u_set_chip_cap(dev, eeprom); in mt7601u_eeprom_init()
377 mt7601u_set_channel_power(dev, eeprom); in mt7601u_eeprom_init()
378 mt7601u_set_country_reg(dev, eeprom); in mt7601u_eeprom_init()
379 mt7601u_set_rf_freq_off(dev, eeprom); in mt7601u_eeprom_init()
380 mt7601u_set_rssi_offset(dev, eeprom); in mt7601u_eeprom_init()
381 dev->ee->ref_temp = eeprom[MT_EE_REF_TEMP]; in mt7601u_eeprom_init()
382 dev->ee->lna_gain = eeprom[MT_EE_LNA_GAIN]; in mt7601u_eeprom_init()
384 mt7601u_config_tx_power_per_rate(dev, eeprom); in mt7601u_eeprom_init()
386 mt7601u_init_tssi_params(dev, eeprom); in mt7601u_eeprom_init()
388 kfree(eeprom); in mt7601u_eeprom_init()